summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2022-08-08 17:17:45 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2022-08-08 17:17:45 +0200
commit564d37470445c701037e1122aa1a1c2dde8209f8 (patch)
tree5f645c4e11d5f6b351d94ad25ba088c4a3573ec4
parentbfdc4ff22ecf626eb46479e1a0dc1049d61a8d78 (diff)
parent50b270525a5d2626c81425890e74d906f5515e89 (diff)
downloadmariadb-git-564d37470445c701037e1122aa1a1c2dde8209f8.tar.gz
Merge branch '10.8' into 10.9
-rw-r--r--client/mysqldump.c65
-rw-r--r--client/mysqlimport.c8
-rw-r--r--cmake/cpack_rpm.cmake2
-rw-r--r--extra/mariabackup/backup_copy.cc83
-rw-r--r--extra/mariabackup/backup_copy.h7
-rw-r--r--extra/mariabackup/backup_mysql.cc248
-rw-r--r--extra/mariabackup/backup_mysql.h6
-rw-r--r--extra/mariabackup/common.h10
-rw-r--r--extra/mariabackup/xtrabackup.cc63
-rw-r--r--extra/mariabackup/xtrabackup.h2
-rw-r--r--extra/wolfssl/CMakeLists.txt3
-rw-r--r--extra/wolfssl/user_settings.h.in2
m---------extra/wolfssl/wolfssl0
-rw-r--r--include/mysql/psi/mysql_file.h2
-rw-r--r--include/mysql/psi/mysql_idle.h2
-rw-r--r--include/mysql/psi/mysql_mdl.h2
-rw-r--r--include/mysql/psi/mysql_memory.h2
-rw-r--r--include/mysql/psi/mysql_ps.h2
-rw-r--r--include/mysql/psi/mysql_socket.h2
-rw-r--r--include/mysql/psi/mysql_sp.h2
-rw-r--r--include/mysql/psi/mysql_stage.h2
-rw-r--r--include/mysql/psi/mysql_statement.h2
-rw-r--r--include/mysql/psi/mysql_thread.h9
-rw-r--r--include/mysql/psi/mysql_transaction.h2
-rw-r--r--include/mysql/psi/psi.h13
-rw-r--r--include/mysql/psi/psi_abi_v0.h2
-rw-r--r--include/mysql/psi/psi_abi_v1.h2
-rw-r--r--include/mysql/psi/psi_abi_v1.h.pp3
-rw-r--r--include/mysql/psi/psi_abi_v2.h2
-rw-r--r--include/mysql/psi/psi_base.h8
-rw-r--r--include/mysql/psi/psi_memory.h2
-rw-r--r--include/pfs_thread_provider.h2
m---------libmariadb0
-rw-r--r--man/mysqldump.130
-rw-r--r--mysql-test/include/default_my.cnf1
-rw-r--r--mysql-test/include/have_query_cache_disabled.inc36
-rw-r--r--mysql-test/include/type_mix_incompatible.inc58
-rw-r--r--mysql-test/include/wait_until_disconnected.inc2
-rw-r--r--mysql-test/main/func_group.result25
-rw-r--r--mysql-test/main/func_group.test19
-rw-r--r--mysql-test/main/func_json.result11
-rw-r--r--mysql-test/main/func_json.test14
-rw-r--r--mysql-test/main/get_diagnostics.result8
-rw-r--r--mysql-test/main/gis.result4
-rw-r--r--mysql-test/main/init_file_longline_3816.result2
-rw-r--r--mysql-test/main/insert_select.result89
-rw-r--r--mysql-test/main/insert_select.test82
-rw-r--r--mysql-test/main/kill.test12
-rw-r--r--mysql-test/main/lock_view.result49
-rw-r--r--mysql-test/main/long_unique_bugs.result19
-rw-r--r--mysql-test/main/long_unique_bugs.test27
-rw-r--r--mysql-test/main/mysql_tzinfo_to_sql_symlink.result40
-rw-r--r--mysql-test/main/mysql_tzinfo_to_sql_symlink.test17
-rw-r--r--mysql-test/main/mysql_upgrade.result38
-rw-r--r--mysql-test/main/mysql_upgrade.test41
-rw-r--r--mysql-test/main/mysqlbinlog-innodb.result4
-rw-r--r--mysql-test/main/mysqlbinlog.result36
-rw-r--r--mysql-test/main/mysqlbinlog_row_compressed.result2
-rw-r--r--mysql-test/main/mysqlbinlog_row_minimal.result4
-rw-r--r--mysql-test/main/mysqlbinlog_stmt_compressed.result2
-rw-r--r--mysql-test/main/mysqld--help.result2
-rw-r--r--mysql-test/main/mysqldump-nl.result11
-rw-r--r--mysql-test/main/mysqldump-timing.result72
-rw-r--r--mysql-test/main/mysqldump-timing.test26
-rw-r--r--mysql-test/main/mysqldump.result117
-rw-r--r--mysql-test/main/openssl_1.result14
-rw-r--r--mysql-test/main/openssl_1.test14
-rw-r--r--mysql-test/main/openssl_6975,tlsv10.result12
-rw-r--r--mysql-test/main/openssl_6975,tlsv12.result12
-rw-r--r--mysql-test/main/ps_missed_cmds.result378
-rw-r--r--mysql-test/main/ps_missed_cmds_bin_prot.result32
-rw-r--r--mysql-test/main/range_notembedded.result9
-rw-r--r--mysql-test/main/range_notembedded.test9
-rw-r--r--mysql-test/main/sp-row.result6
-rw-r--r--mysql-test/main/sp-vars.result6
-rw-r--r--mysql-test/main/sp-vars.test6
-rw-r--r--mysql-test/main/sp.result2
-rw-r--r--mysql-test/main/ssl_7937,nossl.result4
-rw-r--r--mysql-test/main/ssl_7937.result2
-rw-r--r--mysql-test/main/ssl_7937.test2
-rw-r--r--mysql-test/main/ssl_ca.result2
-rw-r--r--mysql-test/main/ssl_ca.test2
-rw-r--r--mysql-test/main/ssl_cipher.result2
-rw-r--r--mysql-test/main/ssl_cipher.test2
-rw-r--r--mysql-test/main/ssl_crl.result2
-rw-r--r--mysql-test/main/ssl_crl.test2
-rw-r--r--mysql-test/main/ssl_crl_clients.result8
-rw-r--r--mysql-test/main/ssl_crl_clients.test4
-rw-r--r--mysql-test/main/ssl_system_ca,bad.result2
-rw-r--r--mysql-test/main/strings.result10
-rw-r--r--mysql-test/main/strings.test12
-rw-r--r--mysql-test/main/type_geometry_mix_int.result95
-rw-r--r--mysql-test/main/type_timestamp.result24
-rw-r--r--mysql-test/main/type_timestamp.test18
-rw-r--r--mysql-test/main/user_var-binlog.result2
-rw-r--r--mysql-test/main/wait_timeout.test4
-rw-r--r--mysql-test/std_data/init_file_longline_3816.sql2
-rw-r--r--mysql-test/std_data/mdev-28727-pet4.frmbin0 -> 934 bytes
-rw-r--r--mysql-test/std_data/mdev29078-mysql-bin.000001bin0 -> 920 bytes
-rw-r--r--mysql-test/suite/archive/archive_gis.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_base64_flag.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result70
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result8
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result8
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_annotate.result12
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result4
-rw-r--r--mysql-test/suite/binlog/r/flashback.result4
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_row_annotate.result6
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-row.result8
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-row.test8
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change2.result2
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change4.result2
-rw-r--r--mysql-test/suite/encryption/r/innodb-compressed-blob.result2
-rw-r--r--mysql-test/suite/encryption/r/innodb-encryption-disable.result2
-rw-r--r--mysql-test/suite/encryption/r/innodb-missing-key.result2
-rw-r--r--mysql-test/suite/encryption/r/innodb-redo-badkey.result2
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change2.test2
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change4.test2
-rw-r--r--mysql-test/suite/encryption/t/innodb-compressed-blob.test2
-rw-r--r--mysql-test/suite/encryption/t/innodb-encryption-disable.test2
-rw-r--r--mysql-test/suite/encryption/t/innodb-missing-key.test2
-rw-r--r--mysql-test/suite/encryption/t/innodb-redo-badkey.test2
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_sp.result2
-rw-r--r--mysql-test/suite/galera/r/galera_gra_log.result2
-rw-r--r--mysql-test/suite/galera/r/galera_log_bin_ext.result23
-rw-r--r--mysql-test/suite/galera/r/galera_log_bin_ext_mariabackup.result23
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin.inc1
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin_sst.inc1
-rw-r--r--mysql-test/suite/innodb/r/change_column_collation.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_gis.result4
-rw-r--r--mysql-test/suite/innodb/r/insert_into_empty.result8
-rw-r--r--mysql-test/suite/innodb/r/update_time.result17
-rw-r--r--mysql-test/suite/innodb/t/change_column_collation.test2
-rw-r--r--mysql-test/suite/innodb/t/insert_into_empty.test11
-rw-r--r--mysql-test/suite/innodb/t/update_time.test25
-rw-r--r--mysql-test/suite/innodb_fts/r/ft_result_cache_limit.result39
-rw-r--r--mysql-test/suite/innodb_fts/t/ft_result_cache_limit.test57
-rw-r--r--mysql-test/suite/innodb_gis/r/0.result4
-rw-r--r--mysql-test/suite/innodb_gis/r/1.result4
-rw-r--r--mysql-test/suite/innodb_gis/r/gis.result4
-rw-r--r--mysql-test/suite/mariabackup/mdev-14447.result2
-rw-r--r--mysql-test/suite/mariabackup/mdev-14447.test2
-rw-r--r--mysql-test/suite/perfschema/disabled.def10
-rw-r--r--mysql-test/suite/perfschema/include/processlist_load.inc39
-rw-r--r--mysql-test/suite/perfschema/include/processlist_set.inc17
-rw-r--r--mysql-test/suite/perfschema/r/ddl_processlist.result20
-rw-r--r--mysql-test/suite/perfschema/r/dml_processlist.result24
-rw-r--r--mysql-test/suite/perfschema/r/misc_global_status.result106
-rw-r--r--mysql-test/suite/perfschema/r/processlist.result201
-rw-r--r--mysql-test/suite/perfschema/r/processlist_57.result345
-rw-r--r--mysql-test/suite/perfschema/r/processlist_acl.result255
-rw-r--r--mysql-test/suite/perfschema/r/processlist_anonymous.result66
-rw-r--r--mysql-test/suite/perfschema/r/processlist_no_pfs.result181
-rw-r--r--mysql-test/suite/perfschema/r/processlist_port.result145
-rw-r--r--mysql-test/suite/perfschema/r/processlist_reg_user.result89
-rw-r--r--mysql-test/suite/perfschema/r/show_sanity.result2
-rw-r--r--mysql-test/suite/perfschema/r/threads_mysql.result8
-rw-r--r--mysql-test/suite/perfschema/t/ddl_processlist.test32
-rw-r--r--mysql-test/suite/perfschema/t/dml_processlist.test39
-rw-r--r--mysql-test/suite/perfschema/t/misc_global_status-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/misc_global_status.test134
-rw-r--r--mysql-test/suite/perfschema/t/processlist-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/processlist.test197
-rw-r--r--mysql-test/suite/perfschema/t/processlist_57.test349
-rw-r--r--mysql-test/suite/perfschema/t/processlist_acl-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/processlist_acl.test196
-rw-r--r--mysql-test/suite/perfschema/t/processlist_anonymous.test111
-rw-r--r--mysql-test/suite/perfschema/t/processlist_no_pfs-master.opt2
-rw-r--r--mysql-test/suite/perfschema/t/processlist_no_pfs.test29
-rw-r--r--mysql-test/suite/perfschema/t/processlist_port-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/processlist_port.test162
-rw-r--r--mysql-test/suite/perfschema/t/processlist_reg_user.test134
-rw-r--r--mysql-test/suite/perfschema/t/threads_mysql.test6
-rw-r--r--mysql-test/suite/plugins/r/binlog-simple_plugin_check.result2
-rw-r--r--mysql-test/suite/plugins/r/cracklib_password_check.result26
-rw-r--r--mysql-test/suite/plugins/r/password_reuse_check.result16
-rw-r--r--mysql-test/suite/plugins/r/simple_password_check.result103
-rw-r--r--mysql-test/suite/plugins/r/two_password_validations.result10
-rw-r--r--mysql-test/suite/plugins/t/simple_password_check.test14
-rw-r--r--mysql-test/suite/roles/definer.result47
-rw-r--r--mysql-test/suite/roles/rename_user.result9
-rw-r--r--mysql-test/suite/roles/rename_user.test10
-rw-r--r--mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_hrtime.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev382.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_old_master_29078.result92
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_timestamp.result48
-rw-r--r--mysql-test/suite/rpl/t/rpl_old_master_29078-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_old_master_29078.test49
-rw-r--r--mysql-test/suite/rpl/t/rpl_timestamp.test18
-rw-r--r--mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc48
-rw-r--r--mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result54
-rw-r--r--mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result47
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded.result4
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result4
-rw-r--r--mysql-test/suite/sys_vars/t/completion_type_func.test4
-rw-r--r--mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_basic.test26
-rw-r--r--mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_off.test7
-rw-r--r--mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on.test7
-rw-r--r--mysql-test/suite/vcol/r/vcol_misc.result16
-rw-r--r--mysql-test/suite/vcol/t/vcol_misc.test14
-rw-r--r--mysys/my_getopt.c3
-rw-r--r--mysys/psi_noop.c39
-rw-r--r--plugin/simple_password_check/simple_password_check.c28
-rw-r--r--plugin/type_inet/mysql-test/type_inet/type_inet6.result48
-rw-r--r--plugin/type_inet/mysql-test/type_inet/type_inet6_mix_decimal.result94
-rw-r--r--plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double.result94
-rw-r--r--plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_loose.result406
-rw-r--r--plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_loose.test21
-rw-r--r--plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_strict_ignore.result400
-rw-r--r--plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_strict_ignore.test21
-rw-r--r--plugin/type_inet/mysql-test/type_inet/type_inet6_mix_int.result94
-rw-r--r--plugin/type_inet/mysql-test/type_inet/type_inet6_mix_time.result94
-rw-r--r--plugin/type_inet/mysql-test/type_inet/type_inet6_mix_uint.result94
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid.result42
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_decimal.result94
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_double.result94
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_int.result94
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_time.result94
-rw-r--r--plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_uint.result94
-rw-r--r--scripts/fill_help_tables.sql1475
-rw-r--r--scripts/wsrep_sst_backup.sh2
-rw-r--r--scripts/wsrep_sst_common.sh18
-rw-r--r--scripts/wsrep_sst_mariabackup.sh15
-rw-r--r--scripts/wsrep_sst_rsync.sh9
-rw-r--r--sql/field.cc29
-rw-r--r--sql/field.h10
-rw-r--r--sql/ha_partition.cc5
-rw-r--r--sql/handler.cc37
-rw-r--r--sql/item.cc4
-rw-r--r--sql/item.h10
-rw-r--r--sql/item_cmpfunc.cc15
-rw-r--r--sql/item_func.cc2
-rw-r--r--sql/item_func.h3
-rw-r--r--sql/item_jsonfunc.cc19
-rw-r--r--sql/log_event.cc23
-rw-r--r--sql/log_event.h38
-rw-r--r--sql/log_event_client.cc11
-rw-r--r--sql/log_event_server.cc4
-rw-r--r--sql/mysqld.cc1
-rw-r--r--sql/mysqld.h1
-rw-r--r--sql/opt_range.cc40
-rw-r--r--sql/opt_range.h1
-rw-r--r--sql/share/errmsg-utf8.txt5
-rw-r--r--sql/sp_head.cc2
-rw-r--r--sql/sql_acl.cc39
-rw-r--r--sql/sql_delete.cc4
-rw-r--r--sql/sql_insert.cc21
-rw-r--r--sql/sql_insert.h1
-rw-r--r--sql/sql_lex.cc7
-rw-r--r--sql/sql_parse.cc4
-rw-r--r--sql/sql_plugin.cc2
-rw-r--r--sql/sql_prepare.cc14
-rw-r--r--sql/sql_priv.h6
-rw-r--r--sql/sql_select.cc23
-rw-r--r--sql/sql_select.h1
-rw-r--r--sql/sql_string.cc2
-rw-r--r--sql/sql_string.h2
-rw-r--r--sql/sql_table.cc18
-rw-r--r--sql/sql_type.cc12
-rw-r--r--sql/sql_type.h5
-rw-r--r--sql/sql_update.cc6
-rw-r--r--sql/sql_yacc.yy14
-rw-r--r--sql/sys_vars.cc8
-rw-r--r--sql/table.cc10
-rw-r--r--sql/table.h13
-rw-r--r--sql/tztime.cc23
m---------storage/columnstore/columnstore0
-rw-r--r--storage/connect/CMakeLists.txt50
-rw-r--r--storage/connect/connect.h2
-rw-r--r--storage/connect/ha_connect.cc58
-rw-r--r--storage/connect/ha_connect.h2
-rw-r--r--storage/connect/jsonudf.cpp4
-rw-r--r--storage/connect/mysql-test/connect/r/jdbc_postgresql.result2
-rw-r--r--storage/connect/tabwmi.cpp2
-rw-r--r--storage/innobase/btr/btr0btr.cc287
-rw-r--r--storage/innobase/btr/btr0bulk.cc3
-rw-r--r--storage/innobase/btr/btr0cur.cc107
-rw-r--r--storage/innobase/btr/btr0defragment.cc22
-rw-r--r--storage/innobase/btr/btr0pcur.cc8
-rw-r--r--storage/innobase/btr/btr0sea.cc132
-rw-r--r--storage/innobase/buf/buf0buf.cc1
-rw-r--r--storage/innobase/buf/buf0rea.cc7
-rw-r--r--storage/innobase/dict/dict0stats.cc48
-rw-r--r--storage/innobase/fts/fts0que.cc15
-rw-r--r--storage/innobase/gis/gis0rtree.cc185
-rw-r--r--storage/innobase/gis/gis0sea.cc43
-rw-r--r--storage/innobase/handler/handler0alter.cc25
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.cc70
-rw-r--r--storage/innobase/include/btr0cur.h2
-rw-r--r--storage/innobase/include/btr0pcur.h6
-rw-r--r--storage/innobase/include/btr0pcur.inl29
-rw-r--r--storage/innobase/include/gis0rtree.inl3
-rw-r--r--storage/innobase/include/page0cur.h74
-rw-r--r--storage/innobase/include/page0cur.inl71
-rw-r--r--storage/innobase/include/page0page.h79
-rw-r--r--storage/innobase/include/page0page.inl166
-rw-r--r--storage/innobase/include/rem0rec.h23
-rw-r--r--storage/innobase/include/rem0rec.inl72
-rw-r--r--storage/innobase/lock/lock0lock.cc85
-rw-r--r--storage/innobase/log/log0recv.cc34
-rw-r--r--storage/innobase/mtr/mtr0mtr.cc10
-rw-r--r--storage/innobase/page/page0cur.cc285
-rw-r--r--storage/innobase/page/page0page.cc375
-rw-r--r--storage/innobase/rem/rem0rec.cc12
-rw-r--r--storage/innobase/row/row0import.cc50
-rw-r--r--storage/innobase/row/row0ins.cc29
-rw-r--r--storage/innobase/row/row0merge.cc15
-rw-r--r--storage/innobase/row/row0sel.cc28
-rw-r--r--storage/perfschema/CMakeLists.txt4
-rw-r--r--storage/perfschema/cursor_by_account.cc2
-rw-r--r--storage/perfschema/cursor_by_account.h2
-rw-r--r--storage/perfschema/cursor_by_host.cc2
-rw-r--r--storage/perfschema/cursor_by_host.h2
-rw-r--r--storage/perfschema/cursor_by_thread.cc2
-rw-r--r--storage/perfschema/cursor_by_thread.h2
-rw-r--r--storage/perfschema/cursor_by_thread_connect_attr.cc2
-rw-r--r--storage/perfschema/cursor_by_thread_connect_attr.h2
-rw-r--r--storage/perfschema/cursor_by_user.cc2
-rw-r--r--storage/perfschema/cursor_by_user.h2
-rw-r--r--storage/perfschema/ha_perfschema.cc49
-rw-r--r--storage/perfschema/ha_perfschema.h2
-rw-r--r--storage/perfschema/pfs.cc15
-rw-r--r--storage/perfschema/pfs.h2
-rw-r--r--storage/perfschema/pfs_account.cc29
-rw-r--r--storage/perfschema/pfs_account.h2
-rw-r--r--storage/perfschema/pfs_atomic.h2
-rw-r--r--storage/perfschema/pfs_autosize.cc2
-rw-r--r--storage/perfschema/pfs_buffer_container.cc2
-rw-r--r--storage/perfschema/pfs_buffer_container.h2
-rw-r--r--storage/perfschema/pfs_builtin_memory.cc2
-rw-r--r--storage/perfschema/pfs_builtin_memory.h2
-rw-r--r--storage/perfschema/pfs_column_types.h2
-rw-r--r--storage/perfschema/pfs_column_values.cc2
-rw-r--r--storage/perfschema/pfs_column_values.h2
-rw-r--r--storage/perfschema/pfs_con_slice.cc2
-rw-r--r--storage/perfschema/pfs_con_slice.h2
-rw-r--r--storage/perfschema/pfs_defaults.cc2
-rw-r--r--storage/perfschema/pfs_defaults.h2
-rw-r--r--storage/perfschema/pfs_digest.cc2
-rw-r--r--storage/perfschema/pfs_digest.h2
-rw-r--r--storage/perfschema/pfs_engine_table.cc48
-rw-r--r--storage/perfschema/pfs_engine_table.h32
-rw-r--r--storage/perfschema/pfs_events.h2
-rw-r--r--storage/perfschema/pfs_events_stages.cc2
-rw-r--r--storage/perfschema/pfs_events_stages.h2
-rw-r--r--storage/perfschema/pfs_events_statements.cc2
-rw-r--r--storage/perfschema/pfs_events_statements.h2
-rw-r--r--storage/perfschema/pfs_events_transactions.cc2
-rw-r--r--storage/perfschema/pfs_events_transactions.h2
-rw-r--r--storage/perfschema/pfs_events_waits.cc2
-rw-r--r--storage/perfschema/pfs_events_waits.h2
-rw-r--r--storage/perfschema/pfs_global.cc2
-rw-r--r--storage/perfschema/pfs_global.h2
-rw-r--r--storage/perfschema/pfs_host.cc2
-rw-r--r--storage/perfschema/pfs_host.h2
-rw-r--r--storage/perfschema/pfs_instr.cc4
-rw-r--r--storage/perfschema/pfs_instr.h5
-rw-r--r--storage/perfschema/pfs_instr_class.cc2
-rw-r--r--storage/perfschema/pfs_instr_class.h5
-rw-r--r--storage/perfschema/pfs_lock.h2
-rw-r--r--storage/perfschema/pfs_memory.cc2
-rw-r--r--storage/perfschema/pfs_memory.h2
-rw-r--r--storage/perfschema/pfs_prepared_stmt.cc2
-rw-r--r--storage/perfschema/pfs_prepared_stmt.h2
-rw-r--r--storage/perfschema/pfs_program.cc2
-rw-r--r--storage/perfschema/pfs_program.h2
-rw-r--r--storage/perfschema/pfs_server.cc2
-rw-r--r--storage/perfschema/pfs_server.h2
-rw-r--r--storage/perfschema/pfs_setup_actor.cc2
-rw-r--r--storage/perfschema/pfs_setup_actor.h2
-rw-r--r--storage/perfschema/pfs_setup_object.cc2
-rw-r--r--storage/perfschema/pfs_setup_object.h2
-rw-r--r--storage/perfschema/pfs_stat.h2
-rw-r--r--storage/perfschema/pfs_status.cc2
-rw-r--r--storage/perfschema/pfs_status.h2
-rw-r--r--storage/perfschema/pfs_timer.cc2
-rw-r--r--storage/perfschema/pfs_timer.h2
-rw-r--r--storage/perfschema/pfs_user.cc2
-rw-r--r--storage/perfschema/pfs_user.h2
-rw-r--r--storage/perfschema/pfs_variable.cc2
-rw-r--r--storage/perfschema/pfs_variable.h2
-rw-r--r--storage/perfschema/pfs_visitor.cc2
-rw-r--r--storage/perfschema/pfs_visitor.h2
-rw-r--r--storage/perfschema/table_accounts.cc12
-rw-r--r--storage/perfschema/table_accounts.h3
-rw-r--r--storage/perfschema/table_all_instr.cc2
-rw-r--r--storage/perfschema/table_all_instr.h2
-rw-r--r--storage/perfschema/table_esgs_by_account_by_event_name.cc12
-rw-r--r--storage/perfschema/table_esgs_by_account_by_event_name.h3
-rw-r--r--storage/perfschema/table_esgs_by_host_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esgs_by_host_by_event_name.h3
-rw-r--r--storage/perfschema/table_esgs_by_thread_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esgs_by_thread_by_event_name.h3
-rw-r--r--storage/perfschema/table_esgs_by_user_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esgs_by_user_by_event_name.h3
-rw-r--r--storage/perfschema/table_esgs_global_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esgs_global_by_event_name.h3
-rw-r--r--storage/perfschema/table_esms_by_account_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esms_by_account_by_event_name.h3
-rw-r--r--storage/perfschema/table_esms_by_digest.cc11
-rw-r--r--storage/perfschema/table_esms_by_digest.h3
-rw-r--r--storage/perfschema/table_esms_by_host_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esms_by_host_by_event_name.h3
-rw-r--r--storage/perfschema/table_esms_by_program.cc11
-rw-r--r--storage/perfschema/table_esms_by_program.h3
-rw-r--r--storage/perfschema/table_esms_by_thread_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esms_by_thread_by_event_name.h3
-rw-r--r--storage/perfschema/table_esms_by_user_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esms_by_user_by_event_name.h3
-rw-r--r--storage/perfschema/table_esms_global_by_event_name.cc11
-rw-r--r--storage/perfschema/table_esms_global_by_event_name.h3
-rw-r--r--storage/perfschema/table_ets_by_account_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ets_by_account_by_event_name.h3
-rw-r--r--storage/perfschema/table_ets_by_host_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ets_by_host_by_event_name.h3
-rw-r--r--storage/perfschema/table_ets_by_thread_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ets_by_thread_by_event_name.h3
-rw-r--r--storage/perfschema/table_ets_by_user_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ets_by_user_by_event_name.h3
-rw-r--r--storage/perfschema/table_ets_global_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ets_global_by_event_name.h3
-rw-r--r--storage/perfschema/table_events_stages.cc29
-rw-r--r--storage/perfschema/table_events_stages.h5
-rw-r--r--storage/perfschema/table_events_statements.cc29
-rw-r--r--storage/perfschema/table_events_statements.h5
-rw-r--r--storage/perfschema/table_events_transactions.cc29
-rw-r--r--storage/perfschema/table_events_transactions.h5
-rw-r--r--storage/perfschema/table_events_waits.cc29
-rw-r--r--storage/perfschema/table_events_waits.h5
-rw-r--r--storage/perfschema/table_events_waits_summary.cc11
-rw-r--r--storage/perfschema/table_events_waits_summary.h3
-rw-r--r--storage/perfschema/table_ews_by_account_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ews_by_account_by_event_name.h3
-rw-r--r--storage/perfschema/table_ews_by_host_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ews_by_host_by_event_name.h3
-rw-r--r--storage/perfschema/table_ews_by_thread_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ews_by_thread_by_event_name.h3
-rw-r--r--storage/perfschema/table_ews_by_user_by_event_name.cc11
-rw-r--r--storage/perfschema/table_ews_by_user_by_event_name.h3
-rw-r--r--storage/perfschema/table_ews_global_by_event_name.cc10
-rw-r--r--storage/perfschema/table_ews_global_by_event_name.h3
-rw-r--r--storage/perfschema/table_file_instances.cc10
-rw-r--r--storage/perfschema/table_file_instances.h3
-rw-r--r--storage/perfschema/table_file_summary_by_event_name.cc10
-rw-r--r--storage/perfschema/table_file_summary_by_event_name.h3
-rw-r--r--storage/perfschema/table_file_summary_by_instance.cc11
-rw-r--r--storage/perfschema/table_file_summary_by_instance.h3
-rw-r--r--storage/perfschema/table_global_status.cc11
-rw-r--r--storage/perfschema/table_global_status.h3
-rw-r--r--storage/perfschema/table_global_variables.cc10
-rw-r--r--storage/perfschema/table_global_variables.h3
-rw-r--r--storage/perfschema/table_helper.cc2
-rw-r--r--storage/perfschema/table_helper.h2
-rw-r--r--storage/perfschema/table_host_cache.cc11
-rw-r--r--storage/perfschema/table_host_cache.h3
-rw-r--r--storage/perfschema/table_hosts.cc11
-rw-r--r--storage/perfschema/table_hosts.h3
-rw-r--r--storage/perfschema/table_md_locks.cc11
-rw-r--r--storage/perfschema/table_md_locks.h3
-rw-r--r--storage/perfschema/table_mems_by_account_by_event_name.cc11
-rw-r--r--storage/perfschema/table_mems_by_account_by_event_name.h3
-rw-r--r--storage/perfschema/table_mems_by_host_by_event_name.cc11
-rw-r--r--storage/perfschema/table_mems_by_host_by_event_name.h3
-rw-r--r--storage/perfschema/table_mems_by_thread_by_event_name.cc11
-rw-r--r--storage/perfschema/table_mems_by_thread_by_event_name.h3
-rw-r--r--storage/perfschema/table_mems_by_user_by_event_name.cc11
-rw-r--r--storage/perfschema/table_mems_by_user_by_event_name.h3
-rw-r--r--storage/perfschema/table_mems_global_by_event_name.cc11
-rw-r--r--storage/perfschema/table_mems_global_by_event_name.h3
-rw-r--r--storage/perfschema/table_os_global_by_type.cc11
-rw-r--r--storage/perfschema/table_os_global_by_type.h3
-rw-r--r--storage/perfschema/table_performance_timers.cc11
-rw-r--r--storage/perfschema/table_performance_timers.h3
-rw-r--r--storage/perfschema/table_prepared_stmt_instances.cc11
-rw-r--r--storage/perfschema/table_prepared_stmt_instances.h3
-rw-r--r--storage/perfschema/table_processlist.cc360
-rw-r--r--storage/perfschema/table_processlist.h133
-rw-r--r--storage/perfschema/table_replication_applier_configuration.cc11
-rw-r--r--storage/perfschema/table_replication_applier_configuration.h3
-rw-r--r--storage/perfschema/table_replication_applier_status.cc11
-rw-r--r--storage/perfschema/table_replication_applier_status.h3
-rw-r--r--storage/perfschema/table_replication_applier_status_by_coordinator.cc11
-rw-r--r--storage/perfschema/table_replication_applier_status_by_coordinator.h3
-rw-r--r--storage/perfschema/table_replication_applier_status_by_worker.cc11
-rw-r--r--storage/perfschema/table_replication_applier_status_by_worker.h3
-rw-r--r--storage/perfschema/table_replication_connection_configuration.cc11
-rw-r--r--storage/perfschema/table_replication_connection_configuration.h3
-rw-r--r--storage/perfschema/table_replication_connection_status.cc12
-rw-r--r--storage/perfschema/table_replication_connection_status.h3
-rw-r--r--storage/perfschema/table_replication_group_member_stats.cc12
-rw-r--r--storage/perfschema/table_replication_group_member_stats.h3
-rw-r--r--storage/perfschema/table_replication_group_members.cc12
-rw-r--r--storage/perfschema/table_replication_group_members.h3
-rw-r--r--storage/perfschema/table_session_account_connect_attrs.cc11
-rw-r--r--storage/perfschema/table_session_account_connect_attrs.h3
-rw-r--r--storage/perfschema/table_session_connect.cc2
-rw-r--r--storage/perfschema/table_session_connect.h2
-rw-r--r--storage/perfschema/table_session_connect_attrs.cc11
-rw-r--r--storage/perfschema/table_session_connect_attrs.h3
-rw-r--r--storage/perfschema/table_session_status.cc11
-rw-r--r--storage/perfschema/table_session_status.h3
-rw-r--r--storage/perfschema/table_session_variables.cc10
-rw-r--r--storage/perfschema/table_session_variables.h3
-rw-r--r--storage/perfschema/table_setup_actors.cc11
-rw-r--r--storage/perfschema/table_setup_actors.h3
-rw-r--r--storage/perfschema/table_setup_consumers.cc11
-rw-r--r--storage/perfschema/table_setup_consumers.h3
-rw-r--r--storage/perfschema/table_setup_instruments.cc11
-rw-r--r--storage/perfschema/table_setup_instruments.h3
-rw-r--r--storage/perfschema/table_setup_objects.cc10
-rw-r--r--storage/perfschema/table_setup_objects.h3
-rw-r--r--storage/perfschema/table_setup_timers.cc11
-rw-r--r--storage/perfschema/table_setup_timers.h3
-rw-r--r--storage/perfschema/table_socket_instances.cc11
-rw-r--r--storage/perfschema/table_socket_instances.h3
-rw-r--r--storage/perfschema/table_socket_summary_by_event_name.cc11
-rw-r--r--storage/perfschema/table_socket_summary_by_event_name.h3
-rw-r--r--storage/perfschema/table_socket_summary_by_instance.cc11
-rw-r--r--storage/perfschema/table_socket_summary_by_instance.h3
-rw-r--r--storage/perfschema/table_status_by_account.cc11
-rw-r--r--storage/perfschema/table_status_by_account.h3
-rw-r--r--storage/perfschema/table_status_by_host.cc11
-rw-r--r--storage/perfschema/table_status_by_host.h3
-rw-r--r--storage/perfschema/table_status_by_thread.cc13
-rw-r--r--storage/perfschema/table_status_by_thread.h3
-rw-r--r--storage/perfschema/table_status_by_user.cc11
-rw-r--r--storage/perfschema/table_status_by_user.h3
-rw-r--r--storage/perfschema/table_sync_instances.cc29
-rw-r--r--storage/perfschema/table_sync_instances.h5
-rw-r--r--storage/perfschema/table_table_handles.cc11
-rw-r--r--storage/perfschema/table_table_handles.h3
-rw-r--r--storage/perfschema/table_threads.cc11
-rw-r--r--storage/perfschema/table_threads.h3
-rw-r--r--storage/perfschema/table_tiws_by_index_usage.cc11
-rw-r--r--storage/perfschema/table_tiws_by_index_usage.h3
-rw-r--r--storage/perfschema/table_tiws_by_table.cc11
-rw-r--r--storage/perfschema/table_tiws_by_table.h3
-rw-r--r--storage/perfschema/table_tlws_by_table.cc11
-rw-r--r--storage/perfschema/table_tlws_by_table.h3
-rw-r--r--storage/perfschema/table_users.cc11
-rw-r--r--storage/perfschema/table_users.h3
-rw-r--r--storage/perfschema/table_uvar_by_thread.cc11
-rw-r--r--storage/perfschema/table_uvar_by_thread.h3
-rw-r--r--storage/perfschema/table_variables_by_thread.cc10
-rw-r--r--storage/perfschema/table_variables_by_thread.h3
-rw-r--r--storage/perfschema/unittest/CMakeLists.txt2
-rw-r--r--storage/perfschema/unittest/conf.txt2
-rw-r--r--storage/perfschema/unittest/pfs-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_account-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_connect_attr-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_host-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr_class-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_instr_class-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_misc-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_noop-t.cc5
-rw-r--r--storage/perfschema/unittest/pfs_server_stubs.cc2
-rw-r--r--storage/perfschema/unittest/pfs_timer-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_user-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/stub_global_status_var.h2
-rw-r--r--storage/perfschema/unittest/stub_pfs_defaults.h2
-rw-r--r--storage/perfschema/unittest/stub_pfs_global.h2
-rw-r--r--storage/perfschema/unittest/stub_print_error.h2
573 files changed, 10521 insertions, 4198 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 9c796cf0bac..b6f44eb8a74 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -148,6 +148,7 @@ static ulonglong opt_system= 0ULL;
static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0,
select_field_names_inited= 0;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
+static double opt_max_statement_time= 0.0;
static MYSQL mysql_connection,*mysql=0;
static DYNAMIC_STRING insert_pat, select_field_names;
static char *opt_password=0,*current_user=0,
@@ -164,6 +165,7 @@ static my_bool server_supports_switching_charsets= TRUE;
static ulong opt_compatible_mode= 0;
#define MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL 1
#define MYSQL_OPT_MASTER_DATA_COMMENTED_SQL 2
+#define MYSQL_OPT_MAX_STATEMENT_TIME 0
#define MYSQL_OPT_SLAVE_DATA_EFFECTIVE_SQL 1
#define MYSQL_OPT_SLAVE_DATA_COMMENTED_SQL 2
static uint opt_mysql_port= 0, opt_master_data;
@@ -475,6 +477,10 @@ static struct my_option my_long_options[] =
&opt_max_allowed_packet, &opt_max_allowed_packet, 0,
GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096,
(longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
+ {"max-statement-time", MYSQL_OPT_MAX_STATEMENT_TIME,
+ "Max statement execution time. If unset, overrides server default with 0.",
+ &opt_max_statement_time, &opt_max_statement_time, 0, GET_DOUBLE,
+ REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"net_buffer_length", OPT_NET_BUFFER_LENGTH,
"The buffer size for TCP/IP and socket communication.",
&opt_net_buffer_length, &opt_net_buffer_length, 0,
@@ -3219,9 +3225,8 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
if (strcmp(field->name, "View") == 0)
{
char *scv_buff= NULL;
- my_ulonglong n_cols;
- verbose_msg("-- It's a view, create dummy table for view\n");
+ verbose_msg("-- It's a view, create dummy view for view\n");
/* save "show create" statement for later */
if ((row= mysql_fetch_row(result)) && (scv_buff=row[1]))
@@ -3230,9 +3235,9 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
mysql_free_result(result);
/*
- Create a table with the same name as the view and with columns of
+ Create a view with the same name as the view and with columns of
the same name in order to satisfy views that depend on this view.
- The table will be removed when the actual view is created.
+ The view will be removed when the actual view is created.
The properties of each column, are not preserved in this temporary
table, because they are not necessary.
@@ -3264,23 +3269,9 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
else
my_free(scv_buff);
- n_cols= mysql_num_rows(result);
- if (0 != n_cols)
+ if (mysql_num_rows(result) != 0)
{
- /*
- The actual formula is based on the column names and how the .FRM
- files are stored and is too volatile to be repeated here.
- Thus we simply warn the user if the columns exceed a limit we
- know works most of the time.
- */
- if (n_cols >= 1000)
- fprintf(stderr,
- "-- Warning: Creating a stand-in table for view %s may"
- " fail when replaying the dump file produced because "
- "of the number of columns exceeding 1000. Exercise "
- "caution when replaying the produced dump file.\n",
- table);
if (opt_drop)
{
/*
@@ -3296,7 +3287,7 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
fprintf(sql_file,
"SET @saved_cs_client = @@character_set_client;\n"
"SET character_set_client = utf8;\n"
- "/*!50001 CREATE TABLE %s (\n",
+ "/*!50001 CREATE VIEW %s AS SELECT\n",
result_table);
/*
@@ -3308,28 +3299,21 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
row= mysql_fetch_row(result);
/*
- The actual column type doesn't matter anyway, since the table will
+ The actual column value doesn't matter anyway, since the view will
be dropped at run time.
- We do tinyint to avoid hitting the row size limit.
*/
- fprintf(sql_file, " %s tinyint NOT NULL",
+ fprintf(sql_file, " 1 AS %s",
quote_name(row[0], name_buff, 0));
while((row= mysql_fetch_row(result)))
{
/* col name, col type */
- fprintf(sql_file, ",\n %s tinyint NOT NULL",
+ fprintf(sql_file, ",\n 1 AS %s",
quote_name(row[0], name_buff, 0));
}
- /*
- Stand-in tables are always MyISAM tables as the default
- engine might have a column-limit that's lower than the
- number of columns in the view, and MyISAM support is
- guaranteed to be in the server anyway.
- */
fprintf(sql_file,
- "\n) ENGINE=MyISAM */;\n"
+ " */;\n"
"SET character_set_client = @saved_cs_client;\n");
check_io(sql_file);
@@ -6852,15 +6836,8 @@ static my_bool get_view_structure(char *table, char* db)
"\n--\n-- Final view structure for view %s\n--\n\n",
fix_for_comment(result_table));
- /* Table might not exist if this view was dumped with --tab. */
- fprintf(sql_file, "/*!50001 DROP TABLE IF EXISTS %s*/;\n", opt_quoted_table);
- if (opt_drop)
- {
- fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n",
- opt_quoted_table);
- check_io(sql_file);
- }
-
+ /* View might not exist if this view was dumped with --tab. */
+ fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n", opt_quoted_table);
my_snprintf(query, sizeof(query),
"SELECT CHECK_OPTION, DEFINER, SECURITY_TYPE, "
@@ -7032,6 +7009,7 @@ static void dynstr_realloc_checked(DYNAMIC_STRING *str, ulong additional_size)
int main(int argc, char **argv)
{
+ char query[48];
char bin_log_name[FN_REFLEN];
int exit_code;
int consistent_binlog_pos= 0;
@@ -7073,6 +7051,13 @@ int main(int argc, char **argv)
if (!path)
write_header(md_result_file, *argv);
+ /* Set MAX_STATEMENT_TIME to 0 unless set in client */
+ my_snprintf(query, sizeof(query), "/*!100100 SET @@MAX_STATEMENT_TIME=%f */", opt_max_statement_time);
+ mysql_query(mysql, query);
+
+ /* Set server side timeout between client commands to server compiled-in default */
+ mysql_query(mysql, "/*!100100 SET WAIT_TIMEOUT=DEFAULT */");
+
/* Check if the server support multi source */
if (mysql_get_server_version(mysql) >= 100000)
{
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 48f11667cd1..cfd2759cd77 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -574,13 +574,15 @@ static void safe_exit(int error, MYSQL *mysql)
if (mysql)
mysql_close(mysql);
- mysql_library_end();
- free_defaults(argv_to_free);
- my_free(opt_password);
if (error)
sf_leaking_memory= 1; /* dirty exit, some threads are still running */
else
+ {
+ mysql_library_end();
+ free_defaults(argv_to_free);
+ my_free(opt_password);
my_end(my_end_arg); /* clean exit */
+ }
exit(error);
}
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake
index 0470ff893e6..7188f5d1f07 100644
--- a/cmake/cpack_rpm.cmake
+++ b/cmake/cpack_rpm.cmake
@@ -271,7 +271,7 @@ ELSEIF(RPM MATCHES "fedora" OR RPM MATCHES "(rhel|centos)7")
ALTERNATIVE_NAME("server" "mariadb-server")
ALTERNATIVE_NAME("server" "mysql-compat-server")
ALTERNATIVE_NAME("test" "mariadb-test")
-ELSEIF(RPM MATCHES "(rhel|centos)8")
+ELSEIF(RPM MATCHES "(rhel|centos|rocky)[89]")
SET(epoch 3:)
ALTERNATIVE_NAME("backup" "mariadb-backup")
ALTERNATIVE_NAME("client" "mariadb")
diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc
index 49dd716f15f..047b47a11c0 100644
--- a/extra/mariabackup/backup_copy.cc
+++ b/extra/mariabackup/backup_copy.cc
@@ -581,6 +581,7 @@ datafile_read(datafile_cur_t *cursor)
Check to see if a file exists.
Takes name of the file to check.
@return true if file exists. */
+static
bool
file_exists(const char *filename)
{
@@ -1482,14 +1483,14 @@ bool backup_start(CorruptedPages &corrupted_pages)
if (!write_galera_info(mysql_connection)) {
return(false);
}
+ // copied from xtrabackup. what is it needed for here?
+ write_current_binlog_file(mysql_connection);
}
- bool with_binlogs = opt_binlog_info == BINLOG_INFO_ON;
+ if (opt_binlog_info == BINLOG_INFO_ON) {
- if (with_binlogs || opt_galera_info) {
- if (!write_current_binlog_file(mysql_connection, with_binlogs)) {
- return(false);
- }
+ lock_binlog_maybe(mysql_connection);
+ write_binlog_info(mysql_connection);
}
if (have_flush_engine_logs && !opt_no_lock) {
@@ -1525,33 +1526,13 @@ void backup_release()
static const char *default_buffer_pool_file = "ib_buffer_pool";
-static
-const char * get_buffer_pool_filename(size_t *length)
-{
- /* If mariabackup is run for Galera, then the file
- name is changed to the default so that the receiving
- node can find this file and rename it according to its
- settings, otherwise we keep the original file name: */
- size_t dir_length = 0;
- const char *dst_name = default_buffer_pool_file;
- if (!opt_galera_info) {
- dir_length = dirname_length(buffer_pool_filename);
- dst_name = buffer_pool_filename + dir_length;
- }
- if (length) {
- *length=dir_length;
- }
- return dst_name;
-}
-
/** Finish after backup_start() and backup_release() */
bool backup_finish()
{
/* Copy buffer pool dump or LRU dump */
- if (!opt_rsync) {
+ if (!opt_rsync && opt_galera_info) {
if (buffer_pool_filename && file_exists(buffer_pool_filename)) {
- const char *dst_name = get_buffer_pool_filename(NULL);
- copy_file(ds_data, buffer_pool_filename, dst_name, 0);
+ copy_file(ds_data, buffer_pool_filename, default_buffer_pool_file, 0);
}
if (file_exists("ib_lru_dump")) {
copy_file(ds_data, "ib_lru_dump", "ib_lru_dump", 0);
@@ -1601,6 +1582,7 @@ ibx_copy_incremental_over_full()
char path[FN_REFLEN];
int i;
+ DBUG_ASSERT(!opt_galera_info);
datadir_node_init(&node);
/* If we were applying an incremental change set, we need to make
@@ -1637,19 +1619,6 @@ ibx_copy_incremental_over_full()
if (!(ret = backup_files_from_datadir(xtrabackup_incremental_dir)))
goto cleanup;
- /* copy buffer pool dump */
- if (innobase_buffer_pool_filename) {
- const char *src_name = get_buffer_pool_filename(NULL);
-
- snprintf(path, sizeof(path), "%s/%s",
- xtrabackup_incremental_dir,
- src_name);
-
- if (file_exists(path)) {
- copy_file(ds_data, path, src_name, 0);
- }
- }
-
/* copy supplementary files */
for (i = 0; sup_files[i]; i++) {
@@ -1878,14 +1847,6 @@ copy_back()
datadir_node_init(&node);
- /* If mariabackup is run for Galera, then the file
- name is changed to the default so that the receiving
- node can find this file and rename it according to its
- settings, otherwise we keep the original file name: */
- size_t dir_length;
- const char *src_buffer_pool;
- src_buffer_pool = get_buffer_pool_filename(&dir_length);
-
while (datadir_iter_next(it, &node)) {
const char *ext_list[] = {"backup-my.cnf",
"xtrabackup_binary", "xtrabackup_binlog_info",
@@ -1947,10 +1908,10 @@ copy_back()
continue;
}
- /* skip buffer pool dump */
- if (!strcmp(filename, src_buffer_pool)) {
- continue;
- }
+ /* skip buffer pool dump */
+ if (!strcmp(filename, default_buffer_pool_file)) {
+ continue;
+ }
/* skip innodb data files */
for (Tablespace::const_iterator iter(srv_sys_space.begin()),
@@ -1970,19 +1931,11 @@ copy_back()
/* copy buffer pool dump */
- if (file_exists(src_buffer_pool)) {
- char dst_dir[FN_REFLEN];
- while (IS_TRAILING_SLASH(buffer_pool_filename, dir_length)) {
- dir_length--;
- }
- memcpy(dst_dir, buffer_pool_filename, dir_length);
- dst_dir[dir_length] = 0;
- if (!(ret = copy_or_move_file(src_buffer_pool,
- src_buffer_pool,
- dst_dir, 1)))
- {
- goto cleanup;
- }
+ if (file_exists(default_buffer_pool_file) &&
+ innobase_buffer_pool_filename) {
+ copy_or_move_file(default_buffer_pool_file,
+ innobase_buffer_pool_filename,
+ mysql_data_home, 0);
}
rocksdb_copy_back();
diff --git a/extra/mariabackup/backup_copy.h b/extra/mariabackup/backup_copy.h
index 858182001ce..62b2b1bc232 100644
--- a/extra/mariabackup/backup_copy.h
+++ b/extra/mariabackup/backup_copy.h
@@ -32,13 +32,6 @@ copy_file(ds_ctxt_t *datasink,
const char *dst_file_path,
uint thread_n);
-/************************************************************************
-Check to see if a file exists.
-Takes name of the file to check.
-@return true if file exists. */
-bool
-file_exists(const char *filename);
-
/** Start --backup */
bool backup_start(CorruptedPages &corrupted_pages);
/** Release resources after backup_start() */
diff --git a/extra/mariabackup/backup_mysql.cc b/extra/mariabackup/backup_mysql.cc
index 2065711b9c2..a3041bc01e0 100644
--- a/extra/mariabackup/backup_mysql.cc
+++ b/extra/mariabackup/backup_mysql.cc
@@ -84,6 +84,7 @@ static mysql_cond_t kill_query_thread_stop;
bool sql_thread_started = false;
char *mysql_slave_position = NULL;
char *mysql_binlog_position = NULL;
+char *buffer_pool_filename = NULL;
/* History on server */
time_t history_start_time;
@@ -1459,68 +1460,51 @@ cleanup:
}
-static
-bool
-write_binlog_info(MYSQL *connection, char *log_bin_dir,
- MYSQL_RES *mysql_result, my_ulonglong n_rows,
- my_ulonglong start);
-
/*********************************************************************//**
Flush and copy the current binary log file into the backup,
if GTID is enabled */
bool
-write_current_binlog_file(MYSQL *connection, bool write_binlogs)
+write_current_binlog_file(MYSQL *connection)
{
- char *log_bin = NULL;
- char *filename = NULL;
- char *position = NULL;
char *executed_gtid_set = NULL;
char *gtid_binlog_state = NULL;
+ char *log_bin_file = NULL;
char *log_bin_dir = NULL;
bool gtid_exists;
bool result = true;
+ char filepath[FN_REFLEN];
- mysql_variable log_bin_var[] = {
- {"@@GLOBAL.log_bin", &log_bin},
+ mysql_variable status[] = {
+ {"Executed_Gtid_Set", &executed_gtid_set},
{NULL, NULL}
};
- mysql_variable vars[] = {
- {"gtid_binlog_state", &gtid_binlog_state},
- {"log_bin_basename", &log_bin_dir},
+ mysql_variable status_after_flush[] = {
+ {"File", &log_bin_file},
{NULL, NULL}
};
- mysql_variable status[] = {
- {"File", &filename},
- {"Position", &position},
- {"Executed_Gtid_Set", &executed_gtid_set},
+ mysql_variable vars[] = {
+ {"gtid_binlog_state", &gtid_binlog_state},
+ {"log_bin_basename", &log_bin_dir},
{NULL, NULL}
};
- read_mysql_variables(connection, "SELECT @@GLOBAL.log_bin", log_bin_var, false);
-
- /* Do not create xtrabackup_binlog_info if binary log is disabled: */
- if (strncmp(log_bin, "1", 2) != 0) {
- goto binlog_disabled;
- }
-
- lock_binlog_maybe(connection);
-
read_mysql_variables(connection, "SHOW MASTER STATUS", status, false);
-
- /* Do not create xtrabackup_binlog_info if replication
- has not started yet: */
- if (filename == NULL || position == NULL) {
- goto no_replication;
- }
-
read_mysql_variables(connection, "SHOW VARIABLES", vars, true);
gtid_exists = (executed_gtid_set && *executed_gtid_set)
|| (gtid_binlog_state && *gtid_binlog_state);
- if (write_binlogs || gtid_exists) {
+ if (gtid_exists) {
+ size_t log_bin_dir_length;
+
+ lock_binlog_maybe(connection);
+
+ xb_mysql_query(connection, "FLUSH BINARY LOGS", false);
+
+ read_mysql_variables(connection, "SHOW MASTER STATUS",
+ status_after_flush, false);
if (opt_log_bin != NULL && strchr(opt_log_bin, FN_LIBCHAR)) {
/* If log_bin is set, it has priority */
@@ -1530,88 +1514,33 @@ write_current_binlog_file(MYSQL *connection, bool write_binlogs)
log_bin_dir = strdup(opt_log_bin);
} else if (log_bin_dir == NULL) {
/* Default location is MySQL datadir */
- log_bin_dir = static_cast<char*>(malloc(3));
- ut_a(log_bin_dir);
- log_bin_dir[0] = '.';
- log_bin_dir[1] = FN_LIBCHAR;
- log_bin_dir[2] = 0;
+ log_bin_dir = strdup("./");
}
- size_t log_bin_dir_length;
-
dirname_part(log_bin_dir, log_bin_dir, &log_bin_dir_length);
/* strip final slash if it is not the only path component */
- while (IS_TRAILING_SLASH(log_bin_dir, log_bin_dir_length)) {
- log_bin_dir_length--;
+ if (log_bin_dir_length > 1 &&
+ log_bin_dir[log_bin_dir_length - 1] == FN_LIBCHAR) {
+ log_bin_dir[log_bin_dir_length - 1] = 0;
}
- log_bin_dir[log_bin_dir_length] = 0;
- if (log_bin_dir == NULL) {
- msg("Failed to locate binary log files");
+ if (log_bin_dir == NULL || log_bin_file == NULL) {
+ msg("Failed to get master binlog coordinates from "
+ "SHOW MASTER STATUS");
result = false;
goto cleanup;
}
- uint max_binlogs;
- max_binlogs = opt_max_binlogs;
- if (max_binlogs == 0) {
- if (gtid_exists) {
- max_binlogs = 1;
- } else {
- goto cleanup;
- }
- }
-
- xb_mysql_query(connection, "FLUSH BINARY LOGS", false);
-
- MYSQL_RES *mysql_result;
-
- mysql_result = xb_mysql_query(connection, "SHOW BINARY LOGS", true);
-
- ut_ad(mysql_num_fields(mysql_result) >= 2);
-
- my_ulonglong n_rows;
- my_ulonglong start;
-
- n_rows = mysql_num_rows(mysql_result);
-
- start = 0;
- if (max_binlogs < n_rows) {
- start = n_rows - max_binlogs;
- }
- if (start) {
- mysql_data_seek(mysql_result, start);
- }
-
- MYSQL_ROW row;
- while ((row = mysql_fetch_row(mysql_result))) {
- const char *binlog_name = row[0];
- char filepath[FN_REFLEN];
- snprintf(filepath, sizeof(filepath), "%s%c%s",
- log_bin_dir, FN_LIBCHAR, binlog_name);
- if (file_exists(filepath)) {
- result = copy_file(ds_data, filepath, binlog_name, 0);
- if (!result) break;
- }
- }
-
- if (result) {
- write_binlog_info(connection, log_bin_dir,
- mysql_result, n_rows, start);
- }
-
- mysql_free_result(mysql_result);
+ snprintf(filepath, sizeof(filepath), "%s%c%s",
+ log_bin_dir, FN_LIBCHAR, log_bin_file);
+ result = copy_file(ds_data, filepath, log_bin_file, 0);
}
cleanup:
- free_mysql_variables(vars);
-
-no_replication:
+ free_mysql_variables(status_after_flush);
free_mysql_variables(status);
-
-binlog_disabled:
- free_mysql_variables(log_bin_var);
+ free_mysql_variables(vars);
return(result);
}
@@ -1620,11 +1549,8 @@ binlog_disabled:
/*********************************************************************//**
Retrieves MySQL binlog position and
saves it in a file. It also prints it to stdout. */
-static
bool
-write_binlog_info(MYSQL *connection, char *log_bin_dir,
- MYSQL_RES *mysql_result, my_ulonglong n_rows,
- my_ulonglong start)
+write_binlog_info(MYSQL *connection)
{
char *filename = NULL;
char *position = NULL;
@@ -1632,13 +1558,9 @@ write_binlog_info(MYSQL *connection, char *log_bin_dir,
char *gtid_current_pos = NULL;
char *gtid_executed = NULL;
char *gtid = NULL;
- char *buffer;
- char *buf;
- size_t total;
- bool result = true;
+ bool result;
bool mysql_gtid;
bool mariadb_gtid;
- bool with_gtid;
mysql_variable status[] = {
{"File", &filename},
@@ -1656,106 +1578,39 @@ write_binlog_info(MYSQL *connection, char *log_bin_dir,
read_mysql_variables(connection, "SHOW MASTER STATUS", status, false);
read_mysql_variables(connection, "SHOW VARIABLES", vars, true);
- mysql_gtid = gtid_mode && (strcmp(gtid_mode, "ON") == 0);
- mariadb_gtid = gtid_current_pos && *gtid_current_pos;
+ if (filename == NULL || position == NULL) {
+ /* Do not create xtrabackup_binlog_info if binary
+ log is disabled */
+ result = true;
+ goto cleanup;
+ }
+
+ mysql_gtid = ((gtid_mode != NULL) && (strcmp(gtid_mode, "ON") == 0));
+ mariadb_gtid = (gtid_current_pos != NULL);
- gtid = (gtid_executed && *gtid_executed) ? gtid_executed : gtid_current_pos;
+ gtid = (gtid_executed != NULL ? gtid_executed : gtid_current_pos);
- with_gtid = mariadb_gtid || mysql_gtid;
- if (with_gtid) {
+ if (mariadb_gtid || mysql_gtid) {
ut_a(asprintf(&mysql_binlog_position,
"filename '%s', position '%s', "
"GTID of the last change '%s'",
filename, position, gtid) != -1);
+ result = backup_file_printf(XTRABACKUP_BINLOG_INFO,
+ "%s\t%s\t%s\n", filename, position,
+ gtid);
} else {
ut_a(asprintf(&mysql_binlog_position,
"filename '%s', position '%s'",
filename, position) != -1);
+ result = backup_file_printf(XTRABACKUP_BINLOG_INFO,
+ "%s\t%s\n", filename, position);
}
- mysql_data_seek(mysql_result, start);
-
- MYSQL_ROW row;
- my_ulonglong current;
-
- total = 1;
- current = start;
- while ((row = mysql_fetch_row(mysql_result))) {
- const char *binlog_name = row[0];
- /* The position in the current binlog is taken from
- the global variable, but for the previous ones it is
- determined by their length: */
- const char *binlog_pos =
- ++current == n_rows ? position : row[1];
- total += strlen(binlog_name) + strlen(binlog_pos) + 2;
- if (with_gtid && current != n_rows) {
- /* Add the "\t[]" length to the buffer size: */
- total += 3;
- }
- }
- /* For the last of the binray log files, also add
- the length of the GTID (+ one character for '\t'): */
- if (with_gtid) {
- total += strlen(gtid) + 1;
- }
-
- buffer = static_cast<char*>(malloc(total));
- if (!buffer) {
- msg("Failed to allocate memory for temporary buffer");
- result = false;
- goto cleanup;
- }
-
- mysql_data_seek(mysql_result, start);
-
- buf = buffer;
- current = start;
- while ((row = mysql_fetch_row(mysql_result))) {
- const char *binlog_name = row[0];
- char filepath[FN_REFLEN];
- snprintf(filepath, sizeof(filepath), "%s%c%s",
- log_bin_dir, FN_LIBCHAR, binlog_name);
- current++;
- if (file_exists(filepath)) {
- /* The position in the current binlog is taken from
- the global variable, but for the previous ones it is
- determined by their length: */
- char *binlog_pos =
- current == n_rows ? position : row[1];
- int bytes;
- if (with_gtid) {
- bytes = snprintf(buf, total, "%s\t%s\t%s\n",
- binlog_name, binlog_pos,
- current == n_rows ? gtid : "[]");
- } else {
- bytes = snprintf(buf, total, "%s\t%s\n",
- binlog_name, binlog_pos);
- }
- if (bytes <= 0) {
- goto buffer_overflow;
- }
- buf += bytes;
- total -= bytes;
- }
- }
-
- if (buf != buffer) {
- result = backup_file_printf(XTRABACKUP_BINLOG_INFO, "%s", buffer);
- }
-
-cleanup2:
- free(buffer);
-
cleanup:
- free_mysql_variables(vars);
free_mysql_variables(status);
+ free_mysql_variables(vars);
return(result);
-
-buffer_overflow:
- msg("Internal error: buffer overflow in the write_binlog_info()");
- result = false;
- goto cleanup2;
}
struct escape_and_quote
@@ -2081,6 +1936,7 @@ backup_cleanup()
{
free(mysql_slave_position);
free(mysql_binlog_position);
+ free(buffer_pool_filename);
if (mysql_connection) {
mysql_close(mysql_connection);
diff --git a/extra/mariabackup/backup_mysql.h b/extra/mariabackup/backup_mysql.h
index 5e78281e1cb..b61fa2362c6 100644
--- a/extra/mariabackup/backup_mysql.h
+++ b/extra/mariabackup/backup_mysql.h
@@ -28,6 +28,7 @@ extern time_t history_lock_time;
extern bool sql_thread_started;
extern char *mysql_slave_position;
extern char *mysql_binlog_position;
+extern char *buffer_pool_filename;
/** connection to mysql server */
extern MYSQL *mysql_connection;
@@ -61,7 +62,10 @@ void
unlock_all(MYSQL *connection);
bool
-write_current_binlog_file(MYSQL *connection, bool write_binlogs);
+write_current_binlog_file(MYSQL *connection);
+
+bool
+write_binlog_info(MYSQL *connection);
bool
write_xtrabackup_info(MYSQL *connection, const char * filename, bool history,
diff --git a/extra/mariabackup/common.h b/extra/mariabackup/common.h
index 4a4cfd39d58..89b189e3a87 100644
--- a/extra/mariabackup/common.h
+++ b/extra/mariabackup/common.h
@@ -186,14 +186,4 @@ xb_read_full(File fd, uchar *buf, size_t len)
return tlen;
}
-#ifdef _WIN32
-#define IS_TRAILING_SLASH(name, length) \
- ((length) > 1 && \
- (name[(length) - 1] == '/' || \
- name[(length) - 1] == '\\'))
-#else
-#define IS_TRAILING_SLASH(name, length) \
- ((length) > 1 && name[(length) - 1] == FN_LIBCHAR)
-#endif
-
#endif
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index 117858d0ece..24288da7e07 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -242,8 +242,7 @@ ulong innobase_read_io_threads = 4;
ulong innobase_write_io_threads = 4;
longlong innobase_page_size = (1LL << 14); /* 16KB */
-char *innobase_buffer_pool_filename = NULL;
-char *buffer_pool_filename = NULL;
+char* innobase_buffer_pool_filename = NULL;
/* The default values for the following char* start-up parameters
are determined in innobase_init below: */
@@ -338,7 +337,6 @@ uint opt_lock_wait_timeout = 0;
uint opt_lock_wait_threshold = 0;
uint opt_debug_sleep_before_unlock = 0;
uint opt_safe_slave_backup_timeout = 0;
-uint opt_max_binlogs = UINT_MAX;
const char *opt_history = NULL;
@@ -1064,8 +1062,7 @@ enum options_xtrabackup
OPT_XTRA_CHECK_PRIVILEGES,
OPT_XTRA_MYSQLD_ARGS,
OPT_XB_IGNORE_INNODB_PAGE_CORRUPTION,
- OPT_INNODB_FORCE_RECOVERY,
- OPT_MAX_BINLOGS
+ OPT_INNODB_FORCE_RECOVERY
};
struct my_option xb_client_options[]= {
@@ -1462,17 +1459,6 @@ struct my_option xb_client_options[]= {
&opt_log_innodb_page_corruption, &opt_log_innodb_page_corruption, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"sst_max_binlogs", OPT_MAX_BINLOGS,
- "Number of recent binary logs to be included in the backup. "
- "Setting this parameter to zero normally disables transmission "
- "of binary logs to the joiner nodes during SST using Galera. "
- "But sometimes a single current binlog can still be transmitted "
- "to the joiner even with sst_max_binlogs=0, because it is "
- "required for Galera to work properly with GTIDs support.",
- (G_PTR *) &opt_max_binlogs,
- (G_PTR *) &opt_max_binlogs, 0, GET_UINT, OPT_ARG,
- UINT_MAX, 0, UINT_MAX, 0, 1, 0},
-
#define MYSQL_CLIENT
#include "sslopt-longopts.h"
#undef MYSQL_CLIENT
@@ -6274,44 +6260,6 @@ static bool check_all_privileges()
return true;
}
-static
-void
-xb_init_buffer_pool(const char * filename)
-{
- if (filename &&
-#ifdef _WIN32
- (filename[0] == '/' ||
- filename[0] == '\\' ||
- strchr(filename, ':')))
-#else
- filename[0] == FN_LIBCHAR)
-#endif
- {
- buffer_pool_filename = strdup(filename);
- } else {
- char filepath[FN_REFLEN];
- char *dst_dir =
- (innobase_data_home_dir && *innobase_data_home_dir) ?
- innobase_data_home_dir : mysql_data_home;
- size_t dir_length;
- if (dst_dir && *dst_dir) {
- dir_length = strlen(dst_dir);
- while (IS_TRAILING_SLASH(dst_dir, dir_length)) {
- dir_length--;
- }
- memcpy(filepath, dst_dir, dir_length);
- }
- else {
- filepath[0] = '.';
- dir_length = 1;
- }
- snprintf(filepath + dir_length,
- sizeof(filepath) - dir_length, "%c%s", FN_LIBCHAR,
- filename ? filename : "ib_buffer_pool");
- buffer_pool_filename = strdup(filepath);
- }
-}
-
bool
xb_init()
{
@@ -6377,15 +6325,10 @@ xb_init()
return(false);
}
- xb_init_buffer_pool(buffer_pool_filename);
-
if (opt_check_privileges && !check_all_privileges()) {
return(false);
}
-
history_start_time = time(NULL);
- } else {
- xb_init_buffer_pool(innobase_buffer_pool_filename);
}
return(true);
@@ -6778,8 +6721,6 @@ int main(int argc, char **argv)
free_error_messages();
mysql_mutex_destroy(&LOCK_error_log);
- free(buffer_pool_filename);
-
if (status == EXIT_SUCCESS) {
msg("completed OK!");
}
diff --git a/extra/mariabackup/xtrabackup.h b/extra/mariabackup/xtrabackup.h
index 430a72f2b9f..11de9eeaf48 100644
--- a/extra/mariabackup/xtrabackup.h
+++ b/extra/mariabackup/xtrabackup.h
@@ -71,7 +71,6 @@ extern char *xtrabackup_incremental_dir;
extern char *xtrabackup_incremental_basedir;
extern char *innobase_data_home_dir;
extern char *innobase_buffer_pool_filename;
-extern char *buffer_pool_filename;
extern char *xb_plugin_dir;
extern char *xb_rocksdb_datadir;
extern my_bool xb_backup_rocksdb;
@@ -164,7 +163,6 @@ extern uint opt_lock_wait_timeout;
extern uint opt_lock_wait_threshold;
extern uint opt_debug_sleep_before_unlock;
extern uint opt_safe_slave_backup_timeout;
-extern uint opt_max_binlogs;
extern const char *opt_history;
diff --git a/extra/wolfssl/CMakeLists.txt b/extra/wolfssl/CMakeLists.txt
index 4648a26c77d..1672f82fc6d 100644
--- a/extra/wolfssl/CMakeLists.txt
+++ b/extra/wolfssl/CMakeLists.txt
@@ -136,7 +136,8 @@ IF(WOLFSSL_FASTMATH)
PROPERTIES COMPILE_FLAGS ${TFM_COMPILE_FLAGS})
ENDIF()
ELSE()
- SET(WOLFCRYPT_SOURCES ${WOLFCRYPT_SOURCES} ${WOLFCRYPT_SRCDIR}/integer.c)
+ SET(WOLFSSL_SP_MATH_ALL 1)
+ SET(WOLFCRYPT_SOURCES ${WOLFCRYPT_SOURCES} ${WOLFCRYPT_SRCDIR}/sp_int.c)
ENDIF()
IF(WOLFSSL_X86_64_BUILD)
diff --git a/extra/wolfssl/user_settings.h.in b/extra/wolfssl/user_settings.h.in
index bbe8c820019..2355fd1691c 100644
--- a/extra/wolfssl/user_settings.h.in
+++ b/extra/wolfssl/user_settings.h.in
@@ -47,6 +47,7 @@
WolfSSL will use more stack space with it, with fastmath
*/
#cmakedefine FP_MAX_BITS 16384
+#define RSA_MAX_SIZE 8192
#cmakedefine WOLFSSL_AESNI
#cmakedefine USE_FAST_MATH
#cmakedefine TFM_TIMING_RESISTANT
@@ -55,5 +56,6 @@
#cmakedefine USE_INTEL_SPEEDUP
#cmakedefine USE_FAST_MATH
#cmakedefine WOLFSSL_X86_64_BUILD
+#cmakedefine WOLFSSL_SP_MATH_ALL
#endif /* WOLFSSL_USER_SETTINGS_H */
diff --git a/extra/wolfssl/wolfssl b/extra/wolfssl/wolfssl
-Subproject e6c07a296d2996e8d5c3cc615dfc50013bbcc79
+Subproject 57aac1c50b45275c7a99eca32ad985998b292dc
diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h
index 795a40e38b7..9b172cfe9b0 100644
--- a/include/mysql/psi/mysql_file.h
+++ b/include/mysql/psi/mysql_file.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_idle.h b/include/mysql/psi/mysql_idle.h
index 95886bd4e13..1c9927f95b2 100644
--- a/include/mysql/psi/mysql_idle.h
+++ b/include/mysql/psi/mysql_idle.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/include/mysql/psi/mysql_mdl.h b/include/mysql/psi/mysql_mdl.h
index 3b3aba0a81f..483f28f396b 100644
--- a/include/mysql/psi/mysql_mdl.h
+++ b/include/mysql/psi/mysql_mdl.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_memory.h b/include/mysql/psi/mysql_memory.h
index b461f2fb206..06027a655f7 100644
--- a/include/mysql/psi/mysql_memory.h
+++ b/include/mysql/psi/mysql_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_ps.h b/include/mysql/psi/mysql_ps.h
index 42f518b77c4..670555fc55f 100644
--- a/include/mysql/psi/mysql_ps.h
+++ b/include/mysql/psi/mysql_ps.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_socket.h b/include/mysql/psi/mysql_socket.h
index 4f1b48aa9a4..c78154b73db 100644
--- a/include/mysql/psi/mysql_socket.h
+++ b/include/mysql/psi/mysql_socket.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/include/mysql/psi/mysql_sp.h b/include/mysql/psi/mysql_sp.h
index 68b79f1b852..1fec59cec91 100644
--- a/include/mysql/psi/mysql_sp.h
+++ b/include/mysql/psi/mysql_sp.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_stage.h b/include/mysql/psi/mysql_stage.h
index f16b0ce207e..cb579ea4e8c 100644
--- a/include/mysql/psi/mysql_stage.h
+++ b/include/mysql/psi/mysql_stage.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/mysql_statement.h b/include/mysql/psi/mysql_statement.h
index 7a95e4057fd..78a4de73869 100644
--- a/include/mysql/psi/mysql_statement.h
+++ b/include/mysql/psi/mysql_statement.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h
index a301adcad18..b6247af65f3 100644
--- a/include/mysql/psi/mysql_thread.h
+++ b/include/mysql/psi/mysql_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
Copyright (c) 2020, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
@@ -1155,6 +1155,13 @@ static inline void inline_mysql_thread_set_psi_THD(THD *thd)
}
#endif /* __cplusplus */
+static inline void mysql_thread_set_peer_port(uint port __attribute__ ((unused))) {
+#ifdef HAVE_PSI_THREAD_INTERFACE
+ struct PSI_thread *psi = PSI_THREAD_CALL(get_thread)();
+ PSI_THREAD_CALL(set_thread_peer_port)(psi, port);
+#endif
+}
+
#endif
#endif /* DISABLE_MYSQL_THREAD_H */
diff --git a/include/mysql/psi/mysql_transaction.h b/include/mysql/psi/mysql_transaction.h
index 611bd1fa0f9..02f08bfab44 100644
--- a/include/mysql/psi/mysql_transaction.h
+++ b/include/mysql/psi/mysql_transaction.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/psi.h b/include/mysql/psi/psi.h
index b9beab77e2a..4c3e2c6a9c4 100644
--- a/include/mysql/psi/psi.h
+++ b/include/mysql/psi/psi.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -1692,6 +1692,15 @@ typedef void (*set_thread_info_v1_t)(const char* info, uint info_len);
*/
typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
+/**
+ Assign the remote (peer) port to the instrumented thread.
+
+ @param thread pointer to the thread instrumentation
+ @param port the remote port
+*/
+typedef void (*set_thread_peer_port_v1_t)(PSI_thread *thread,
+ unsigned int port);
+
/** Delete the current thread instrumentation. */
typedef void (*delete_current_thread_v1_t)(void);
@@ -2737,6 +2746,8 @@ struct PSI_v1
start_metadata_wait_v1_t start_metadata_wait;
end_metadata_wait_v1_t end_metadata_wait;
+
+ set_thread_peer_port_v1_t set_thread_peer_port;
};
/** @} (end of group Group_PSI_v1) */
diff --git a/include/mysql/psi/psi_abi_v0.h b/include/mysql/psi/psi_abi_v0.h
index b94a7695ade..df47ae78eb4 100644
--- a/include/mysql/psi/psi_abi_v0.h
+++ b/include/mysql/psi/psi_abi_v0.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/psi_abi_v1.h b/include/mysql/psi/psi_abi_v1.h
index bdf475147ab..61018bdf030 100644
--- a/include/mysql/psi/psi_abi_v1.h
+++ b/include/mysql/psi/psi_abi_v1.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/psi_abi_v1.h.pp b/include/mysql/psi/psi_abi_v1.h.pp
index ad2bf1d21dc..ca0d0206cb9 100644
--- a/include/mysql/psi/psi_abi_v1.h.pp
+++ b/include/mysql/psi/psi_abi_v1.h.pp
@@ -459,6 +459,8 @@ typedef void (*set_thread_start_time_v1_t)(time_t start_time);
typedef void (*set_thread_state_v1_t)(const char* state);
typedef void (*set_thread_info_v1_t)(const char* info, uint info_len);
typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
+typedef void (*set_thread_peer_port_v1_t)(PSI_thread *thread,
+ unsigned int port);
typedef void (*delete_current_thread_v1_t)(void);
typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
typedef struct PSI_file_locker* (*get_thread_file_name_locker_v1_t)
@@ -829,6 +831,7 @@ struct PSI_v1
destroy_metadata_lock_v1_t destroy_metadata_lock;
start_metadata_wait_v1_t start_metadata_wait;
end_metadata_wait_v1_t end_metadata_wait;
+ set_thread_peer_port_v1_t set_thread_peer_port;
};
typedef struct PSI_v1 PSI;
typedef struct PSI_mutex_info_v1 PSI_mutex_info;
diff --git a/include/mysql/psi/psi_abi_v2.h b/include/mysql/psi/psi_abi_v2.h
index 63d99106055..31c9e8fc42f 100644
--- a/include/mysql/psi/psi_abi_v2.h
+++ b/include/mysql/psi/psi_abi_v2.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/mysql/psi/psi_base.h b/include/mysql/psi/psi_base.h
index 2bb1d8fc354..c04f817b2c1 100644
--- a/include/mysql/psi/psi_base.h
+++ b/include/mysql/psi/psi_base.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -94,6 +94,12 @@ extern "C" {
*/
#define PSI_FLAG_VOLATILITY_SESSION (1 << 6)
+/**
+ System thread flag.
+ Indicates that the instrumented object exists on a system thread.
+*/
+#define PSI_FLAG_THREAD_SYSTEM (1 << 9)
+
#ifdef HAVE_PSI_INTERFACE
/**
diff --git a/include/mysql/psi/psi_memory.h b/include/mysql/psi/psi_memory.h
index 60d68f1a6dd..21a86a36368 100644
--- a/include/mysql/psi/psi_memory.h
+++ b/include/mysql/psi/psi_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/include/pfs_thread_provider.h b/include/pfs_thread_provider.h
index 3c43f8e3d77..6b5633722f5 100644
--- a/include/pfs_thread_provider.h
+++ b/include/pfs_thread_provider.h
@@ -99,6 +99,8 @@ void pfs_set_thread_info_v1(const char* info, uint info_len);
void pfs_set_thread_v1(PSI_thread* thread);
+void pfs_set_thread_peer_port_v1(PSI_thread *thread, uint port);
+
void pfs_delete_current_thread_v1(void);
void pfs_delete_thread_v1(PSI_thread *thread);
diff --git a/libmariadb b/libmariadb
-Subproject 485a3ad68c93fd43acde8a0fe39a348292f1cf2
+Subproject a6665e65c05c00f9df983a0f788a643ca7bc084
diff --git a/man/mysqldump.1 b/man/mysqldump.1
index df4a55cc061..c3b526db891 100644
--- a/man/mysqldump.1
+++ b/man/mysqldump.1
@@ -1377,6 +1377,21 @@ Sets the maximum packet length to send to or receive from server\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysqldump: max-statement-time option
+.\" max-statement-time option: mysqldump
+\fB\-\-max\-statement\-time=\fR\fB\fIseconds\fR\fR
+.sp
+Sets the maximum time any statement can run before being timed out by the server. (Default value is 0 (no limit))\&
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysqldump: net-buffer-length option
.\" net-buffer-length option: mysqldump
\fB\-\-net\-buffer\-length=\fR\fB\fIlength\fR\fR
@@ -2637,6 +2652,21 @@ The maximum size of the buffer for client/server communication\&. The maximum is
.sp -1
.IP \(bu 2.3
.\}
+max_statement_time
+.sp
+A query that has taken more than max_statement_time seconds will be aborted and the backup will
+fail\&. The argument will be treated as a decimal value with microsecond precision\&. A value
+of 0 (default) means no timeout\&. The maximum timeout is 31536000 seconds\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
net_buffer_length
.sp
The initial size of the buffer for client/server communication\&. When creating multiple\-row
diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf
index d102c9020cc..a1c427fe12c 100644
--- a/mysql-test/include/default_my.cnf
+++ b/mysql-test/include/default_my.cnf
@@ -33,3 +33,4 @@ disable-force-if-open
[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket
+OPENSSL_ENABLE_SHA1_SIGNATURES= 1
diff --git a/mysql-test/include/have_query_cache_disabled.inc b/mysql-test/include/have_query_cache_disabled.inc
new file mode 100644
index 00000000000..9087fa392e1
--- /dev/null
+++ b/mysql-test/include/have_query_cache_disabled.inc
@@ -0,0 +1,36 @@
+# Skip the test if 'query cache' is disabled.
+# Note : There are 2 techniques to disable query cache :
+# (1) Set query_cache_type to 0 or OFF
+# (2) Set query_cache_size to 0
+
+disable_query_log;
+
+let $do_skip=0;
+
+let $qc_var_1= query_get_value("SELECT COUNT(*) AS var1 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME = 'have_query_cache' AND variable_value = 'YES'", var1, 1);
+if ($qc_var_1 == 1)
+{
+ let $do_skip=1;
+}
+
+# Check if 'query_cache_type' is OFF
+let $qc_var_2= query_get_value("SELECT COUNT(*) AS var2 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME = 'query_cache_type' AND VARIABLE_VALUE = 'OFF'", var2, 1);
+if ($qc_var_2 == 1)
+{
+ let $do_skip=0;
+}
+
+# Check if 'query_cache_size' is 0
+let $qc_var_3= query_get_value("SELECT COUNT(*) AS var3 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME = 'query_cache_size' AND VARIABLE_VALUE = 0", var3, 1);
+
+if ($qc_var_3 == 1)
+{
+ let $do_skip=0;
+}
+
+if ($do_skip)
+{
+ skip Query Cache enabled, skipping test;
+}
+
+enable_query_log;
diff --git a/mysql-test/include/type_mix_incompatible.inc b/mysql-test/include/type_mix_incompatible.inc
index 750dc7bcac6..92a75be6e81 100644
--- a/mysql-test/include/type_mix_incompatible.inc
+++ b/mysql-test/include/type_mix_incompatible.inc
@@ -1,5 +1,9 @@
--echo # Start of type_store_assignment_incompatible.inc
+--disable_abort_on_error
+
+SET @sql_mode_save= @@sql_mode;
+
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -10,8 +14,15 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+# 'IGNORE' -> ' IGNORE'
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ ELSE @ignore
+ END;
+
let $source_type= `(SELECT @source_type)`;
let $target_type= `(SELECT @target_type)`;
+let $ignore=`(SELECT @ignore)`;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
@@ -23,8 +34,7 @@ SHOW CREATE TABLE t2;
#
CREATE TABLE t3 LIKE t2;
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
-INSERT INTO t3 VALUES
+eval INSERT$ignore INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
@@ -52,8 +62,7 @@ EXECUTE IMMEDIATE
IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
' FROM t3');
---error 0,ER_CANT_CREATE_GEOMETRY_OBJECT
-INSERT INTO t3 VALUES
+eval INSERT$ignore INTO t3 VALUES
(1,
(SELECT target FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
@@ -64,8 +73,7 @@ SELECT * FROM v3;
TRUNCATE TABLE t3;
SET sql_mode=STRICT_ALL_TABLES;
---error ER_TRUNCATED_WRONG_VALUE, ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, WARN_DATA_TRUNCATED, ER_CANT_CREATE_GEOMETRY_OBJECT
-INSERT INTO t3 VALUES
+eval INSERT$ignore INTO t3 VALUES
(1,
(SELECT target FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1)),
@@ -74,7 +82,7 @@ INSERT INTO t3 VALUES
(SELECT source FROM t2 ORDER BY id LIMIT 1));
SELECT * FROM v3;
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
@@ -83,55 +91,46 @@ DROP VIEW v3;
#
CREATE TABLE t3 LIKE t2;
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
-INSERT INTO t3 SELECT id,source,source FROM t2;
+eval INSERT$ignore INTO t3 SELECT id,source,source FROM t2;
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
-INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
+eval INSERT$ignore INTO t3 (id,target,source) SELECT id,source,source FROM t2;
#
# INSERT .. VALUES .. ON DUPLICATE KEY UPDATE target=source
#
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
-INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
+eval INSERT$ignore INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
-INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
+eval INSERT$ignore INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
#
# INSERT .. SELECT .. ON DUPLICATE KEY UPDATE target=source
#
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
-INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
+eval INSERT$ignore INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
-INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
+eval INSERT$ignore INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
#
# UPDATE
#
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
-UPDATE t3 SET target=source;
+eval UPDATE$ignore t3 SET target=source;
#
# UPDATE, multi-table
#
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
-UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
+eval UPDATE$ignore t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
#
# ALTER
#
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
EXECUTE IMMEDIATE @alter;
@@ -154,7 +153,6 @@ BEGIN
END;
$$
DELIMITER ;$$
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
CALL p1;
DROP PROCEDURE p1;
@@ -163,12 +161,10 @@ DROP PROCEDURE p1;
#
--eval CREATE FUNCTION f1(a $target_type) RETURNS INT RETURN NULL;
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
DROP FUNCTION f1;
--eval CREATE PROCEDURE p1(a $target_type) BEGIN END;
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
DROP PROCEDURE p1;
@@ -190,7 +186,6 @@ BEGIN
END;
$$
DELIMITER ;$$
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
CALL p2();
SHOW WARNINGS;
DROP PROCEDURE p2;
@@ -209,7 +204,6 @@ BEGIN
END;
$$
DELIMITER ;$$
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
SELECT f1();
DROP FUNCTION f1;
@@ -227,7 +221,6 @@ BEGIN
END;
$$
DELIMITER ;$$
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
CALL p1();
DROP PROCEDURE p1;
@@ -249,10 +242,11 @@ BEGIN
END;
$$
DELIMITER ;$$
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
CALL p1();
DROP PROCEDURE p1;
DROP TABLE t2;
+--enable_abort_on_error
+
--echo # End of type_store_assignment_incompatible.inc
diff --git a/mysql-test/include/wait_until_disconnected.inc b/mysql-test/include/wait_until_disconnected.inc
index 93ada7f11ce..3854369bb60 100644
--- a/mysql-test/include/wait_until_disconnected.inc
+++ b/mysql-test/include/wait_until_disconnected.inc
@@ -9,7 +9,7 @@ let $counter= 600;
let $mysql_errno= 0;
while (!$mysql_errno)
{
- --error 0,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,2002,2006,2013
+ --error 0,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,2002,2006,2026,2013,5014
show status;
dec $counter;
diff --git a/mysql-test/main/func_group.result b/mysql-test/main/func_group.result
index 3a779b2835f..771c7d941ae 100644
--- a/mysql-test/main/func_group.result
+++ b/mysql-test/main/func_group.result
@@ -2524,5 +2524,30 @@ DROP TABLE t2;
DROP VIEW v1;
DROP TABLE t1;
#
+# MDEV-23809: Server crash in JOIN_CACHE::free or ...
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+SELECT DISTINCT CASE CONVERT(EXPORT_SET(0, COLLATION(BENCHMARK(1, BIT_OR(0))),0),TIME) WHEN a THEN 1 END AS f FROM t1;
+f
+NULL
+Warnings:
+Warning 1292 Truncated incorrect time value: '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0'
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(8) NULL, b BIGINT);
+INSERT INTO t1 (a,b) VALUES (NULL,NULL),('foo',NULL);
+SELECT DISTINCT STRCMP((b > COLLATION(STDDEV_SAMP(15750))), a) AS f FROM t1;
+f
+NULL
+DROP TABLE t1;
+CREATE TABLE t1 (a BIGINT) AS SELECT 1 AS v3 UNION SELECT FALSE ;
+SELECT DISTINCT a IN ( COLLATION (AVG ('x'))) FROM t1 ;
+a IN ( COLLATION (AVG ('x')))
+NULL
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'x'
+Warning 1292 Truncated incorrect DOUBLE value: 'x'
+DROP TABLE t1;
+#
# End of 10.3 tests
#
diff --git a/mysql-test/main/func_group.test b/mysql-test/main/func_group.test
index 8ff3689f452..a4813cc04b8 100644
--- a/mysql-test/main/func_group.test
+++ b/mysql-test/main/func_group.test
@@ -1764,5 +1764,24 @@ DROP VIEW v1;
DROP TABLE t1;
--echo #
+--echo # MDEV-23809: Server crash in JOIN_CACHE::free or ...
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+SELECT DISTINCT CASE CONVERT(EXPORT_SET(0, COLLATION(BENCHMARK(1, BIT_OR(0))),0),TIME) WHEN a THEN 1 END AS f FROM t1;
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (a VARCHAR(8) NULL, b BIGINT);
+INSERT INTO t1 (a,b) VALUES (NULL,NULL),('foo',NULL);
+SELECT DISTINCT STRCMP((b > COLLATION(STDDEV_SAMP(15750))), a) AS f FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a BIGINT) AS SELECT 1 AS v3 UNION SELECT FALSE ;
+SELECT DISTINCT a IN ( COLLATION (AVG ('x'))) FROM t1 ;
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.3 tests
--echo #
diff --git a/mysql-test/main/func_json.result b/mysql-test/main/func_json.result
index ffdda37684e..e17c140e5ca 100644
--- a/mysql-test/main/func_json.result
+++ b/mysql-test/main/func_json.result
@@ -1005,6 +1005,17 @@ JSON_VALID('{"admin\\"": null}') {"admin\"": null}
1 {"\"admin": null}
1 {"\"": null}
#
+# MDEV-29188: Crash in JSON_EXTRACT
+#
+CREATE TABLE t1 (j JSON);
+INSERT INTO t1 VALUES
+('{"ID": "4", "Name": "Betty", "Age": 19}'),
+('[10, 20, [30, 40]]');
+SELECT * FROM t1 WHERE JSON_EXTRACT(j, '$.Age')=19;
+j
+{"ID": "4", "Name": "Betty", "Age": 19}
+drop table t1;
+#
# End of 10.3 tests
#
#
diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test
index 91d5002acc8..f8ef72ffca7 100644
--- a/mysql-test/main/func_json.test
+++ b/mysql-test/main/func_json.test
@@ -614,6 +614,20 @@ SELECT JSON_VALID('{"admin\\"": null}'), '{"admin\\"": null}'
SELECT JSON_VALID('{"\\"": null}'), '{"\\"": null}';
--echo #
+--echo # MDEV-29188: Crash in JSON_EXTRACT
+--echo #
+
+CREATE TABLE t1 (j JSON);
+
+INSERT INTO t1 VALUES
+ ('{"ID": "4", "Name": "Betty", "Age": 19}'),
+ ('[10, 20, [30, 40]]');
+
+SELECT * FROM t1 WHERE JSON_EXTRACT(j, '$.Age')=19;
+
+drop table t1;
+
+--echo #
--echo # End of 10.3 tests
--echo #
diff --git a/mysql-test/main/get_diagnostics.result b/mysql-test/main/get_diagnostics.result
index 1636c463f70..48eab8e0734 100644
--- a/mysql-test/main/get_diagnostics.result
+++ b/mysql-test/main/get_diagnostics.result
@@ -1152,11 +1152,11 @@ SELECT @var62, @var63;
@var62 @var63
1 NULL
INSERT INTO t1 SELECT id2, val2, p2 from t2;
-ERROR HY000: Illegal parameter data types double and point for operation 'SET'
+ERROR HY000: Cannot cast 'point' as 'double' in assignment of `test`.`t1`.`d1`
GET DIAGNOSTICS CONDITION 1 @var64= ROW_NUMBER;
GET DIAGNOSTICS CONDITION 2 @var65= ROW_NUMBER;
Warnings:
-Error 4078 Illegal parameter data types double and point for operation 'SET'
+Error 4078 Cannot cast 'point' as 'double' in assignment of `test`.`t1`.`d1`
Error 1758 Invalid condition number
SELECT @var64, @var65;
@var64 @var65
@@ -1396,11 +1396,11 @@ SELECT @var103, @var104;
@var103 @var104
1 NULL
INSERT INTO t1 SELECT id2, val2, p2 from t2;
-ERROR HY000: Illegal parameter data types double and point for operation 'SET'
+ERROR HY000: Cannot cast 'point' as 'double' in assignment of `test`.`t1`.`d1`
GET DIAGNOSTICS CONDITION 1 @var105= ROW_NUMBER;
GET DIAGNOSTICS CONDITION 2 @var106= ROW_NUMBER;
Warnings:
-Error 4078 Illegal parameter data types double and point for operation 'SET'
+Error 4078 Cannot cast 'point' as 'double' in assignment of `test`.`t1`.`d1`
Error 1758 Invalid condition number
SELECT @var105, @var106;
@var105 @var106
diff --git a/mysql-test/main/gis.result b/mysql-test/main/gis.result
index 5fdea9cb353..88e56c4ea96 100644
--- a/mysql-test/main/gis.result
+++ b/mysql-test/main/gis.result
@@ -688,9 +688,9 @@ object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
drop table t1;
create table t1 (fl geometry not null);
insert into t1 values (1);
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 values (1.11);
-ERROR HY000: Illegal parameter data types geometry and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 values (pointfromtext('point(1,1)'));
diff --git a/mysql-test/main/init_file_longline_3816.result b/mysql-test/main/init_file_longline_3816.result
index f670f67ccb8..0155f764592 100644
--- a/mysql-test/main/init_file_longline_3816.result
+++ b/mysql-test/main/init_file_longline_3816.result
@@ -1,3 +1,3 @@
select count(*) from t4;
count(*)
-193
+0
diff --git a/mysql-test/main/insert_select.result b/mysql-test/main/insert_select.result
index ea770535e8f..3f9ac8c6322 100644
--- a/mysql-test/main/insert_select.result
+++ b/mysql-test/main/insert_select.result
@@ -954,3 +954,92 @@ ERROR 23000: Duplicate entry '-128' for key 'a'
DROP TABLE t1, t2;
DROP PROCEDURE p1;
# End of 10.2 test
+#
+# MDEV-28617: INSERT ... SELECT with redundant IN subquery in GROUP BY
+# list that uses mergeable derived table containing
+# reference to target table
+#
+create table t1 (a int);
+create table t2 (b int);
+create table t3 (c int);
+insert into t1 values (3), (1);
+insert into t2 values (3), (2);
+insert into t3 values (4), (2);
+insert into t1
+select b from t2
+where b in (select c from t3
+group by (select * from (select a from t1) dt where a = 1));
+select * from t1;
+a
+3
+1
+2
+delete from t1;
+insert into t1 values (3), (1);
+insert into t1
+select b from t2
+where b >= any (select c from t3
+group by (select * from (select a from t1) dt where a = 1));
+select * from t1;
+a
+3
+1
+3
+2
+delete from t1;
+insert into t1 values (3), (1);
+insert into t1
+select b from t2
+where b <= all (select c from t3
+group by (select * from (select a from t1) dt where a = 1));
+select * from t1;
+a
+3
+1
+2
+delete from t1;
+insert into t1 values (3), (1);
+insert into t1
+select b from t2
+where exists (select c from t3
+group by (select * from (select a from t1) dt where a = 1));
+select * from t1;
+a
+3
+1
+3
+2
+delete from t1;
+insert into t1 values (3), (1);
+prepare stmt from "
+insert into t1
+select b from t2
+ where b in (select c from t3
+ group by (select * from (select a from t1) dt where a = 1));
+";
+execute stmt;
+select * from t1;
+a
+3
+1
+2
+delete from t1;
+insert into t1 values (3), (1);
+execute stmt;
+select * from t1;
+a
+3
+1
+2
+delete from t1;
+insert into t1 values (3), (1);
+delete from t1
+where exists (select b from t2
+where b in (select c from t3
+group by (select * from (select a from t1) dt
+where a = 1)));
+select * from t1;
+a
+deallocate prepare stmt;
+drop table t1,t2,t3;
+# End of 10.3 test
diff --git a/mysql-test/main/insert_select.test b/mysql-test/main/insert_select.test
index 1f672acc203..6baa7e43c34 100644
--- a/mysql-test/main/insert_select.test
+++ b/mysql-test/main/insert_select.test
@@ -514,3 +514,85 @@ DROP TABLE t1, t2;
DROP PROCEDURE p1;
--echo # End of 10.2 test
+
+--echo #
+--echo # MDEV-28617: INSERT ... SELECT with redundant IN subquery in GROUP BY
+--echo # list that uses mergeable derived table containing
+--echo # reference to target table
+--echo #
+
+create table t1 (a int);
+create table t2 (b int);
+create table t3 (c int);
+
+insert into t1 values (3), (1);
+insert into t2 values (3), (2);
+insert into t3 values (4), (2);
+
+insert into t1
+select b from t2
+ where b in (select c from t3
+ group by (select * from (select a from t1) dt where a = 1));
+select * from t1;
+
+delete from t1;
+insert into t1 values (3), (1);
+
+insert into t1
+select b from t2
+ where b >= any (select c from t3
+ group by (select * from (select a from t1) dt where a = 1));
+select * from t1;
+
+delete from t1;
+insert into t1 values (3), (1);
+
+insert into t1
+select b from t2
+ where b <= all (select c from t3
+ group by (select * from (select a from t1) dt where a = 1));
+select * from t1;
+
+delete from t1;
+insert into t1 values (3), (1);
+
+insert into t1
+select b from t2
+ where exists (select c from t3
+ group by (select * from (select a from t1) dt where a = 1));
+select * from t1;
+
+delete from t1;
+insert into t1 values (3), (1);
+
+prepare stmt from "
+insert into t1
+select b from t2
+ where b in (select c from t3
+ group by (select * from (select a from t1) dt where a = 1));
+";
+
+execute stmt;
+select * from t1;
+
+delete from t1;
+insert into t1 values (3), (1);
+
+execute stmt;
+select * from t1;
+
+delete from t1;
+insert into t1 values (3), (1);
+
+delete from t1
+ where exists (select b from t2
+ where b in (select c from t3
+ group by (select * from (select a from t1) dt
+ where a = 1)));
+select * from t1;
+
+deallocate prepare stmt;
+
+drop table t1,t2,t3;
+
+--echo # End of 10.3 test
diff --git a/mysql-test/main/kill.test b/mysql-test/main/kill.test
index c7f6d1e098f..7dc57158825 100644
--- a/mysql-test/main/kill.test
+++ b/mysql-test/main/kill.test
@@ -57,7 +57,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
SET DEBUG_SYNC = 'RESET';
connection con1;
---error 1053,2006,2013
+--error 1053,2006,2013,5014
SELECT 1;
--enable_reconnect
@@ -96,7 +96,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
SET DEBUG_SYNC = 'RESET';
connection con1;
---error 1053,2006,2013
+--error 1053,2006,2013,5014
SELECT 1;
enable_reconnect;
SELECT 1;
@@ -143,7 +143,7 @@ KILL @id;
SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
connection con1;
---error 1317,1053,2006,2013
+--error 1317,1053,2006,2013,5014
reap;
SELECT 1;
@@ -288,7 +288,7 @@ SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
connection con1;
--echo # ER_SERVER_SHUTDOWN, CR_SERVER_GONE_ERROR, CR_SERVER_LOST,
--echo # depending on the timing of close of the connection socket
---error 1053,2006,2013
+--error 1053,2006,2013,5014
SELECT 1;
--enable_reconnect
SELECT 1;
@@ -521,10 +521,10 @@ drop user test@localhost;
drop user test2@localhost;
connection con3;
---error 2013,2006
+--error 2013,2006,5014
select 1;
connection con4;
---error 2013,2006
+--error 2013,2006,5014
select 1;
connection default;
diff --git a/mysql-test/main/lock_view.result b/mysql-test/main/lock_view.result
index 48c45dcf23d..6cc788f86f1 100644
--- a/mysql-test/main/lock_view.result
+++ b/mysql-test/main/lock_view.result
@@ -32,9 +32,8 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER
USE `mysqltest2`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v2` (
- `a` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v2` AS SELECT
+ 1 AS `a` */;
SET character_set_client = @saved_cs_client;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin1 */;
@@ -42,39 +41,34 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest3` /*!40100 DEFAULT CHARACTER
USE `mysqltest3`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v3` (
- `a` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v3` AS SELECT
+ 1 AS `a` */;
SET character_set_client = @saved_cs_client;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v3i` (
- `a` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v3i` AS SELECT
+ 1 AS `a` */;
SET character_set_client = @saved_cs_client;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v3is` (
- `schema_name` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v3is` AS SELECT
+ 1 AS `schema_name` */;
SET character_set_client = @saved_cs_client;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v3nt` (
- `1` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v3nt` AS SELECT
+ 1 AS `1` */;
SET character_set_client = @saved_cs_client;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v3ps` (
- `user` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v3ps` AS SELECT
+ 1 AS `user` */;
SET character_set_client = @saved_cs_client;
USE `mysqltest1`;
USE `mysqltest2`;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
+/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -89,7 +83,7 @@ USE `mysqltest2`;
/*!50001 SET collation_connection = @saved_col_connection */;
USE `mysqltest3`;
-/*!50001 DROP TABLE IF EXISTS `v3`*/;
+/*!50001 DROP VIEW IF EXISTS `v3`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -102,7 +96,7 @@ USE `mysqltest3`;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v3i`*/;
+/*!50001 DROP VIEW IF EXISTS `v3i`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -115,7 +109,7 @@ USE `mysqltest3`;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v3is`*/;
+/*!50001 DROP VIEW IF EXISTS `v3is`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -128,7 +122,7 @@ USE `mysqltest3`;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v3nt`*/;
+/*!50001 DROP VIEW IF EXISTS `v3nt`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -141,7 +135,7 @@ USE `mysqltest3`;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v3ps`*/;
+/*!50001 DROP VIEW IF EXISTS `v3ps`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -243,11 +237,10 @@ disconnect con1;
connection default;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v1` (
- `id` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v1` AS SELECT
+ 1 AS `id` */;
SET character_set_client = @saved_cs_client;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
+/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
diff --git a/mysql-test/main/long_unique_bugs.result b/mysql-test/main/long_unique_bugs.result
index 659fdde236b..30c6aaf0f20 100644
--- a/mysql-test/main/long_unique_bugs.result
+++ b/mysql-test/main/long_unique_bugs.result
@@ -318,6 +318,25 @@ update t1,t2 set v1 = v2 , v5 = 0;
ERROR 23000: Duplicate entry '-128' for key 'v1'
drop table t1, t2;
#
+# MDEV-21540 Initialization of already inited long unique index on reorganize partition
+#
+create table t1 (x int, a blob)
+partition by range (x) (
+partition p1 values less than (50),
+partition pn values less than maxvalue);
+insert into t1 values (1, 1), (100, 1);
+alter table t1 add unique key (a);
+ERROR 23000: Duplicate entry '1' for key 'a'
+update t1 set a= x;
+alter table t1 add unique key (a);
+update t1 set a= 1;
+ERROR 23000: Duplicate entry '1' for key 'a'
+update t1 set a= x + 1;
+alter table t1 reorganize partition p1 into (
+partition n0 values less than (10),
+partition n1 values less than (50));
+drop table t1;
+#
# End of 10.4 tests
#
#
diff --git a/mysql-test/main/long_unique_bugs.test b/mysql-test/main/long_unique_bugs.test
index 8e54782db30..18e430858b0 100644
--- a/mysql-test/main/long_unique_bugs.test
+++ b/mysql-test/main/long_unique_bugs.test
@@ -398,6 +398,33 @@ update t1,t2 set v1 = v2 , v5 = 0;
drop table t1, t2;
--echo #
+--echo # MDEV-21540 Initialization of already inited long unique index on reorganize partition
+--echo #
+create table t1 (x int, a blob)
+partition by range (x) (
+ partition p1 values less than (50),
+ partition pn values less than maxvalue);
+
+insert into t1 values (1, 1), (100, 1);
+
+# a little bit of additional checks
+--error ER_DUP_ENTRY
+alter table t1 add unique key (a);
+
+update t1 set a= x;
+alter table t1 add unique key (a);
+--error ER_DUP_ENTRY
+update t1 set a= 1;
+update t1 set a= x + 1;
+
+# bug failure
+alter table t1 reorganize partition p1 into (
+ partition n0 values less than (10),
+ partition n1 values less than (50));
+
+drop table t1;
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result
index a6be207434f..d5c6518a130 100644
--- a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result
+++ b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result
@@ -7,9 +7,9 @@ CREATE TABLE time_zone_leap_second LIKE mysql.time_zone_leap_second;
# MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
#
# Verbose run
-set @wsrep_is_on=(select sum(SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
+set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
-set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
+set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0');
@@ -56,9 +56,9 @@ execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_t
# MDEV-28263: mariadb-tzinfo-to-sql improve wsrep and binlog cases
#
# Run on zoneinfo directory
-set @wsrep_is_on=(select sum(SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
+set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
-set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
+set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0');
@@ -116,9 +116,9 @@ COUNT(*)
#
# Run on zoneinfo directory --skip-write-binlog
#
-set @wsrep_is_on=(select sum(SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
+set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
-set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
+set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
execute immediate if(@wsrep_is_on, 'SET @save_wsrep_on=@@WSREP_ON, WSREP_ON=OFF', 'do 0');
SET @save_sql_log_bin=@@SQL_LOG_BIN;
SET SESSION SQL_LOG_BIN=0;
@@ -188,9 +188,9 @@ TRUNCATE TABLE time_zone_leap_second;
#
# Testing with explicit timezonefile
#
-set @wsrep_is_on=(select sum(SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
+set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
-set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
+set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0');
@@ -252,9 +252,9 @@ TRUNCATE TABLE time_zone_leap_second;
#
# Testing with explicit timezonefile --skip-write-binlog
#
-set @wsrep_is_on=(select sum(SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
+set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
-set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
+set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
execute immediate if(@wsrep_is_on, 'SET @save_wsrep_on=@@WSREP_ON, WSREP_ON=OFF', 'do 0');
SET @save_sql_log_bin=@@SQL_LOG_BIN;
SET SESSION SQL_LOG_BIN=0;
@@ -310,9 +310,9 @@ TRUNCATE TABLE time_zone_leap_second;
#
# Testing --leap
#
-set @wsrep_is_on=(select sum(SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
+set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
-set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
+set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0');
@@ -373,9 +373,9 @@ TRUNCATE TABLE time_zone_leap_second;
#
# Testing --skip-write-binlog --leap
#
-set @wsrep_is_on=(select sum(SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
+set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
-set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
+set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
execute immediate if(@wsrep_is_on, 'SET @save_wsrep_on=@@WSREP_ON, WSREP_ON=OFF', 'do 0');
SET @save_sql_log_bin=@@SQL_LOG_BIN;
SET SESSION SQL_LOG_BIN=0;
@@ -425,9 +425,9 @@ COM_TRUNCATE 1
#
# Testing --skip-write-binlog
#
-set @wsrep_is_on=(select sum(SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
+set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
-set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
+set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
execute immediate if(@wsrep_is_on, 'SET @save_wsrep_on=@@WSREP_ON, WSREP_ON=OFF', 'do 0');
SET @save_sql_log_bin=@@SQL_LOG_BIN;
SET SESSION SQL_LOG_BIN=0;
@@ -447,9 +447,9 @@ UNLOCK TABLES;
COMMIT;
SET SESSION SQL_LOG_BIN=@save_sql_log_bin;
execute immediate if(@wsrep_is_on, 'SET SESSION WSREP_ON=@save_wsrep_on', 'do 0');
-set @wsrep_is_on=(select sum(SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
+set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
-set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
+set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
execute immediate if(@wsrep_is_on, 'SET @save_wsrep_on=@@WSREP_ON, WSREP_ON=OFF', 'do 0');
SET @save_sql_log_bin=@@SQL_LOG_BIN;
SET SESSION SQL_LOG_BIN=0;
@@ -471,9 +471,9 @@ execute immediate if(@wsrep_is_on, 'SET SESSION WSREP_ON=@save_wsrep_on', 'do 0'
#
# MDEV-6236 - [PATCH] mysql_tzinfo_to_sql may produce invalid SQL
#
-set @wsrep_is_on=(select sum(SESSION_VALUE='ON') from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
+set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on');
SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC;
-set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select sum(GLOBAL_VALUE NOT LIKE @replicate_opt) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
+set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode');
execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0');
execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0');
diff --git a/mysql-test/main/mysql_tzinfo_to_sql_symlink.test b/mysql-test/main/mysql_tzinfo_to_sql_symlink.test
index 857f24e610f..34df1281c38 100644
--- a/mysql-test/main/mysql_tzinfo_to_sql_symlink.test
+++ b/mysql-test/main/mysql_tzinfo_to_sql_symlink.test
@@ -3,8 +3,6 @@
--source include/not_windows.inc
--source include/no_protocol.inc
-let $is_embedded=`select version() like '%embedded%'`;
-
CREATE TABLE time_zone LIKE mysql.time_zone;
CREATE TABLE time_zone_name LIKE mysql.time_zone_name;
CREATE TABLE time_zone_transition LIKE mysql.time_zone_transition;
@@ -63,9 +61,6 @@ SELECT COUNT(*) FROM time_zone_transition;
SELECT COUNT(*) FROM time_zone_transition_type;
SELECT COUNT(*) FROM time_zone_leap_second;
-if ($is_embedded) {
---replace_column 1 0 2 0
-}
SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN;
SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff
FROM information_schema.global_status g
@@ -100,9 +95,6 @@ SELECT COUNT(*) FROM time_zone_transition;
SELECT COUNT(*) FROM time_zone_transition_type;
SELECT COUNT(*) FROM time_zone_leap_second;
-if ($is_embedded) {
---replace_column 1 0 2 0
-}
SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN;
SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff
FROM information_schema.global_status g
@@ -135,9 +127,6 @@ SELECT COUNT(*) FROM time_zone_transition;
SELECT COUNT(*) FROM time_zone_transition_type;
SELECT COUNT(*) FROM time_zone_leap_second;
-if ($is_embedded) {
---replace_column 1 0 2 0
-}
SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN;
SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff
FROM information_schema.global_status g
@@ -170,9 +159,6 @@ SELECT COUNT(*) FROM time_zone_transition;
SELECT COUNT(*) FROM time_zone_transition_type;
SELECT COUNT(*) FROM time_zone_leap_second;
-if ($is_embedded) {
---replace_column 1 0 2 0
-}
SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN;
SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff
FROM information_schema.global_status g
@@ -205,9 +191,6 @@ SELECT COUNT(*) FROM time_zone_transition;
SELECT COUNT(*) FROM time_zone_transition_type;
SELECT COUNT(*) FROM time_zone_leap_second;
-if ($is_embedded) {
---replace_column 1 0 2 0
-}
SELECT @wsrep_is_on, @wsrep_cannot_replicate_tz, @save_wsrep_on, @save_sql_log_bin, @@SQL_LOG_BIN;
SELECT g.VARIABLE_NAME, g.VARIABLE_VALUE - b.VARIABLE_VALUE AS diff
FROM information_schema.global_status g
diff --git a/mysql-test/main/mysql_upgrade.result b/mysql-test/main/mysql_upgrade.result
index 6bb922f8d42..4d814fe5710 100644
--- a/mysql-test/main/mysql_upgrade.result
+++ b/mysql-test/main/mysql_upgrade.result
@@ -2172,6 +2172,44 @@ disconnect con1;
connection default;
drop table mysql.global_priv;
rename table mysql.global_priv_bak to mysql.global_priv;
+#
+# MDEV-28727 ALTER TABLE ALGORITHM=NOCOPY does not work after upgrade
+#
+create or replace table pet4 (
+build_time double(18, 7) default null,
+key idx1 (build_time)
+) engine innodb;
+check table pet4;
+Table Op Msg_type Msg_text
+test.pet4 check error Table rebuild required. Please do "ALTER TABLE `pet4` FORCE" or dump/reload to fix it!
+check table pet4 for upgrade;
+Table Op Msg_type Msg_text
+test.pet4 check error Table rebuild required. Please do "ALTER TABLE `pet4` FORCE" or dump/reload to fix it!
+alter table pet4 add i1 int, algorithm=nocopy;
+ERROR 0A000: ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE
+# Running mysqlcheck
+test.pet4
+error : Table rebuild required. Please do "ALTER TABLE `pet4` FORCE" or dump/reload to fix it!
+
+Repairing tables
+check table pet4;
+Table Op Msg_type Msg_text
+test.pet4 check status OK
+alter table pet4 add i1 int, algorithm=nocopy;
+create or replace table pet4 (
+build_time double(18, 7) default null,
+key idx1 (build_time)
+) engine innodb;
+alter table pet4 add i1 int, algorithm=nocopy;
+ERROR 0A000: ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=INPLACE
+# Running mysql_upgrade
+test.pet4
+error : Table rebuild required. Please do "ALTER TABLE `pet4` FORCE" or dump/reload to fix it!
+check table pet4;
+Table Op Msg_type Msg_text
+test.pet4 check status OK
+alter table pet4 add i1 int, algorithm=nocopy;
+drop table pet4;
# End of 10.4 tests
#
# Check that mysql_upgrade can be run on mysqldump
diff --git a/mysql-test/main/mysql_upgrade.test b/mysql-test/main/mysql_upgrade.test
index 47b07a6968b..d2388043bef 100644
--- a/mysql-test/main/mysql_upgrade.test
+++ b/mysql-test/main/mysql_upgrade.test
@@ -472,6 +472,47 @@ drop table mysql.global_priv;
rename table mysql.global_priv_bak to mysql.global_priv;
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--echo #
+--echo # MDEV-28727 ALTER TABLE ALGORITHM=NOCOPY does not work after upgrade
+--echo #
+create or replace table pet4 (
+ build_time double(18, 7) default null,
+ key idx1 (build_time)
+) engine innodb;
+
+--remove_file $MYSQLD_DATADIR/test/pet4.frm
+--copy_file std_data/mdev-28727-pet4.frm $MYSQLD_DATADIR/test/pet4.frm
+
+check table pet4;
+check table pet4 for upgrade;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+alter table pet4 add i1 int, algorithm=nocopy;
+
+--echo # Running mysqlcheck
+--exec $MYSQL_CHECK --auto-repair --databases test 2>&1
+check table pet4;
+alter table pet4 add i1 int, algorithm=nocopy;
+
+create or replace table pet4 (
+ build_time double(18, 7) default null,
+ key idx1 (build_time)
+) engine innodb;
+
+--remove_file $MYSQLD_DATADIR/test/pet4.frm
+--copy_file std_data/mdev-28727-pet4.frm $MYSQLD_DATADIR/test/pet4.frm
+
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+alter table pet4 add i1 int, algorithm=nocopy;
+
+--echo # Running mysql_upgrade
+--exec $MYSQL_UPGRADE --silent 2>&1
+file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
+check table pet4;
+alter table pet4 add i1 int, algorithm=nocopy;
+
+--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+drop table pet4;
+
--echo # End of 10.4 tests
#
diff --git a/mysql-test/main/mysqlbinlog-innodb.result b/mysql-test/main/mysqlbinlog-innodb.result
index 8428e4cd74b..be34c273019 100644
--- a/mysql-test/main/mysqlbinlog-innodb.result
+++ b/mysql-test/main/mysqlbinlog-innodb.result
@@ -29,7 +29,7 @@ START TRANSACTION
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -60,7 +60,7 @@ START TRANSACTION
use `foo`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/main/mysqlbinlog.result b/mysql-test/main/mysqlbinlog.result
index b9f7f5b61b9..727558a8ce9 100644
--- a/mysql-test/main/mysqlbinlog.result
+++ b/mysql-test/main/mysqlbinlog.result
@@ -22,7 +22,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -102,7 +102,7 @@ START TRANSACTION
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -138,7 +138,7 @@ START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -189,7 +189,7 @@ START TRANSACTION
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -216,7 +216,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -296,7 +296,7 @@ START TRANSACTION
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -332,7 +332,7 @@ START TRANSACTION
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -383,7 +383,7 @@ START TRANSACTION
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -492,7 +492,7 @@ DELIMITER /*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -544,7 +544,7 @@ DELIMITER /*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -724,7 +724,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1253783037/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -778,7 +778,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
SET TIMESTAMP=1253783037/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -813,7 +813,7 @@ ROLLBACK /* added by mysqlbinlog */;
DELIMITER /*!*/;
SET TIMESTAMP=1266652094/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -855,7 +855,7 @@ ROLLBACK /* added by mysqlbinlog */;
DELIMITER /*!*/;
SET TIMESTAMP=1266652094/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -973,7 +973,7 @@ AAAAAAAAAAAAAAAAAAAgrgJSFzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375907364/*!*/;
SET @@session.pseudo_thread_id=1/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1056,7 +1056,7 @@ AAAAAAAAAAAAAAAAAAA/rQJSGzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
# Event: Query thread_id=1 exec_time=1 error_code=0 xid=0
SET TIMESTAMP=1375907141/*!*/;
SET @@session.pseudo_thread_id=1/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1139,7 +1139,7 @@ AAAAAAAAAAAAAAAAAAAnrAJSHzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375906879/*!*/;
SET @@session.pseudo_thread_id=1/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1222,7 +1222,7 @@ AAAAAAAAAAAAAAAAAABbsAJSEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
# Event: Query thread_id=1 exec_time=0 error_code=0 xid=0
SET TIMESTAMP=1375907933/*!*/;
SET @@session.pseudo_thread_id=1/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/main/mysqlbinlog_row_compressed.result b/mysql-test/main/mysqlbinlog_row_compressed.result
index 210f39ffa22..a6846f245ff 100644
--- a/mysql-test/main/mysqlbinlog_row_compressed.result
+++ b/mysql-test/main/mysqlbinlog_row_compressed.result
@@ -33,7 +33,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=X/*!*/;
SET @@session.pseudo_thread_id=5/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/main/mysqlbinlog_row_minimal.result b/mysql-test/main/mysqlbinlog_row_minimal.result
index adefdde9d04..99d5757be8d 100644
--- a/mysql-test/main/mysqlbinlog_row_minimal.result
+++ b/mysql-test/main/mysqlbinlog_row_minimal.result
@@ -31,7 +31,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=X/*!*/;
SET @@session.pseudo_thread_id=5/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -397,7 +397,7 @@ START TRANSACTION
#<date> server id 1 end_log_pos END_LOG_POS CRC32 XXX Query thread_id=TID exec_time=x error_code=0 xid=<xid>
SET TIMESTAMP=X/*!*/;
SET @@session.pseudo_thread_id=TID/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/main/mysqlbinlog_stmt_compressed.result b/mysql-test/main/mysqlbinlog_stmt_compressed.result
index e922978b47d..7e709eeef2c 100644
--- a/mysql-test/main/mysqlbinlog_stmt_compressed.result
+++ b/mysql-test/main/mysqlbinlog_stmt_compressed.result
@@ -33,7 +33,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=X/*!*/;
SET @@session.pseudo_thread_id=5/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result
index 6959ae85865..92a7676530e 100644
--- a/mysql-test/main/mysqld--help.result
+++ b/mysql-test/main/mysqld--help.result
@@ -508,6 +508,7 @@ The following specify which files/extra groups are read (specified before remain
administrative statements to the slow log if it is open.
Resets or sets the option 'admin' in
log_slow_disabled_statements
+ (Defaults to on; use --skip-log-slow-admin-statements to disable.)
--log-slow-disabled-statements=name
Don't log certain types of statements to slow log. Any
combination of: admin, call, slave, sp
@@ -528,6 +529,7 @@ The following specify which files/extra groups are read (specified before remain
Log slow statements executed by slave thread to the slow
log if it is open. Resets or sets the option 'slave' in
log_slow_disabled_statements
+ (Defaults to on; use --skip-log-slow-slave-statements to disable.)
--log-slow-verbosity=name
Verbosity level for the slow log. Any combination of:
innodb, query_plan, explain
diff --git a/mysql-test/main/mysqldump-nl.result b/mysql-test/main/mysqldump-nl.result
index 89fb3144867..bac1ccb6ea0 100644
--- a/mysql-test/main/mysqldump-nl.result
+++ b/mysql-test/main/mysqldump-nl.result
@@ -53,11 +53,10 @@ raboof` int(11) DEFAULT NULL
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v1
-1v` (
- `foobar
-raboof` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v1
+1v` AS SELECT
+ 1 AS `foobar
+raboof` */;
SET character_set_client = @saved_cs_client;
--
@@ -95,7 +94,7 @@ USE `mysqltest1
-- 1v`
--
-/*!50001 DROP TABLE IF EXISTS `v1
+/*!50001 DROP VIEW IF EXISTS `v1
1v`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
diff --git a/mysql-test/main/mysqldump-timing.result b/mysql-test/main/mysqldump-timing.result
new file mode 100644
index 00000000000..5b299319a73
--- /dev/null
+++ b/mysql-test/main/mysqldump-timing.result
@@ -0,0 +1,72 @@
+#
+# MDEV-18702 mysqldump should use max_statement_time=0 and/or allow setting one
+#
+CREATE DATABASE test1;
+USE test1;
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (0);
+LOCK TABLE t1 WRITE;
+timeout without t1 contents expected
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8mb4 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+DROP TABLE IF EXISTS `t1`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t1` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+SET @save_max_statement_time=@@max_statement_time;
+SET GLOBAL max_statement_time=0.1;
+UNLOCK TABLES;;
+This would be a race condition otherwise, but default max_statement_time=0 makes it succeed
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8mb4 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+DROP TABLE IF EXISTS `t1`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t1` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+LOCK TABLES `t1` WRITE;
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+INSERT INTO `t1` VALUES
+(0);
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+UNLOCK TABLES;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+SET GLOBAL max_statement_time=@save_max_statement_time;
+DROP DATABASE test1;
+#
+# End of 10.3 test
+#
diff --git a/mysql-test/main/mysqldump-timing.test b/mysql-test/main/mysqldump-timing.test
new file mode 100644
index 00000000000..07305b73a72
--- /dev/null
+++ b/mysql-test/main/mysqldump-timing.test
@@ -0,0 +1,26 @@
+--source include/not_embedded.inc
+
+--echo #
+--echo # MDEV-18702 mysqldump should use max_statement_time=0 and/or allow setting one
+--echo #
+
+CREATE DATABASE test1;
+USE test1;
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (0);
+LOCK TABLE t1 WRITE;
+--echo timeout without t1 contents expected
+--error 2
+--exec $MYSQL_DUMP --max-statement-time=1 --skip-lock-tables --skip-comments test1 t1
+SET @save_max_statement_time=@@max_statement_time;
+SET GLOBAL max_statement_time=0.1;
+--send UNLOCK TABLES;
+--echo This would be a race condition otherwise, but default max_statement_time=0 makes it succeed
+--exec $MYSQL_DUMP --skip-lock-tables --skip-comments test1 t1
+--reap
+SET GLOBAL max_statement_time=@save_max_statement_time;
+DROP DATABASE test1;
+
+--echo #
+--echo # End of 10.3 test
+--echo #
diff --git a/mysql-test/main/mysqldump.result b/mysql-test/main/mysqldump.result
index 1b4c8775448..9ec5be0f14c 100644
--- a/mysql-test/main/mysqldump.result
+++ b/mysql-test/main/mysqldump.result
@@ -2138,11 +2138,9 @@ DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v2` (
- `a` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v2` AS SELECT
+ 1 AS `a` */;
SET character_set_client = @saved_cs_client;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -2232,11 +2230,9 @@ DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v1` (
- `a` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v1` AS SELECT
+ 1 AS `a` */;
SET character_set_client = @saved_cs_client;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -2311,11 +2307,9 @@ DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v2` (
- `a` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v2` AS SELECT
+ 1 AS `a` */;
SET character_set_client = @saved_cs_client;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -2429,31 +2423,27 @@ DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v1` (
- `a` tinyint NOT NULL,
- `b` tinyint NOT NULL,
- `c` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v1` AS SELECT
+ 1 AS `a`,
+ 1 AS `b`,
+ 1 AS `c` */;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v2` (
- `a` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v2` AS SELECT
+ 1 AS `a` */;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v3`;
/*!50001 DROP VIEW IF EXISTS `v3`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v3` (
- `a` tinyint NOT NULL,
- `b` tinyint NOT NULL,
- `c` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v3` AS SELECT
+ 1 AS `a`,
+ 1 AS `b`,
+ 1 AS `c` */;
SET character_set_client = @saved_cs_client;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -2467,7 +2457,6 @@ SET character_set_client = @saved_cs_client;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -2481,7 +2470,6 @@ SET character_set_client = @saved_cs_client;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v3`*/;
/*!50001 DROP VIEW IF EXISTS `v3`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -3214,35 +3202,31 @@ DROP TABLE IF EXISTS `v0`;
/*!50001 DROP VIEW IF EXISTS `v0`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v0` (
- `a` tinyint NOT NULL,
- `b` tinyint NOT NULL,
- `c` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v0` AS SELECT
+ 1 AS `a`,
+ 1 AS `b`,
+ 1 AS `c` */;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v1` (
- `a` tinyint NOT NULL,
- `b` tinyint NOT NULL,
- `c` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v1` AS SELECT
+ 1 AS `a`,
+ 1 AS `b`,
+ 1 AS `c` */;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v2` (
- `a` tinyint NOT NULL,
- `b` tinyint NOT NULL,
- `c` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v2` AS SELECT
+ 1 AS `a`,
+ 1 AS `b`,
+ 1 AS `c` */;
SET character_set_client = @saved_cs_client;
USE `test`;
-/*!50001 DROP TABLE IF EXISTS `v0`*/;
/*!50001 DROP VIEW IF EXISTS `v0`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -3256,7 +3240,6 @@ USE `test`;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -3270,7 +3253,6 @@ USE `test`;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -3509,7 +3491,7 @@ insert into t values(5, 51);
create view v1 as select qty, price, qty*price as value from t;
create view v2 as select qty from v1;
mysqldump {
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
+/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -3524,7 +3506,7 @@ mysqldump {
/*!50001 SET collation_connection = @saved_col_connection */;
} mysqldump {
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
+/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -3621,13 +3603,11 @@ DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v1` (
- `id` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v1` AS SELECT
+ 1 AS `id` */;
SET character_set_client = @saved_cs_client;
USE `mysqldump_test_db`;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -3681,15 +3661,14 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_views` /*!40100 DEFAULT CHAR
USE `mysqldump_views`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `nasishnasifu` (
- `id` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `nasishnasifu` AS SELECT
+ 1 AS `id` */;
SET character_set_client = @saved_cs_client;
USE `mysqldump_tables`;
USE `mysqldump_views`;
-/*!50001 DROP TABLE IF EXISTS `nasishnasifu`*/;
+/*!50001 DROP VIEW IF EXISTS `nasishnasifu`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -4091,11 +4070,9 @@ DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v2` (
- `c` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v2` AS SELECT
+ 1 AS `c` */;
SET character_set_client = @saved_cs_client;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -4521,13 +4498,11 @@ DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v1` (
- `id` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v1` AS SELECT
+ 1 AS `id` */;
SET character_set_client = @saved_cs_client;
USE `mysqldump_test_db`;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -5617,9 +5592,8 @@ CREATE TABLE `nonunique_table_name` (
/*!40101 SET character_set_client = @saved_cs_client */;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `nonunique_table_view_name` (
- `1` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `nonunique_table_view_name` AS SELECT
+ 1 AS `1` */;
SET character_set_client = @saved_cs_client;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db2` /*!40100 DEFAULT CHARACTER SET utf8mb3 */;
@@ -5646,7 +5620,7 @@ INSERT INTO `nonunique_table_view_name` VALUES
(4);
USE `db1`;
-/*!50001 DROP TABLE IF EXISTS `nonunique_table_view_name`*/;
+/*!50001 DROP VIEW IF EXISTS `nonunique_table_view_name`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -5734,15 +5708,14 @@ INSERT INTO `nonunique_table_name` VALUES
(6);
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `nonunique_table_view_name` (
- `1` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `nonunique_table_view_name` AS SELECT
+ 1 AS `1` */;
SET character_set_client = @saved_cs_client;
USE `db2`;
USE `db1`;
-/*!50001 DROP TABLE IF EXISTS `nonunique_table_view_name`*/;
+/*!50001 DROP VIEW IF EXISTS `nonunique_table_view_name`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
diff --git a/mysql-test/main/openssl_1.result b/mysql-test/main/openssl_1.result
index a9264b3ed2c..8554da4f6be 100644
--- a/mysql-test/main/openssl_1.result
+++ b/mysql-test/main/openssl_1.result
@@ -47,11 +47,11 @@ disconnect con3;
disconnect con4;
drop user ssl_user1@localhost, ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;
drop table t1;
-mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxx
-mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxx
-mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxx
-mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxx
-mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxx
+mysqltest: Could not open connection 'default': 2026 TLS/SSL error: xxxx
+mysqltest: Could not open connection 'default': 2026 TLS/SSL error: xxxx
+mysqltest: Could not open connection 'default': 2026 TLS/SSL error: xxxx
+mysqltest: Could not open connection 'default': 2026 TLS/SSL error: xxxx
+mysqltest: Could not open connection 'default': 2026 TLS/SSL error: xxxx
have_ssl
1
End of 5.0 tests
@@ -185,7 +185,7 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-mysqldump: Got error: 2026: "SSL connection error: xxxx
+mysqldump: Got error: 2026: "TLS/SSL error: xxxx
DROP TABLE t1;
GRANT SELECT ON test.* TO bug42158@localhost REQUIRE X509;
FLUSH PRIVILEGES;
@@ -202,4 +202,4 @@ End of 5.1 tests
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-ERROR: Failed on connect: SSL connection error \ No newline at end of file
+ERROR: Failed on connect: TLS/SSL error \ No newline at end of file
diff --git a/mysql-test/main/openssl_1.test b/mysql-test/main/openssl_1.test
index fff65624b12..968f6e13473 100644
--- a/mysql-test/main/openssl_1.test
+++ b/mysql-test/main/openssl_1.test
@@ -70,7 +70,7 @@ drop table t1;
#
--exec echo "this query should not execute;" > $MYSQLTEST_VARDIR/tmp/test.sql
# Handle that openssl gives different error messages from YaSSL.
---replace_regex /2026 SSL connection error.*/2026 SSL connection error: xxxx/
+--replace_regex /2026 TLS\/SSL error.*/2026 TLS\/SSL error: xxxx/
--error 1
--exec $MYSQL_TEST --ssl-ca=$MYSQL_TEST_DIR/std_data/untrusted-cacert.pem --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
--echo
@@ -79,7 +79,7 @@ drop table t1;
# Test that we can't open connection to server if we are using
# a blank ca
#
---replace_regex /2026 SSL connection error.*/2026 SSL connection error: xxxx/
+--replace_regex /2026 TLS\/SSL error.*/2026 TLS\/SSL error: xxxx/
--error 1
--exec $MYSQL_TEST --ssl-ca= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
--echo
@@ -88,7 +88,7 @@ drop table t1;
# Test that we can't open connection to server if we are using
# a nonexistent ca file
#
---replace_regex /2026 SSL connection error.*/2026 SSL connection error: xxxx/
+--replace_regex /2026 TLS\/SSL error.*/2026 TLS\/SSL error: xxxx/
--error 1
--exec $MYSQL_TEST --ssl-ca=nonexisting_file.pem --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
--echo
@@ -97,7 +97,7 @@ drop table t1;
# Test that we can't open connection to server if we are using
# a blank client-key
#
---replace_regex /2026 SSL connection error.*/2026 SSL connection error: xxxx/
+--replace_regex /2026 TLS\/SSL error.*/2026 TLS\/SSL error: xxxx/
--error 1
--exec $MYSQL_TEST --ssl-key= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
--echo
@@ -106,7 +106,7 @@ drop table t1;
# Test that we can't open connection to server if we are using
# a blank client-cert
#
---replace_regex /2026 SSL connection error.*/2026 SSL connection error: xxxx/
+--replace_regex /2026 TLS\/SSL error.*/2026 TLS\/SSL error: xxxx/
--error 1
--exec $MYSQL_TEST --ssl-cert= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
--echo
@@ -175,7 +175,7 @@ INSERT INTO t1 VALUES (1), (2);
# With wrong parameters
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR mysqldump.exe mysqldump
---replace_regex /SSL connection error.*/SSL connection error: xxxx/
+--replace_regex /TLS\/SSL error.*/TLS\/SSL error: xxxx/
--error 2
--exec $MYSQL_DUMP --default-character-set=utf8mb4 --skip-create-options --skip-comments --ssl --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test 2>&1
--echo
@@ -201,7 +201,7 @@ set global sql_mode=default;
# MDEV-9605 mysqlbinlog does not accept ssl-ca option as expected.
#
---replace_regex /SSL connection error:.*/SSL connection error/
+--replace_regex /TLS\/SSL error:.*/TLS\/SSL error/
--error 1
--exec $MYSQL_BINLOG --read-from-remote-server --ssl-ca --user=root --host=localhost nobinlog.111111 2>&1
diff --git a/mysql-test/main/openssl_6975,tlsv10.result b/mysql-test/main/openssl_6975,tlsv10.result
index b76a91bd134..f848b9a2ccc 100644
--- a/mysql-test/main/openssl_6975,tlsv10.result
+++ b/mysql-test/main/openssl_6975,tlsv10.result
@@ -3,14 +3,14 @@ grant select on test.* to ssl_sslv3@localhost require cipher "AES128-SHA";
create user ssl_tls12@localhost;
grant select on test.* to ssl_tls12@localhost require cipher "AES128-SHA256";
TLS1.2 ciphers: user is ok with any cipher
-ERROR 2026 (HY000): SSL connection error: sslv3 alert handshake failure
-ERROR 2026 (HY000): SSL connection error: sslv3 alert handshake failure
+ERROR 2026 (HY000): TLS/SSL error: sslv3 alert handshake failure
+ERROR 2026 (HY000): TLS/SSL error: sslv3 alert handshake failure
TLS1.2 ciphers: user requires SSLv3 cipher AES128-SHA
-ERROR 2026 (HY000): SSL connection error: sslv3 alert handshake failure
-ERROR 2026 (HY000): SSL connection error: sslv3 alert handshake failure
+ERROR 2026 (HY000): TLS/SSL error: sslv3 alert handshake failure
+ERROR 2026 (HY000): TLS/SSL error: sslv3 alert handshake failure
TLS1.2 ciphers: user requires TLSv1.2 cipher AES128-SHA256
-ERROR 2026 (HY000): SSL connection error: sslv3 alert handshake failure
-ERROR 2026 (HY000): SSL connection error: sslv3 alert handshake failure
+ERROR 2026 (HY000): TLS/SSL error: sslv3 alert handshake failure
+ERROR 2026 (HY000): TLS/SSL error: sslv3 alert handshake failure
SSLv3 ciphers: user is ok with any cipher
Variable_name Value
Ssl_cipher AES256-SHA
diff --git a/mysql-test/main/openssl_6975,tlsv12.result b/mysql-test/main/openssl_6975,tlsv12.result
index c16e503c339..7bc92aec74f 100644
--- a/mysql-test/main/openssl_6975,tlsv12.result
+++ b/mysql-test/main/openssl_6975,tlsv12.result
@@ -15,13 +15,13 @@ Variable_name Value
Ssl_cipher AES128-SHA256
ERROR 1045 (28000): Access denied for user 'ssl_tls12'@'localhost' (using password: NO)
SSLv3 ciphers: user is ok with any cipher
-ERROR 2026 (HY000): SSL connection error: sslv3 alert handshake failure
-ERROR 2026 (HY000): SSL connection error: sslv3 alert handshake failure
+ERROR 2026 (HY000): TLS/SSL error: sslv3 alert handshake failure
+ERROR 2026 (HY000): TLS/SSL error: sslv3 alert handshake failure
SSLv3 ciphers: user requires SSLv3 cipher AES128-SHA
-ERROR 2026 (HY000): SSL connection error: sslv3 alert handshake failure
-ERROR 2026 (HY000): SSL connection error: sslv3 alert handshake failure
+ERROR 2026 (HY000): TLS/SSL error: sslv3 alert handshake failure
+ERROR 2026 (HY000): TLS/SSL error: sslv3 alert handshake failure
SSLv3 ciphers: user requires TLSv1.2 cipher AES128-SHA256
-ERROR 2026 (HY000): SSL connection error: sslv3 alert handshake failure
-ERROR 2026 (HY000): SSL connection error: sslv3 alert handshake failure
+ERROR 2026 (HY000): TLS/SSL error: sslv3 alert handshake failure
+ERROR 2026 (HY000): TLS/SSL error: sslv3 alert handshake failure
drop user ssl_sslv3@localhost;
drop user ssl_tls12@localhost;
diff --git a/mysql-test/main/ps_missed_cmds.result b/mysql-test/main/ps_missed_cmds.result
index d377a359666..08012759481 100644
--- a/mysql-test/main/ps_missed_cmds.result
+++ b/mysql-test/main/ps_missed_cmds.result
@@ -246,264 +246,258 @@ PREPARE stmt_1 FROM "HELP `UPDATE`";
EXECUTE stmt_1;
name description example
UPDATE Syntax
-------
+------
+
Single-table syntax:
-
+
UPDATE [LOW_PRIORITY] [IGNORE] table_reference
[PARTITION (partition_list)]
+ [FOR PORTION OF period FROM expr1 TO expr2]
SET col1={expr1|DEFAULT} [,col2={expr2|DEFAULT}] ...
[WHERE where_condition]
[ORDER BY ...]
[LIMIT row_count]
-
+
Multiple-table syntax:
-
+
UPDATE [LOW_PRIORITY] [IGNORE] table_references
- SET col1={expr1|DEFAULT} [, col2={expr2|DEFAULT}] ...
- [WHERE where_condition]
-
+ SET col1={expr1|DEFAULT} [, col2={expr2|DEFAULT}] ...
+ [WHERE where_condition]
+
Description
------------
-For the single-table syntax, the UPDATE statement updates
-columns of existing rows in the named table with new values.
-The
-SET clause indicates which columns to modify and the values
-they should be given. Each value can be given as an
-expression, or the keyword
-DEFAULT to set a column explicitly to its default value. The
-WHERE clause, if given, specifies the conditions that
-identify
-which rows to update. With no WHERE clause, all rows are
-updated. If the ORDER BY clause is specified, the rows are
-updated in the order that is specified. The LIMIT clause
-places a limit on the number of rows that can be updated.
-
-The PARTITION clause was introduced in MariaDB 10.0. See
-Partition Pruning and Selection for details.
-
-Until MariaDB 10.3.2, for the multiple-table syntax, UPDATE
-updates rows in each
-table named in table_references that satisfy the conditions.
-In this case,
-ORDER BY and LIMIT cannot be used. This restriction was
-lifted in MariaDB 10.3.2 and both clauses can be used with
-multiple-table updates. An UPDATE can also reference tables
-which are located in different databases; see Identifier
-Qualifiers for the syntax.
-
-where_condition is an expression that evaluates to true for
-each row to be updated.
-
-table_references and where_condition are as
-specified as described in SELECT.
-
-Assignments are evaluated in left-to-right order, unless the
-SIMULTANEOUS_ASSIGNMENT sql_mode (available from MariaDB
-10.3.5) is set, in which case the UPDATE statement evaluates
-all assignments simultaneously.
-
-You need the UPDATE privilege only for columns referenced in
-an UPDATE that are actually updated. You need only the
-SELECT privilege for any columns that are read but
-not modified. See GRANT.
-
+-----------
+
+For the single-table syntax, the UPDATE statement updates columns of existing
+rows in the named table with new values. The SET clause indicates which
+columns to modify and the values they should be given. Each value can be given
+as an expression, or the keyword DEFAULT to set a column explicitly to its
+default value. The WHERE clause, if given, specifies the conditions that
+identify which rows to update. With no WHERE clause, all rows are updated. If
+the ORDER BY clause is specified, the rows are updated in the order that is
+specified. The LIMIT clause places a limit on the number of rows that can be
+updated.
+
+Until MariaDB 10.3.2, for the multiple-table syntax, UPDATE updates rows in
+each table named in table_references that satisfy the conditions. In this
+case, ORDER BY and LIMIT cannot be used. This restriction was lifted in
+MariaDB 10.3.2 and both clauses can be used with multiple-table updates. An
+UPDATE can also reference tables which are located in different databases; see
+Identifier Qualifiers for the syntax.
+
+where_condition is an expression that evaluates to true for each row to be
+updated.
+
+table_references and where_condition are as specified as described in SELECT.
+
+For single-table updates, assignments are evaluated in left-to-right order,
+while for multi-table updates, there is no guarantee of a particular order. If
+the SIMULTANEOUS_ASSIGNMENT sql_mode (available from MariaDB 10.3.5) is set,
+UPDATE statements evaluate all assignments simultaneously.
+
+You need the UPDATE privilege only for columns referenced in an UPDATE that
+are actually updated. You need only the SELECT privilege for any columns that
+are read but not modified. See GRANT.
+
The UPDATE statement supports the following modifiers:
-If you use the LOW_PRIORITY keyword, execution of
- the UPDATE is delayed until no other clients are reading
-from
- the table. This affects only storage engines that use only
-table-level
- locking (MyISAM, MEMORY, MERGE). See HIGH_PRIORITY and
-LOW_PRIORITY clauses for details.
-If you use the IGNORE keyword, the update statement does
- not abort even if errors occur during the update. Rows for
-which
- duplicate-key conflicts occur are not updated. Rows for
-which columns are
- updated to values that would cause data conversion errors
-are updated to the
+
+* If you use the LOW_PRIORITY keyword, execution of
+ the UPDATE is delayed until no other clients are reading from
+ the table. This affects only storage engines that use only table-level
+ locking (MyISAM, MEMORY, MERGE). See HIGH_PRIORITY and LOW_PRIORITY clauses
+for details.
+* If you use the IGNORE keyword, the update statement does
+ not abort even if errors occur during the update. Rows for which
+ duplicate-key conflicts occur are not updated. Rows for which columns are
+ updated to values that would cause data conversion errors are updated to the
closest valid values instead.
-
+
+PARTITION
+---------
+
+See Partition Pruning and Selection for details.
+
+FOR PORTION OF
+--------------
+
+MariaDB starting with 10.4.3
+----------------------------
+See Application Time Periods - Updating by Portion.
+
UPDATE Statements With the Same Source and Target
-
-From MariaDB 10.3.2, UPDATE statements may have the same
-source and target.
-
+-------------------------------------------------
+
+MariaDB starting with 10.3.2
+----------------------------
+From MariaDB 10.3.2, UPDATE statements may have the same source and target.
+
For example, given the following table:
-
+
DROP TABLE t1;
-
CREATE TABLE t1 (c1 INT, c2 INT);
INSERT INTO t1 VALUES (10,10), (20,20);
-
-Until MariaDB 10.3.1, the following UPDATE statement would
-not work:
-
+
+Until MariaDB 10.3.1, the following UPDATE statement would not work:
+
UPDATE t1 SET c1=c1+1 WHERE c2=(SELECT MAX(c2) FROM t1);
ERROR 1093 (HY000): Table 't1' is specified twice,
- both as a target for 'UPDATE' and as a separate source
-for data
-
+ both as a target for 'UPDATE' and as a separate source for data
+
From MariaDB 10.3.2, the statement executes successfully:
-
+
UPDATE t1 SET c1=c1+1 WHERE c2=(SELECT MAX(c2) FROM t1);
-
+
SELECT * FROM t1;
-
+------+------+
-| c1 | c2 |
+| c1 | c2 |
+------+------+
-| 10 | 10 |
-| 21 | 20 |
+| 10 | 10 |
+| 21 | 20 |
+------+------+
-
+
Example
-
+-------
+
Single-table syntax:
-
-UPDATE table_name SET column1 = value1, column2 = value2
-WHERE id=100;
-
+
+UPDATE table_name SET column1 = value1, column2 = value2 WHERE id=100;
+
Multiple-table syntax:
-
-UPDATE tab1, tab2 SET tab1.column1 = value1, tab1.column2 =
-value2 WHERE tab1.id = tab2.id;
-
+
+UPDATE tab1, tab2 SET tab1.column1 = value1, tab1.column2 = value2 WHERE
+tab1.id = tab2.id;
+
-URL: https://mariadb.com/kb/en/library/update/
+URL: mariadb.com/kb/en/update/
# Execute the same prepared statement the second time to check that
# no internal structures used for handling the 'HELP' statement
# were damaged.
EXECUTE stmt_1;
name description example
UPDATE Syntax
-------
+------
+
Single-table syntax:
-
+
UPDATE [LOW_PRIORITY] [IGNORE] table_reference
[PARTITION (partition_list)]
+ [FOR PORTION OF period FROM expr1 TO expr2]
SET col1={expr1|DEFAULT} [,col2={expr2|DEFAULT}] ...
[WHERE where_condition]
[ORDER BY ...]
[LIMIT row_count]
-
+
Multiple-table syntax:
-
+
UPDATE [LOW_PRIORITY] [IGNORE] table_references
- SET col1={expr1|DEFAULT} [, col2={expr2|DEFAULT}] ...
- [WHERE where_condition]
-
+ SET col1={expr1|DEFAULT} [, col2={expr2|DEFAULT}] ...
+ [WHERE where_condition]
+
Description
------------
-For the single-table syntax, the UPDATE statement updates
-columns of existing rows in the named table with new values.
-The
-SET clause indicates which columns to modify and the values
-they should be given. Each value can be given as an
-expression, or the keyword
-DEFAULT to set a column explicitly to its default value. The
-WHERE clause, if given, specifies the conditions that
-identify
-which rows to update. With no WHERE clause, all rows are
-updated. If the ORDER BY clause is specified, the rows are
-updated in the order that is specified. The LIMIT clause
-places a limit on the number of rows that can be updated.
-
-The PARTITION clause was introduced in MariaDB 10.0. See
-Partition Pruning and Selection for details.
-
-Until MariaDB 10.3.2, for the multiple-table syntax, UPDATE
-updates rows in each
-table named in table_references that satisfy the conditions.
-In this case,
-ORDER BY and LIMIT cannot be used. This restriction was
-lifted in MariaDB 10.3.2 and both clauses can be used with
-multiple-table updates. An UPDATE can also reference tables
-which are located in different databases; see Identifier
-Qualifiers for the syntax.
-
-where_condition is an expression that evaluates to true for
-each row to be updated.
-
-table_references and where_condition are as
-specified as described in SELECT.
-
-Assignments are evaluated in left-to-right order, unless the
-SIMULTANEOUS_ASSIGNMENT sql_mode (available from MariaDB
-10.3.5) is set, in which case the UPDATE statement evaluates
-all assignments simultaneously.
-
-You need the UPDATE privilege only for columns referenced in
-an UPDATE that are actually updated. You need only the
-SELECT privilege for any columns that are read but
-not modified. See GRANT.
-
+-----------
+
+For the single-table syntax, the UPDATE statement updates columns of existing
+rows in the named table with new values. The SET clause indicates which
+columns to modify and the values they should be given. Each value can be given
+as an expression, or the keyword DEFAULT to set a column explicitly to its
+default value. The WHERE clause, if given, specifies the conditions that
+identify which rows to update. With no WHERE clause, all rows are updated. If
+the ORDER BY clause is specified, the rows are updated in the order that is
+specified. The LIMIT clause places a limit on the number of rows that can be
+updated.
+
+Until MariaDB 10.3.2, for the multiple-table syntax, UPDATE updates rows in
+each table named in table_references that satisfy the conditions. In this
+case, ORDER BY and LIMIT cannot be used. This restriction was lifted in
+MariaDB 10.3.2 and both clauses can be used with multiple-table updates. An
+UPDATE can also reference tables which are located in different databases; see
+Identifier Qualifiers for the syntax.
+
+where_condition is an expression that evaluates to true for each row to be
+updated.
+
+table_references and where_condition are as specified as described in SELECT.
+
+For single-table updates, assignments are evaluated in left-to-right order,
+while for multi-table updates, there is no guarantee of a particular order. If
+the SIMULTANEOUS_ASSIGNMENT sql_mode (available from MariaDB 10.3.5) is set,
+UPDATE statements evaluate all assignments simultaneously.
+
+You need the UPDATE privilege only for columns referenced in an UPDATE that
+are actually updated. You need only the SELECT privilege for any columns that
+are read but not modified. See GRANT.
+
The UPDATE statement supports the following modifiers:
-If you use the LOW_PRIORITY keyword, execution of
- the UPDATE is delayed until no other clients are reading
-from
- the table. This affects only storage engines that use only
-table-level
- locking (MyISAM, MEMORY, MERGE). See HIGH_PRIORITY and
-LOW_PRIORITY clauses for details.
-If you use the IGNORE keyword, the update statement does
- not abort even if errors occur during the update. Rows for
-which
- duplicate-key conflicts occur are not updated. Rows for
-which columns are
- updated to values that would cause data conversion errors
-are updated to the
+
+* If you use the LOW_PRIORITY keyword, execution of
+ the UPDATE is delayed until no other clients are reading from
+ the table. This affects only storage engines that use only table-level
+ locking (MyISAM, MEMORY, MERGE). See HIGH_PRIORITY and LOW_PRIORITY clauses
+for details.
+* If you use the IGNORE keyword, the update statement does
+ not abort even if errors occur during the update. Rows for which
+ duplicate-key conflicts occur are not updated. Rows for which columns are
+ updated to values that would cause data conversion errors are updated to the
closest valid values instead.
-
+
+PARTITION
+---------
+
+See Partition Pruning and Selection for details.
+
+FOR PORTION OF
+--------------
+
+MariaDB starting with 10.4.3
+----------------------------
+See Application Time Periods - Updating by Portion.
+
UPDATE Statements With the Same Source and Target
-
-From MariaDB 10.3.2, UPDATE statements may have the same
-source and target.
-
+-------------------------------------------------
+
+MariaDB starting with 10.3.2
+----------------------------
+From MariaDB 10.3.2, UPDATE statements may have the same source and target.
+
For example, given the following table:
-
+
DROP TABLE t1;
-
CREATE TABLE t1 (c1 INT, c2 INT);
INSERT INTO t1 VALUES (10,10), (20,20);
-
-Until MariaDB 10.3.1, the following UPDATE statement would
-not work:
-
+
+Until MariaDB 10.3.1, the following UPDATE statement would not work:
+
UPDATE t1 SET c1=c1+1 WHERE c2=(SELECT MAX(c2) FROM t1);
ERROR 1093 (HY000): Table 't1' is specified twice,
- both as a target for 'UPDATE' and as a separate source
-for data
-
+ both as a target for 'UPDATE' and as a separate source for data
+
From MariaDB 10.3.2, the statement executes successfully:
-
+
UPDATE t1 SET c1=c1+1 WHERE c2=(SELECT MAX(c2) FROM t1);
-
+
SELECT * FROM t1;
-
+------+------+
-| c1 | c2 |
+| c1 | c2 |
+------+------+
-| 10 | 10 |
-| 21 | 20 |
+| 10 | 10 |
+| 21 | 20 |
+------+------+
-
+
Example
-
+-------
+
Single-table syntax:
-
-UPDATE table_name SET column1 = value1, column2 = value2
-WHERE id=100;
-
+
+UPDATE table_name SET column1 = value1, column2 = value2 WHERE id=100;
+
Multiple-table syntax:
-
-UPDATE tab1, tab2 SET tab1.column1 = value1, tab1.column2 =
-value2 WHERE tab1.id = tab2.id;
-
+
+UPDATE tab1, tab2 SET tab1.column1 = value1, tab1.column2 = value2 WHERE
+tab1.id = tab2.id;
+
-URL: https://mariadb.com/kb/en/library/update/
+URL: mariadb.com/kb/en/update/
# Test case 11: Check that the 'CREATE PROCEDURE' statement
# is supported by prepared statements
PREPARE stmt_1 FROM 'CREATE PROCEDURE p1() SET @a=1';
diff --git a/mysql-test/main/ps_missed_cmds_bin_prot.result b/mysql-test/main/ps_missed_cmds_bin_prot.result
index a56371565a6..6ff37651e4d 100644
--- a/mysql-test/main/ps_missed_cmds_bin_prot.result
+++ b/mysql-test/main/ps_missed_cmds_bin_prot.result
@@ -107,25 +107,31 @@ DROP TABLE t1;
HELP `ALTER SERVER`;
name description example
ALTER SERVER Syntax
-------
+------
+
ALTER SERVER server_name
- OPTIONS (option [, option] ...)
-
+ OPTIONS (option [, option] ...)
+
Description
------------
-Alters the server information for server_name, adjusting the
-specified
-options as per the CREATE SERVER command. The corresponding
-fields in the mysql.servers table are updated accordingly.
-This statement requires the SUPER privilege.
-
+-----------
+
+Alters the server information for server_name, adjusting the specified options
+as per the CREATE SERVER command. The corresponding fields in the
+mysql.servers table are updated accordingly. This statement requires the SUPER
+privilege or, from MariaDB 10.5.2, the FEDERATED ADMIN privilege.
+
+ALTER SERVER is not written to the binary log, irrespective of the binary log
+format being used. From MariaDB 10.1.13, Galera replicates the CREATE SERVER,
+ALTER SERVER and DROP SERVER statements.
+
Examples
---------
+--------
+
ALTER SERVER s OPTIONS (USER 'sally');
-
-URL: https://mariadb.com/kb/en/library/alter-server/
+
+URL: mariadb.com/kb/en/alter-server/
# Test case 11: Check that the statements CREATE/ALTER/DROP PROCEDURE
# are supported by prepared statements
CREATE PROCEDURE p1() SET @a=1;
diff --git a/mysql-test/main/range_notembedded.result b/mysql-test/main/range_notembedded.result
index eeab230e72f..6d2f73cd3f9 100644
--- a/mysql-test/main/range_notembedded.result
+++ b/mysql-test/main/range_notembedded.result
@@ -248,3 +248,12 @@ WHERE
(help_topic_id < '2' OR help_topic_id != 8 OR help_topic_id < 1) AND
help_keyword_id = help_topic_id;
help_topic_id help_keyword_id
+#
+# MDEV-29242: Assertion `computed_weight == weight' failed SEL_ARG::verify_weight
+#
+CREATE TABLE t1 (id INT, KEY (id));
+INSERT INTO t1 VALUES (1),(5);
+SELECT id FROM t1 WHERE id IS NULL OR id NOT BETWEEN 1 AND 4;
+id
+5
+DROP TABLE t1;
diff --git a/mysql-test/main/range_notembedded.test b/mysql-test/main/range_notembedded.test
index 4e77d6a4810..00d16a5d564 100644
--- a/mysql-test/main/range_notembedded.test
+++ b/mysql-test/main/range_notembedded.test
@@ -150,3 +150,12 @@ FROM mysql.help_relation
WHERE
(help_topic_id < '2' OR help_topic_id != 8 OR help_topic_id < 1) AND
help_keyword_id = help_topic_id;
+
+--echo #
+--echo # MDEV-29242: Assertion `computed_weight == weight' failed SEL_ARG::verify_weight
+--echo #
+CREATE TABLE t1 (id INT, KEY (id));
+INSERT INTO t1 VALUES (1),(5);
+SELECT id FROM t1 WHERE id IS NULL OR id NOT BETWEEN 1 AND 4;
+DROP TABLE t1;
+
diff --git a/mysql-test/main/sp-row.result b/mysql-test/main/sp-row.result
index 1cbfa8c639f..f3c0a9e343a 100644
--- a/mysql-test/main/sp-row.result
+++ b/mysql-test/main/sp-row.result
@@ -20,7 +20,7 @@ RETURN a;
END;
$$
SELECT f1(ROW(10,20));
-ERROR HY000: Illegal parameter data types int and row for operation 'SET'
+ERROR HY000: Cannot cast 'row' as 'int' in assignment of `f1(ROW(10,20))`
DROP FUNCTION f1;
#
# ROW as an SP parameter
@@ -236,7 +236,7 @@ SELECT f1(a);
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types int and row for operation 'SET'
+ERROR HY000: Cannot cast 'row' as 'int' in assignment of `a`
DROP PROCEDURE p1;
DROP FUNCTION f1;
#
@@ -286,7 +286,7 @@ RETURN rec;
END;
$$
SELECT f1(10);
-ERROR HY000: Illegal parameter data types int and row for operation 'SET'
+ERROR HY000: Cannot cast 'row' as 'int' in assignment of `f1(10)`
DROP FUNCTION f1;
#
# Using the entire ROW in SELECT..CREATE
diff --git a/mysql-test/main/sp-vars.result b/mysql-test/main/sp-vars.result
index 127a0993e2b..feef67ccb1d 100644
--- a/mysql-test/main/sp-vars.result
+++ b/mysql-test/main/sp-vars.result
@@ -1026,11 +1026,11 @@ BEGIN
SELECT arg;
END|
CALL p1((1, 2));
-ERROR HY000: Illegal parameter data types tinyint and row for operation 'SET'
+ERROR 21000: Operand should contain 1 column(s)
CALL p1((SELECT * FROM t1 LIMIT 1));
-ERROR HY000: Illegal parameter data types tinyint and row for operation 'SET'
+ERROR 21000: Operand should contain 1 column(s)
CALL p1((SELECT col1, col2 FROM t1 LIMIT 1));
-ERROR HY000: Illegal parameter data types tinyint and row for operation 'SET'
+ERROR 21000: Operand should contain 1 column(s)
DROP PROCEDURE p1;
DROP TABLE t1;
diff --git a/mysql-test/main/sp-vars.test b/mysql-test/main/sp-vars.test
index 5e1e07888ca..9edf245acbe 100644
--- a/mysql-test/main/sp-vars.test
+++ b/mysql-test/main/sp-vars.test
@@ -1221,13 +1221,13 @@ BEGIN
END|
delimiter ;|
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+--error ER_OPERAND_COLUMNS
CALL p1((1, 2));
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+--error ER_OPERAND_COLUMNS
CALL p1((SELECT * FROM t1 LIMIT 1));
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+--error ER_OPERAND_COLUMNS
CALL p1((SELECT col1, col2 FROM t1 LIMIT 1));
#
diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result
index 364e7b88ccf..359deffb4d1 100644
--- a/mysql-test/main/sp.result
+++ b/mysql-test/main/sp.result
@@ -255,7 +255,7 @@ return i+1|
call sub1("sub1a", (select 7))|
call sub1("sub1b", (select max(i) from t2))|
call sub1("sub1c", (select i,d from t2 limit 1))|
-ERROR HY000: Illegal parameter data types int and row for operation 'SET'
+ERROR HY000: Cannot cast 'row' as 'int' in assignment of `x`
call sub1("sub1d", (select 1 from (select 1) a))|
call sub2("sub2")|
select * from t1 order by id|
diff --git a/mysql-test/main/ssl_7937,nossl.result b/mysql-test/main/ssl_7937,nossl.result
index 72693233bc8..7ce4a754bf8 100644
--- a/mysql-test/main/ssl_7937,nossl.result
+++ b/mysql-test/main/ssl_7937,nossl.result
@@ -9,7 +9,7 @@ mysql --ssl -e "call test.have_ssl()"
have_ssl
no
mysql --ssl-ca=cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()"
-ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it
+ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it
mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()"
-ERROR 2026 (HY000): SSL connection error: SSL is required, but the server does not support it
+ERROR 2026 (HY000): TLS/SSL error: SSL is required, but the server does not support it
drop procedure have_ssl;
diff --git a/mysql-test/main/ssl_7937.result b/mysql-test/main/ssl_7937.result
index a94ca3b3529..86180af3692 100644
--- a/mysql-test/main/ssl_7937.result
+++ b/mysql-test/main/ssl_7937.result
@@ -12,5 +12,5 @@ mysql --ssl-ca=cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()"
have_ssl
yes
mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()"
-ERROR 2026 (HY000): SSL connection error: Failed to verify the server certificate
+ERROR 2026 (HY000): TLS/SSL error: Failed to verify the server certificate
drop procedure have_ssl;
diff --git a/mysql-test/main/ssl_7937.test b/mysql-test/main/ssl_7937.test
index 59c13107e01..58583a32ae3 100644
--- a/mysql-test/main/ssl_7937.test
+++ b/mysql-test/main/ssl_7937.test
@@ -21,6 +21,6 @@ create procedure have_ssl()
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1
--echo mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()"
---replace_regex /SSL connection error.*certificate[^\n]*/SSL connection error: Failed to verify the server certificate/
+--replace_regex /TLS\/SSL error.*certificate[^\n]*/TLS\/SSL error: Failed to verify the server certificate/
--exec $MYSQL --ssl --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1
drop procedure have_ssl;
diff --git a/mysql-test/main/ssl_ca.result b/mysql-test/main/ssl_ca.result
index afffe4e4dff..85683a0ba90 100644
--- a/mysql-test/main/ssl_ca.result
+++ b/mysql-test/main/ssl_ca.result
@@ -2,7 +2,7 @@
# Bug#21920657: SSL-CA FAILS SILENTLY IF THE PATH CANNOT BE FOUND
#
# try to connect with wrong '--ssl-ca' path : should fail
-ERROR 2026 (HY000): SSL connection error: xxxx
+ERROR 2026 (HY000): TLS/SSL error: xxxx
# try to connect with correct '--ssl-ca' path : should connect
have_ssl
1
diff --git a/mysql-test/main/ssl_ca.test b/mysql-test/main/ssl_ca.test
index 106da140130..b66afc22188 100644
--- a/mysql-test/main/ssl_ca.test
+++ b/mysql-test/main/ssl_ca.test
@@ -7,7 +7,7 @@
--echo # try to connect with wrong '--ssl-ca' path : should fail
---replace_regex /SSL connection error.*/SSL connection error: xxxx/
+--replace_regex /TLS\/SSL error.*/TLS\/SSL error: xxxx/
--error 1
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/wrong-cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test -e "SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher';" 2>&1
--echo
diff --git a/mysql-test/main/ssl_cipher.result b/mysql-test/main/ssl_cipher.result
index 66d817b7b41..42f37f488e7 100644
--- a/mysql-test/main/ssl_cipher.result
+++ b/mysql-test/main/ssl_cipher.result
@@ -44,7 +44,7 @@ Ssl_cipher AES128-SHA
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher AES128-SHA
-mysqltest: Could not open connection 'default': 2026 SSL connection error: xxxxVariable_name Value
+mysqltest: Could not open connection 'default': 2026 TLS/SSL error: xxxxVariable_name Value
Ssl_cipher AES256-SHA
Variable_name Value
Ssl_cipher AES128-SHA
diff --git a/mysql-test/main/ssl_cipher.test b/mysql-test/main/ssl_cipher.test
index d4cdcffb276..4671b085ce7 100644
--- a/mysql-test/main/ssl_cipher.test
+++ b/mysql-test/main/ssl_cipher.test
@@ -54,7 +54,7 @@ EOF
# Test to connect using a specifi cipher
--exec $MYSQL_TEST --ssl-cipher=AES128-SHA < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
# Test to connect using an unknown cipher
---replace_regex /2026 SSL connection error.*/2026 SSL connection error: xxxx/
+--replace_regex /2026 TLS\/SSL error.*/2026 TLS\/SSL error: xxxx/
--error 1
--exec $MYSQL_TEST --ssl-cipher=UNKNOWN-CIPHER < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
--remove_file $MYSQLTEST_VARDIR/tmp/test.sql
diff --git a/mysql-test/main/ssl_crl.result b/mysql-test/main/ssl_crl.result
index 598774bd772..d5603254ea5 100644
--- a/mysql-test/main/ssl_crl.result
+++ b/mysql-test/main/ssl_crl.result
@@ -2,4 +2,4 @@
Variable_name Value
Ssl_version TLS_VERSION
# try logging in with a certificate in the server's --ssl-crl : should fail
-ERROR 2026 (HY000): SSL connection error: sslv3 alert certificate revoked
+ERROR 2026 (HY000): TLS/SSL error: sslv3 alert certificate revoked
diff --git a/mysql-test/main/ssl_crl.test b/mysql-test/main/ssl_crl.test
index 23bae038d54..9b4758578a7 100644
--- a/mysql-test/main/ssl_crl.test
+++ b/mysql-test/main/ssl_crl.test
@@ -8,6 +8,6 @@
--echo # try logging in with a certificate in the server's --ssl-crl : should fail
# OpenSSL 1.1.1a correctly rejects the certificate, but the error message is different
---replace_regex /ERROR 2013 \(HY000\): Lost connection to server at '.*', system error: [0-9]+/ERROR 2026 (HY000): SSL connection error: sslv3 alert certificate revoked/
+--replace_regex /ERROR 2013 \(HY000\): Lost connection to server at '.*', system error: [0-9]+/ERROR 2026 (HY000): TLS\/SSL error: sslv3 alert certificate revoked/
--error 1
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_version'" 2>&1
diff --git a/mysql-test/main/ssl_crl_clients.result b/mysql-test/main/ssl_crl_clients.result
index 0d8ed9a4158..44ba101c892 100644
--- a/mysql-test/main/ssl_crl_clients.result
+++ b/mysql-test/main/ssl_crl_clients.result
@@ -1,13 +1,13 @@
# Test clients with and without CRL lists
############ Test mysql ##############
# Test mysql connecting to a server with a certificate revoked by -crl
-ERROR 2026 (HY000): SSL connection error: certificate revoked
+ERROR 2026 (HY000): TLS/SSL error: certificate revoked
# Test mysql connecting to a server with a certificate revoked by -crlpath
-ERROR 2026 (HY000): SSL connection error: certificate revoked
+ERROR 2026 (HY000): TLS/SSL error: certificate revoked
############ Test mysqladmin ##############
# Test mysqladmin connecting to a server with a certificate revoked by -crl
mysqladmin: connect to server at 'localhost' failed
-error: 'SSL connection error: certificate revoked'
+error: 'TLS/SSL error: certificate revoked'
# Test mysqladmin connecting to a server with a certificate revoked by -crlpath
mysqladmin: connect to server at 'localhost' failed
-error: 'SSL connection error: certificate revoked'
+error: 'TLS/SSL error: certificate revoked'
diff --git a/mysql-test/main/ssl_crl_clients.test b/mysql-test/main/ssl_crl_clients.test
index f1dc4909cc6..0023dee03ac 100644
--- a/mysql-test/main/ssl_crl_clients.test
+++ b/mysql-test/main/ssl_crl_clients.test
@@ -34,11 +34,11 @@ copy_file $MYSQL_TEST_DIR/std_data/server-cert.crl $MYSQL_TMP_DIR/ed1f42db.r0;
let $admin_suffix = --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping;
--echo # Test mysqladmin connecting to a server with a certificate revoked by -crl
---replace_regex /.*mysqladmin.*:/mysqladmin:/ /SSL connection error: .*CRYPT_E_REVOKED./SSL connection error: certificate revoked/
+--replace_regex /.*mysqladmin.*:/mysqladmin:/ /TLS\/SSL error: .*CRYPT_E_REVOKED./TLS\/SSL error: certificate revoked/
--error 1
--exec $MYSQLADMIN $ssl_crl $admin_suffix 2>&1
--echo # Test mysqladmin connecting to a server with a certificate revoked by -crlpath
---replace_regex /.*mysqladmin.*:/mysqladmin:/ /SSL connection error: .*CRYPT_E_REVOKED./SSL connection error: certificate revoked/
+--replace_regex /.*mysqladmin.*:/mysqladmin:/ /TLS\/SSL error: .*CRYPT_E_REVOKED./TLS\/SSL error: certificate revoked/
--error 1
--exec $MYSQLADMIN $ssl_crlpath $admin_suffix 2>&1
diff --git a/mysql-test/main/ssl_system_ca,bad.result b/mysql-test/main/ssl_system_ca,bad.result
index b9c6d3e29d8..1799e9f5e32 100644
--- a/mysql-test/main/ssl_system_ca,bad.result
+++ b/mysql-test/main/ssl_system_ca,bad.result
@@ -1 +1 @@
-ERROR 2026 (HY000): SSL connection error: Validation of SSL server certificate failed
+ERROR 2026 (HY000): TLS/SSL error: Validation of SSL server certificate failed
diff --git a/mysql-test/main/strings.result b/mysql-test/main/strings.result
index 2d0eb5e7400..6573e734422 100644
--- a/mysql-test/main/strings.result
+++ b/mysql-test/main/strings.result
@@ -18,3 +18,13 @@ LENGTH(CONCAT_WS(d, ' '))
1
1
DROP TABLE t1;
+#
+# MDEV-28315 ASAN stack-buffer-overflow in String::copy_aligned
+#
+CREATE TABLE t1 (a VARBINARY(128)) CHARACTER SET utf32;
+INSERT INTO t1 VALUES ('South Carolina, Vermont, New Jersey, New Mexico, Wisconsin, Missouri, Delaware');
+CREATE TABLE t2 (b SET('South Carolina', 'Vermont', 'Texas', 'New Mexico', 'Wisconsin', 'Missouri', 'Delaware', 'Wyoming', 'New Jersey', 'Maryland', 'Illinois', 'New York')) CHARACTER SET utf32;
+INSERT INTO t2 SELECT * FROM t1;
+ERROR 01000: Data truncated for column 'b' at row 1
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/main/strings.test b/mysql-test/main/strings.test
index 083ab7b07a4..3f3f4b572af 100644
--- a/mysql-test/main/strings.test
+++ b/mysql-test/main/strings.test
@@ -24,3 +24,15 @@ CREATE TABLE t1 (d DATE);
INSERT INTO t1 VALUES ('1920-03-02'),('2020-12-01');
SELECT LENGTH(CONCAT_WS(d, ' ')) FROM t1;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-28315 ASAN stack-buffer-overflow in String::copy_aligned
+--echo #
+
+CREATE TABLE t1 (a VARBINARY(128)) CHARACTER SET utf32;
+INSERT INTO t1 VALUES ('South Carolina, Vermont, New Jersey, New Mexico, Wisconsin, Missouri, Delaware');
+CREATE TABLE t2 (b SET('South Carolina', 'Vermont', 'Texas', 'New Mexico', 'Wisconsin', 'Missouri', 'Delaware', 'Wyoming', 'New Jersey', 'Maryland', 'Illinois', 'New York')) CHARACTER SET utf32;
+--error WARN_DATA_TRUNCATED
+INSERT INTO t2 SELECT * FROM t1;
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/main/type_geometry_mix_int.result b/mysql-test/main/type_geometry_mix_int.result
index e5d00c63727..bf05ca1829d 100644
--- a/mysql-test/main/type_geometry_mix_int.result
+++ b/mysql-test/main/type_geometry_mix_int.result
@@ -6,6 +6,7 @@
#
CREATE TABLE t1 (target GEOMETRY DEFAULT POINT(1,1), source INT DEFAULT 0);
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -30,7 +35,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -47,6 +52,7 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
SELECT * FROM v3;
id target source
1 POINT(1 1) 0
@@ -59,37 +65,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
SELECT * FROM v3;
id target source
1 POINT(1 1) 0
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target int(11)
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -100,15 +106,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a geometry) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a geometry) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst geometry)
BEGIN
@@ -123,10 +129,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types geometry and int for operation 'SET'
+Error 4078 Cannot cast 'int' as 'geometry' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -138,7 +144,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -149,7 +155,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -163,13 +169,14 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
DROP TABLE t1;
CREATE TABLE t1 (target INT DEFAULT 0, source GEOMETRY DEFAULT POINT(1,1));
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -178,6 +185,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -194,7 +205,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -226,37 +237,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect integer value: '\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xF0?\x00\x00\x00\x00\x00\x00\xF0?' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 0 POINT(1 1)
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target geometry
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -267,15 +278,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a int(11)) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a int(11)) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst int(11))
BEGIN
@@ -290,10 +301,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types int and geometry for operation 'SET'
+Error 4078 Cannot cast 'geometry' as 'int' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -305,7 +316,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -316,7 +327,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -330,7 +341,7 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types int and geometry for operation 'SET'
+ERROR HY000: Cannot cast 'geometry' as 'int' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
diff --git a/mysql-test/main/type_timestamp.result b/mysql-test/main/type_timestamp.result
index 52d0be675e2..a5754e4cfc5 100644
--- a/mysql-test/main/type_timestamp.result
+++ b/mysql-test/main/type_timestamp.result
@@ -1322,3 +1322,27 @@ SET timestamp=DEFAULT;
#
# End of 10.4 tests
#
+#
+# MDEV-29225 make explicit_defaults_for_timestamps SESSION variable
+#
+set explicit_defaults_for_timestamp=OFF;
+create table t1 (f1 timestamp, f2 timestamp);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
+ `f2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+set explicit_defaults_for_timestamp=ON;
+create table t1 (f1 timestamp, f2 timestamp);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` timestamp NULL DEFAULT NULL,
+ `f2` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+#
+# End of 10.10 tests
+#
diff --git a/mysql-test/main/type_timestamp.test b/mysql-test/main/type_timestamp.test
index 80bc0bd0332..2c24b7d9d66 100644
--- a/mysql-test/main/type_timestamp.test
+++ b/mysql-test/main/type_timestamp.test
@@ -874,7 +874,23 @@ SELECT CASE WHEN a THEN DEFAULT(a) END FROM t1;
DROP TABLE t1;
SET timestamp=DEFAULT;
-
--echo #
--echo # End of 10.4 tests
--echo #
+
+--echo #
+--echo # MDEV-29225 make explicit_defaults_for_timestamps SESSION variable
+--echo #
+
+set explicit_defaults_for_timestamp=OFF;
+create table t1 (f1 timestamp, f2 timestamp);
+show create table t1;
+drop table t1;
+set explicit_defaults_for_timestamp=ON;
+create table t1 (f1 timestamp, f2 timestamp);
+show create table t1;
+drop table t1;
+
+--echo #
+--echo # End of 10.10 tests
+--echo #
diff --git a/mysql-test/main/user_var-binlog.result b/mysql-test/main/user_var-binlog.result
index 20d1d8e7da8..c07d6d42b98 100644
--- a/mysql-test/main/user_var-binlog.result
+++ b/mysql-test/main/user_var-binlog.result
@@ -29,7 +29,7 @@ SET @`a b`:=_latin1 X'68656C6C6F' COLLATE `latin1_swedish_ci`/*!*/;
use `test`/*!*/;
SET TIMESTAMP=10000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/main/wait_timeout.test b/mysql-test/main/wait_timeout.test
index 84841aabb8b..f7289ceed1f 100644
--- a/mysql-test/main/wait_timeout.test
+++ b/mysql-test/main/wait_timeout.test
@@ -61,7 +61,7 @@ connection default;
# When the connection is closed in this way, the error code should
# be consistent see Bug#2845 for an explanation
# depending on platform/client, either errno 2006 or 2013 can occur below
---error 2006,2013
+--error 2006,2013,5014
SELECT 2;
--echo --enable_reconnect;
--enable_reconnect
@@ -113,7 +113,7 @@ connection con1;
# When the connection is closed in this way, the error code should
# be consistent see Bug#2845 for an explanation
# depending on platform/client, either errno 2006 or 2013 can occur below
---error 2006,2013
+--error 2006,2013,5014
SELECT 2;
--echo --enable_reconnect;
--enable_reconnect
diff --git a/mysql-test/std_data/init_file_longline_3816.sql b/mysql-test/std_data/init_file_longline_3816.sql
index 345162ec438..d67fd53a48a 100644
--- a/mysql-test/std_data/init_file_longline_3816.sql
+++ b/mysql-test/std_data/init_file_longline_3816.sql
@@ -3,6 +3,6 @@
#
use test;
CREATE TABLE t4 (c VARCHAR(100)) ENGINE=MyISAM;
-INSERT t4 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaa');
+INSERT t4 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaa'),('aaaaaaaaaaaaaaaaaaaaaa');
INSERT t4 VALUES ('aaaaaaaaaaaaaaaaaaaaaa');
diff --git a/mysql-test/std_data/mdev-28727-pet4.frm b/mysql-test/std_data/mdev-28727-pet4.frm
new file mode 100644
index 00000000000..3ff86d1dca1
--- /dev/null
+++ b/mysql-test/std_data/mdev-28727-pet4.frm
Binary files differ
diff --git a/mysql-test/std_data/mdev29078-mysql-bin.000001 b/mysql-test/std_data/mdev29078-mysql-bin.000001
new file mode 100644
index 00000000000..efcbb0c9832
--- /dev/null
+++ b/mysql-test/std_data/mdev29078-mysql-bin.000001
Binary files differ
diff --git a/mysql-test/suite/archive/archive_gis.result b/mysql-test/suite/archive/archive_gis.result
index 25854db1feb..527a6daeee8 100644
--- a/mysql-test/suite/archive/archive_gis.result
+++ b/mysql-test/suite/archive/archive_gis.result
@@ -452,9 +452,9 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
create table t1 (pk integer primary key auto_increment, fl geometry not null);
insert into t1 (fl) values (1);
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 (fl) values (1.11);
-ERROR HY000: Illegal parameter data types geometry and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 (fl) values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (pointfromtext('point(1,1)'));
diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result
index a75164992d5..a79ae45981e 100644
--- a/mysql-test/suite/binlog/r/binlog_base64_flag.result
+++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result
@@ -59,7 +59,7 @@ ROLLBACK/*!*/;
<#>
use `test`/*!*/;
SET TIMESTAMP=1196959712/*!*/;
-<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result
index 1d6e94249dc..d2e904508dc 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result
@@ -25,7 +25,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -97,7 +97,7 @@ SET INSERT_ID=1/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -163,7 +163,7 @@ SET INSERT_ID=3/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773144/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -208,7 +208,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -253,7 +253,7 @@ SET INSERT_ID=3/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773144/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -280,7 +280,7 @@ SET INSERT_ID=3/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773144/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -325,7 +325,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -368,7 +368,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -430,7 +430,7 @@ SET INSERT_ID=6/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773143/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -460,7 +460,7 @@ SET INSERT_ID=1/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -516,7 +516,7 @@ SET INSERT_ID=6/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773143/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -546,7 +546,7 @@ SET INSERT_ID=3/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773144/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -584,7 +584,7 @@ SET INSERT_ID=6/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773143/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -611,7 +611,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -687,7 +687,7 @@ SET INSERT_ID=3/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773144/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -725,7 +725,7 @@ SET INSERT_ID=6/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773143/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -752,7 +752,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -794,7 +794,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -866,7 +866,7 @@ SET INSERT_ID=1/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -931,7 +931,7 @@ SET INSERT_ID=3/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773144/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -976,7 +976,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1020,7 +1020,7 @@ SET INSERT_ID=3/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773144/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1047,7 +1047,7 @@ SET INSERT_ID=3/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773144/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1092,7 +1092,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1134,7 +1134,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1196,7 +1196,7 @@ SET INSERT_ID=6/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773143/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1226,7 +1226,7 @@ SET INSERT_ID=1/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1282,7 +1282,7 @@ SET INSERT_ID=6/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773143/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1311,7 +1311,7 @@ SET INSERT_ID=3/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773144/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1349,7 +1349,7 @@ SET INSERT_ID=6/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773143/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1376,7 +1376,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1450,7 +1450,7 @@ SET INSERT_ID=3/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773144/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1488,7 +1488,7 @@ SET INSERT_ID=6/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773143/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1515,7 +1515,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1557,7 +1557,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
index e79ee863268..9195f9fd3ad 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
@@ -376,7 +376,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -5386,7 +5386,7 @@ DELIMITER /*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
index 5db32763533..96059d009c0 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
@@ -2270,7 +2270,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
@@ -5279,7 +5279,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
@@ -5679,7 +5679,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
@@ -6317,7 +6317,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
index 62dcca4d7a2..630a9f1d381 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
@@ -2268,7 +2268,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
@@ -5300,7 +5300,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
@@ -5706,7 +5706,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
@@ -6354,7 +6354,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
index e52b849c4c7..748b92df1a8 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
@@ -146,7 +146,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_row_annotate.result b/mysql-test/suite/binlog/r/binlog_row_annotate.result
index 539b7140469..ffdb31cdbeb 100644
--- a/mysql-test/suite/binlog/r/binlog_row_annotate.result
+++ b/mysql-test/suite/binlog/r/binlog_row_annotate.result
@@ -116,7 +116,7 @@ ROLLBACK/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -354,7 +354,7 @@ ROLLBACK/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -513,7 +513,7 @@ ROLLBACK/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -739,7 +739,7 @@ ROLLBACK/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -977,7 +977,7 @@ ROLLBACK/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1136,7 +1136,7 @@ ROLLBACK/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
index 948a69e5b63..74aef814785 100644
--- a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
@@ -22,7 +22,7 @@ START TRANSACTION
#Q> insert into t2 values (@v)
SET TIMESTAMP=10000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -92,7 +92,7 @@ DELIMITER /*!*/;
use `test`/*!*/;
SET TIMESTAMP=XXX/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
index fa807d46c32..dc7750b975e 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
@@ -50,7 +50,7 @@ use `new_test1`/*!*/;
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -291,7 +291,7 @@ use `new_test1`/*!*/;
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
index 85b9a72a49b..e449025eee9 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
@@ -21,7 +21,7 @@ SET @`v`:=_ucs2 X'006100620063' COLLATE `ucs2_general_ci`/*!*/;
use `test`/*!*/;
SET TIMESTAMP=10000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -94,7 +94,7 @@ DELIMITER /*!*/;
use `test`/*!*/;
SET TIMESTAMP=XXX/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
diff --git a/mysql-test/suite/binlog/r/flashback.result b/mysql-test/suite/binlog/r/flashback.result
index 61b97d95d01..7d65a8ec2b3 100644
--- a/mysql-test/suite/binlog/r/flashback.result
+++ b/mysql-test/suite/binlog/r/flashback.result
@@ -60,7 +60,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -422,7 +422,7 @@ COMMIT
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/binlog_encryption/binlog_row_annotate.result b/mysql-test/suite/binlog_encryption/binlog_row_annotate.result
index 9050e632dd4..80b9c5d476c 100644
--- a/mysql-test/suite/binlog_encryption/binlog_row_annotate.result
+++ b/mysql-test/suite/binlog_encryption/binlog_row_annotate.result
@@ -120,7 +120,7 @@ ROLLBACK/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -361,7 +361,7 @@ ROLLBACK/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -523,7 +523,7 @@ ROLLBACK/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/compat/oracle/r/sp-row.result b/mysql-test/suite/compat/oracle/r/sp-row.result
index a15fe30d8af..7fd986a71c8 100644
--- a/mysql-test/suite/compat/oracle/r/sp-row.result
+++ b/mysql-test/suite/compat/oracle/r/sp-row.result
@@ -24,7 +24,7 @@ RETURN a;
END;
$$
SELECT f1(ROW(10,20));
-ERROR HY000: Illegal parameter data types int and row for operation 'SET'
+ERROR 21000: Operand should contain 1 column(s)
DROP FUNCTION f1;
#
# ROW as an SP parameter
@@ -261,7 +261,7 @@ SELECT f1(a);
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types int and row for operation 'SET'
+ERROR 21000: Operand should contain 1 column(s)
DROP PROCEDURE p1;
DROP FUNCTION f1;
CREATE FUNCTION f1(a INT) RETURN INT
@@ -278,7 +278,7 @@ SELECT f1(a);
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types int and row for operation 'SET'
+ERROR 21000: Operand should contain 1 column(s)
DROP PROCEDURE p1;
DROP FUNCTION f1;
#
@@ -332,7 +332,7 @@ RETURN rec;
END;
$$
SELECT f1(10);
-ERROR HY000: Illegal parameter data types int and row for operation 'SET'
+ERROR 21000: Operand should contain 1 column(s)
DROP FUNCTION f1;
#
# Using the entire ROW in SELECT..CREATE
diff --git a/mysql-test/suite/compat/oracle/t/sp-row.test b/mysql-test/suite/compat/oracle/t/sp-row.test
index c7658c76838..ebd0a2a2137 100644
--- a/mysql-test/suite/compat/oracle/t/sp-row.test
+++ b/mysql-test/suite/compat/oracle/t/sp-row.test
@@ -35,7 +35,7 @@ BEGIN
END;
$$
DELIMITER ;$$
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+--error ER_OPERAND_COLUMNS
SELECT f1(ROW(10,20));
DROP FUNCTION f1;
@@ -334,7 +334,7 @@ BEGIN
END;
$$
DELIMITER ;$$
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+--error ER_OPERAND_COLUMNS
CALL p1();
DROP PROCEDURE p1;
DROP FUNCTION f1;
@@ -355,7 +355,7 @@ BEGIN
END;
$$
DELIMITER ;$$
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+--error ER_OPERAND_COLUMNS
CALL p1();
DROP PROCEDURE p1;
DROP FUNCTION f1;
@@ -427,7 +427,7 @@ BEGIN
END;
$$
DELIMITER ;$$
---error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+--error ER_OPERAND_COLUMNS
SELECT f1(10);
DROP FUNCTION f1;
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
index d2ea45dc949..dcd822b0a41 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
@@ -1,6 +1,6 @@
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|does not exist.*is trying to rename)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1(new)?\\.ibd' cannot be decrypted; key_version=1");
-call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
+call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
call mtr.add_suppression("InnoDB: Tablespace for table \`test\`.\`t1\` is set as discarded\\.");
call mtr.add_suppression("Table .*t1.* is corrupted");
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
index a5a6d65e4a2..e808d50b544 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
@@ -1,6 +1,6 @@
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1\\.ibd' cannot be decrypted; key_version=1");
-call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
+call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
call mtr.add_suppression("Table .*t1.* is corrupted");
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
diff --git a/mysql-test/suite/encryption/r/innodb-compressed-blob.result b/mysql-test/suite/encryption/r/innodb-compressed-blob.result
index 39f482b2422..0dc873b99ab 100644
--- a/mysql-test/suite/encryption/r/innodb-compressed-blob.result
+++ b/mysql-test/suite/encryption/r/innodb-compressed-blob.result
@@ -1,5 +1,5 @@
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted; key_version=1");
-call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
+call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("InnoDB: Unable to decompress ..test.t[1-3]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]");
call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted");
# Restart mysqld --file-key-management-filename=keys2.txt
diff --git a/mysql-test/suite/encryption/r/innodb-encryption-disable.result b/mysql-test/suite/encryption/r/innodb-encryption-disable.result
index bb4f02b9c39..179bc550617 100644
--- a/mysql-test/suite/encryption/r/innodb-encryption-disable.result
+++ b/mysql-test/suite/encryption/r/innodb-encryption-disable.result
@@ -1,6 +1,6 @@
call mtr.add_suppression("InnoDB: Table `test`\\.`t[15]` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[15]\\.ibd' cannot be decrypted\\.");
-call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
+call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t[15].ibd looks corrupted; key_version=1");
call mtr.add_suppression("InnoDB: Table `test`\\.`t[15]` is corrupted");
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
diff --git a/mysql-test/suite/encryption/r/innodb-missing-key.result b/mysql-test/suite/encryption/r/innodb-missing-key.result
index c8aadfd5172..d5c1e079e96 100644
--- a/mysql-test/suite/encryption/r/innodb-missing-key.result
+++ b/mysql-test/suite/encryption/r/innodb-missing-key.result
@@ -1,6 +1,6 @@
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` has an unreadable root page");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\.");
-call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
+call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file .*test.t[12].ibd looks corrupted; key_version=1");
call mtr.add_suppression("Table .*t1.* is corrupted");
# Start server with keys2.txt
diff --git a/mysql-test/suite/encryption/r/innodb-redo-badkey.result b/mysql-test/suite/encryption/r/innodb-redo-badkey.result
index aa4fcde7a6c..9d583b32101 100644
--- a/mysql-test/suite/encryption/r/innodb-redo-badkey.result
+++ b/mysql-test/suite/encryption/r/innodb-redo-badkey.result
@@ -2,7 +2,7 @@ call mtr.add_suppression("Plugin 'file_key_management'");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error.");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[1-4]\\.ibd' cannot be decrypted; key_version=1");
call mtr.add_suppression("InnoDB: File '.*test/t[1234]\\.ibd' is corrupted");
-call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
+call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("InnoDB: Unable to decompress .*.test.t[12]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]");
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*test.t[12]\\.ibd'");
call mtr.add_suppression("InnoDB: Failed to read page .* from file '.*'");
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
index 8a3ecf9deb0..21a9ddb217d 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
@@ -10,7 +10,7 @@
#
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|does not exist.*is trying to rename)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1(new)?\\.ibd' cannot be decrypted; key_version=1");
-call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
+call mtr.add_suppression("InnoDB: Recovery failed to read page");
# Suppression for builds where file_key_management plugin is linked statically
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
call mtr.add_suppression("InnoDB: Tablespace for table \`test\`.\`t1\` is set as discarded\\.");
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
index 3b4dfb8c1f2..c37eb365e7c 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
@@ -9,7 +9,7 @@
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1\\.ibd' cannot be decrypted; key_version=1");
-call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
+call mtr.add_suppression("InnoDB: Recovery failed to read page");
# Suppression for builds where file_key_management plugin is linked statically
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
call mtr.add_suppression("Table .*t1.* is corrupted");
diff --git a/mysql-test/suite/encryption/t/innodb-compressed-blob.test b/mysql-test/suite/encryption/t/innodb-compressed-blob.test
index 1bc9e2a879a..12d061a852f 100644
--- a/mysql-test/suite/encryption/t/innodb-compressed-blob.test
+++ b/mysql-test/suite/encryption/t/innodb-compressed-blob.test
@@ -5,7 +5,7 @@
-- source include/not_embedded.inc
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted; key_version=1");
-call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
+call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("InnoDB: Unable to decompress ..test.t[1-3]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]");
call mtr.add_suppression("InnoDB: Table `test`\\.`t[12]` is corrupted");
diff --git a/mysql-test/suite/encryption/t/innodb-encryption-disable.test b/mysql-test/suite/encryption/t/innodb-encryption-disable.test
index 2097a4ad184..939ad2b5547 100644
--- a/mysql-test/suite/encryption/t/innodb-encryption-disable.test
+++ b/mysql-test/suite/encryption/t/innodb-encryption-disable.test
@@ -9,7 +9,7 @@
call mtr.add_suppression("InnoDB: Table `test`\\.`t[15]` (has an unreadable root page|is corrupted)");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[15]\\.ibd' cannot be decrypted\\.");
-call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
+call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t[15].ibd looks corrupted; key_version=1");
call mtr.add_suppression("InnoDB: Table `test`\\.`t[15]` is corrupted");
diff --git a/mysql-test/suite/encryption/t/innodb-missing-key.test b/mysql-test/suite/encryption/t/innodb-missing-key.test
index 7935ea00efa..53fc820a1c9 100644
--- a/mysql-test/suite/encryption/t/innodb-missing-key.test
+++ b/mysql-test/suite/encryption/t/innodb-missing-key.test
@@ -9,7 +9,7 @@
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` has an unreadable root page");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\.");
-call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
+call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file .*test.t[12].ibd looks corrupted; key_version=1");
call mtr.add_suppression("Table .*t1.* is corrupted");
diff --git a/mysql-test/suite/encryption/t/innodb-redo-badkey.test b/mysql-test/suite/encryption/t/innodb-redo-badkey.test
index 5ba4f86ed5c..fba342aad04 100644
--- a/mysql-test/suite/encryption/t/innodb-redo-badkey.test
+++ b/mysql-test/suite/encryption/t/innodb-redo-badkey.test
@@ -11,7 +11,7 @@ call mtr.add_suppression("Plugin 'file_key_management'");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error.");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[1-4]\\.ibd' cannot be decrypted; key_version=1");
call mtr.add_suppression("InnoDB: File '.*test/t[1234]\\.ibd' is corrupted");
-call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
+call mtr.add_suppression("InnoDB: Recovery failed to read page");
call mtr.add_suppression("InnoDB: Unable to decompress .*.test.t[12]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]");
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*test.t[12]\\.ibd'");
call mtr.add_suppression("InnoDB: Failed to read page .* from file '.*'");
diff --git a/mysql-test/suite/engines/funcs/r/rpl_sp.result b/mysql-test/suite/engines/funcs/r/rpl_sp.result
index 71177d6a2f5..00b15c36baa 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_sp.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_sp.result
@@ -771,7 +771,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
SET TIMESTAMP=t/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/galera/r/galera_gra_log.result b/mysql-test/suite/galera/r/galera_gra_log.result
index a6c6b1afa0a..8ac76692262 100644
--- a/mysql-test/suite/galera/r/galera_gra_log.result
+++ b/mysql-test/suite/galera/r/galera_gra_log.result
@@ -18,7 +18,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=<TIMESTAMP>/*!*/;
SET @@session.pseudo_thread_id=<PSEUDO_THREAD_ID>/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/galera/r/galera_log_bin_ext.result b/mysql-test/suite/galera/r/galera_log_bin_ext.result
index f0914954e0a..b110cb4dba3 100644
--- a/mysql-test/suite/galera/r/galera_log_bin_ext.result
+++ b/mysql-test/suite/galera/r/galera_log_bin_ext.result
@@ -59,28 +59,7 @@ COUNT(*) = 2
1
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-hostname1-bin.000001 # Gtid # # GTID #-#-#
-hostname1-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
-hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
-hostname1-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1)
-hostname1-bin.000001 # Table_map # # table_id: # (test.t1)
-hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-hostname1-bin.000001 # Xid # # COMMIT /* XID */
-hostname1-bin.000001 # Gtid # # GTID #-#-#
-hostname1-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
-hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
-hostname1-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
-hostname1-bin.000001 # Table_map # # table_id: # (test.t2)
-hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-hostname1-bin.000001 # Xid # # COMMIT /* XID */
-hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
-hostname1-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
-hostname1-bin.000001 # Table_map # # table_id: # (test.t2)
-hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-hostname1-bin.000001 # Xid # # COMMIT /* XID */
-hostname1-bin.000001 # Gtid # # GTID #-#-#
-hostname1-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
-hostname1-bin.000001 # Rotate # # hostname1-bin.000002;pos=4
+hostname1-bin.000002 # Binlog_checkpoint # # hostname1-bin.000002
DROP TABLE t1;
DROP TABLE t2;
#cleanup
diff --git a/mysql-test/suite/galera/r/galera_log_bin_ext_mariabackup.result b/mysql-test/suite/galera/r/galera_log_bin_ext_mariabackup.result
index f0914954e0a..b110cb4dba3 100644
--- a/mysql-test/suite/galera/r/galera_log_bin_ext_mariabackup.result
+++ b/mysql-test/suite/galera/r/galera_log_bin_ext_mariabackup.result
@@ -59,28 +59,7 @@ COUNT(*) = 2
1
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-hostname1-bin.000001 # Gtid # # GTID #-#-#
-hostname1-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
-hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
-hostname1-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1)
-hostname1-bin.000001 # Table_map # # table_id: # (test.t1)
-hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-hostname1-bin.000001 # Xid # # COMMIT /* XID */
-hostname1-bin.000001 # Gtid # # GTID #-#-#
-hostname1-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
-hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
-hostname1-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
-hostname1-bin.000001 # Table_map # # table_id: # (test.t2)
-hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-hostname1-bin.000001 # Xid # # COMMIT /* XID */
-hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
-hostname1-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
-hostname1-bin.000001 # Table_map # # table_id: # (test.t2)
-hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-hostname1-bin.000001 # Xid # # COMMIT /* XID */
-hostname1-bin.000001 # Gtid # # GTID #-#-#
-hostname1-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
-hostname1-bin.000001 # Rotate # # hostname1-bin.000002;pos=4
+hostname1-bin.000002 # Binlog_checkpoint # # hostname1-bin.000002
DROP TABLE t1;
DROP TABLE t2;
#cleanup
diff --git a/mysql-test/suite/galera/t/galera_log_bin.inc b/mysql-test/suite/galera/t/galera_log_bin.inc
index c86de528a08..4c245846752 100644
--- a/mysql-test/suite/galera/t/galera_log_bin.inc
+++ b/mysql-test/suite/galera/t/galera_log_bin.inc
@@ -34,7 +34,6 @@ ALTER TABLE t1 ADD COLUMN f2 INTEGER;
--connection node_2
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
---let $MASTER_MYPORT=$NODE_MYPORT_2
--source include/show_binlog_events.inc
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_log_bin_sst.inc b/mysql-test/suite/galera/t/galera_log_bin_sst.inc
index a5336f4e3ac..3d20add6d9e 100644
--- a/mysql-test/suite/galera/t/galera_log_bin_sst.inc
+++ b/mysql-test/suite/galera/t/galera_log_bin_sst.inc
@@ -74,7 +74,6 @@ let $restart_noprint=2;
--connection node_2
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
---let $MASTER_MYPORT=$NODE_MYPORT_2
--source include/show_binlog_events.inc
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/change_column_collation.result b/mysql-test/suite/innodb/r/change_column_collation.result
index 54eff706276..b1771b2bd00 100644
--- a/mysql-test/suite/innodb/r/change_column_collation.result
+++ b/mysql-test/suite/innodb/r/change_column_collation.result
@@ -40,9 +40,9 @@ INSERT INTO t1 VALUES (4, 'AAA');
UPDATE t1 set msg = "ddd" where id = 2;
DELETE FROM t1 WHERE id= 3;
SET DEBUG_SYNC = 'now SIGNAL go_ahead';
-SET DEBUG_SYNC = 'RESET';
connection default;
ERROR 23000: Duplicate entry 'NULL' for key 'msg'
+SET DEBUG_SYNC = 'RESET';
SELECT * FROM t1;
id msg
4 AAA
diff --git a/mysql-test/suite/innodb/r/innodb_gis.result b/mysql-test/suite/innodb/r/innodb_gis.result
index c222e7d053a..57f894d85ef 100644
--- a/mysql-test/suite/innodb/r/innodb_gis.result
+++ b/mysql-test/suite/innodb/r/innodb_gis.result
@@ -452,9 +452,9 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
create table t1 (pk integer primary key auto_increment, fl geometry not null);
insert into t1 (fl) values (1);
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 (fl) values (1.11);
-ERROR HY000: Illegal parameter data types geometry and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 (fl) values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (pointfromtext('point(1,1)'));
diff --git a/mysql-test/suite/innodb/r/insert_into_empty.result b/mysql-test/suite/innodb/r/insert_into_empty.result
index 73bda29341e..189dba19cca 100644
--- a/mysql-test/suite/innodb/r/insert_into_empty.result
+++ b/mysql-test/suite/innodb/r/insert_into_empty.result
@@ -296,3 +296,11 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
CREATE TABLE t2(d INT)ENGINE=InnoDB;
DROP TABLE t2, t1;
+#
+# MDEV-28400 Leak in trx_mod_time_t::start_bulk_insert
+#
+SET SESSION foreign_key_checks=0;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB PARTITION BY HASH(a) PARTITIONS 2;
+INSERT INTO t1 VALUES (1),(2);
+ALTER TABLE t1 REBUILD PARTITION p0;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/update_time.result b/mysql-test/suite/innodb/r/update_time.result
index a9c432ce6a8..50f4f88155f 100644
--- a/mysql-test/suite/innodb/r/update_time.result
+++ b/mysql-test/suite/innodb/r/update_time.result
@@ -19,24 +19,9 @@ SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't'
AND TIMESTAMPDIFF(SECOND, update_time, NOW()) < 120;
COUNT(*)
1
-CREATE TEMPORARY TABLE big (a TEXT) ENGINE=INNODB;
-SELECT COUNT(*) FROM information_schema.innodb_buffer_page
-WHERE table_name = '`test`.`t`';
-COUNT(*)
-1
-INSERT INTO big SELECT REPEAT('a', 1024) FROM seq_1_to_10240;
-SELECT COUNT(*) FROM information_schema.innodb_buffer_page
-WHERE table_name = '`test`.`t`';
-COUNT(*)
-0
-SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't'
-AND update_time IS NOT NULL;
-COUNT(*)
-1
-DROP TEMPORARY TABLE big;
# Test the behavior after restart with a prepared XA transaction
XA START 'xatrx';
-INSERT INTO t VALUES (5);
+DELETE FROM t;
XA END 'xatrx';
XA PREPARE 'xatrx';
CONNECT con1,localhost,root,,;
diff --git a/mysql-test/suite/innodb/t/change_column_collation.test b/mysql-test/suite/innodb/t/change_column_collation.test
index 7d82aac7ec2..f63d1974c72 100644
--- a/mysql-test/suite/innodb/t/change_column_collation.test
+++ b/mysql-test/suite/innodb/t/change_column_collation.test
@@ -63,13 +63,13 @@ INSERT INTO t1 VALUES (4, 'AAA');
UPDATE t1 set msg = "ddd" where id = 2;
DELETE FROM t1 WHERE id= 3;
SET DEBUG_SYNC = 'now SIGNAL go_ahead';
-SET DEBUG_SYNC = 'RESET';
connection default;
--error ER_DUP_ENTRY
reap;
+SET DEBUG_SYNC = 'RESET';
SELECT * FROM t1;
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/insert_into_empty.test b/mysql-test/suite/innodb/t/insert_into_empty.test
index 717787e41fa..9762009ecdc 100644
--- a/mysql-test/suite/innodb/t/insert_into_empty.test
+++ b/mysql-test/suite/innodb/t/insert_into_empty.test
@@ -304,3 +304,14 @@ SET SESSION foreign_key_checks=TRUE;
SHOW CREATE TABLE t1;
CREATE TABLE t2(d INT)ENGINE=InnoDB;
DROP TABLE t2, t1;
+
+--echo #
+--echo # MDEV-28400 Leak in trx_mod_time_t::start_bulk_insert
+--echo #
+
+SET SESSION foreign_key_checks=0;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB PARTITION BY HASH(a) PARTITIONS 2;
+INSERT INTO t1 VALUES (1),(2);
+ALTER TABLE t1 REBUILD PARTITION p0;
+# Cleanup
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/update_time.test b/mysql-test/suite/innodb/t/update_time.test
index 35b583b5102..ce8418904c9 100644
--- a/mysql-test/suite/innodb/t/update_time.test
+++ b/mysql-test/suite/innodb/t/update_time.test
@@ -5,12 +5,8 @@
-- echo #
-- source include/have_innodb.inc
--- source include/have_innodb_max_16k.inc
# restart does not work with embedded
-- source include/not_embedded.inc
-# This test is slow on buildbot.
---source include/big_test.inc
---source include/have_sequence.inc
CREATE TABLE t (a INT) ENGINE=INNODB STATS_PERSISTENT=0;
@@ -28,29 +24,10 @@ AND update_time IS NOT NULL;
SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't'
AND TIMESTAMPDIFF(SECOND, update_time, NOW()) < 120;
-CREATE TEMPORARY TABLE big (a TEXT) ENGINE=INNODB;
-
-SELECT COUNT(*) FROM information_schema.innodb_buffer_page
-WHERE table_name = '`test`.`t`';
-
-# evict table 't' by inserting as much data as the BP size itself
-INSERT INTO big SELECT REPEAT('a', 1024) FROM seq_1_to_10240;
-
-# confirm that all pages for table 't' have been evicted
-SELECT COUNT(*) FROM information_schema.innodb_buffer_page
-WHERE table_name = '`test`.`t`';
-
-# The result from this query will change once update_time becomes persistent
-# (WL#6917).
-SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't'
-AND update_time IS NOT NULL;
-
-DROP TEMPORARY TABLE big;
-
-- echo # Test the behavior after restart with a prepared XA transaction
XA START 'xatrx';
-INSERT INTO t VALUES (5);
+DELETE FROM t;
XA END 'xatrx';
XA PREPARE 'xatrx';
diff --git a/mysql-test/suite/innodb_fts/r/ft_result_cache_limit.result b/mysql-test/suite/innodb_fts/r/ft_result_cache_limit.result
new file mode 100644
index 00000000000..2dbdd5a04bc
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/r/ft_result_cache_limit.result
@@ -0,0 +1,39 @@
+#
+# Bug 1634932: Assertion failure in thread x in
+# file fts0que.cc
+#
+SET @saved_innodb_ft_result_cache_limit= @@global.innodb_ft_result_cache_limit;
+CREATE TABLE `t1` (
+`FTS_DOC_ID` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
+`text_content` MEDIUMTEXT, PRIMARY KEY (`FTS_DOC_ID`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+CREATE UNIQUE INDEX FTS_DOC_ID_INDEX ON t1(FTS_DOC_ID);
+SET autocommit=0;
+CREATE PROCEDURE populate_t1()
+BEGIN
+DECLARE i INT DEFAULT 1;
+WHILE (i <= 250) DO
+INSERT INTO t1 (text_content) VALUES ("some_text_1234 aaa");
+SET i = i + 1;
+END WHILE;
+END//
+CALL populate_t1;
+SET autocommit=1;
+SET SESSION debug="+d,fts_instrument_result_cache_limit";
+Warnings:
+Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
+ALTER TABLE t1 ADD FULLTEXT INDEX `text_content_idx` (`text_content`);
+SELECT FTS_DOC_ID, text_content
+FROM t1
+WHERE MATCH text_content AGAINST ('+some_text_1234' IN BOOLEAN MODE);
+ERROR HY000: Table handler out of memory
+UPDATE t1
+SET text_content='some_text_12345'
+where MATCH text_content AGAINST ('+some_text_1234' IN BOOLEAN MODE);
+ERROR HY000: Table handler out of memory
+DELETE FROM t1
+WHERE MATCH text_content AGAINST ('+some_text_1234' IN BOOLEAN MODE);
+ERROR HY000: Table handler out of memory
+SET GLOBAL innodb_ft_result_cache_limit = @saved_innodb_ft_result_cache_limit;
+DROP TABLE t1;
+DROP PROCEDURE populate_t1;
diff --git a/mysql-test/suite/innodb_fts/t/ft_result_cache_limit.test b/mysql-test/suite/innodb_fts/t/ft_result_cache_limit.test
new file mode 100644
index 00000000000..84254a182d7
--- /dev/null
+++ b/mysql-test/suite/innodb_fts/t/ft_result_cache_limit.test
@@ -0,0 +1,57 @@
+--echo #
+--echo # Bug 1634932: Assertion failure in thread x in
+--echo # file fts0que.cc
+--echo #
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+
+SET @saved_innodb_ft_result_cache_limit= @@global.innodb_ft_result_cache_limit;
+
+CREATE TABLE `t1` (
+ `FTS_DOC_ID` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `text_content` MEDIUMTEXT, PRIMARY KEY (`FTS_DOC_ID`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE UNIQUE INDEX FTS_DOC_ID_INDEX ON t1(FTS_DOC_ID);
+
+SET autocommit=0;
+
+DELIMITER //;
+CREATE PROCEDURE populate_t1()
+BEGIN
+ DECLARE i INT DEFAULT 1;
+ WHILE (i <= 250) DO
+ INSERT INTO t1 (text_content) VALUES ("some_text_1234 aaa");
+ SET i = i + 1;
+ END WHILE;
+END//
+
+DELIMITER ;//
+
+CALL populate_t1;
+SET autocommit=1;
+
+SET SESSION debug="+d,fts_instrument_result_cache_limit";
+
+ALTER TABLE t1 ADD FULLTEXT INDEX `text_content_idx` (`text_content`);
+
+# HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT = 188
+--error 128
+SELECT FTS_DOC_ID, text_content
+FROM t1
+WHERE MATCH text_content AGAINST ('+some_text_1234' IN BOOLEAN MODE);
+
+--error 128
+UPDATE t1
+SET text_content='some_text_12345'
+where MATCH text_content AGAINST ('+some_text_1234' IN BOOLEAN MODE);
+
+--error 128
+DELETE FROM t1
+WHERE MATCH text_content AGAINST ('+some_text_1234' IN BOOLEAN MODE);
+
+SET GLOBAL innodb_ft_result_cache_limit = @saved_innodb_ft_result_cache_limit;
+
+DROP TABLE t1;
+DROP PROCEDURE populate_t1;
diff --git a/mysql-test/suite/innodb_gis/r/0.result b/mysql-test/suite/innodb_gis/r/0.result
index 3f72baadd12..355f8958018 100644
--- a/mysql-test/suite/innodb_gis/r/0.result
+++ b/mysql-test/suite/innodb_gis/r/0.result
@@ -452,9 +452,9 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
create table t1 (pk integer primary key auto_increment, fl geometry not null);
insert into t1 (fl) values (1);
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 (fl) values (1.11);
-ERROR HY000: Illegal parameter data types geometry and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 (fl) values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 (fl) values (pointfromtext('point(1,1)'));
diff --git a/mysql-test/suite/innodb_gis/r/1.result b/mysql-test/suite/innodb_gis/r/1.result
index 1c286ff6ce4..1d7b188e0e3 100644
--- a/mysql-test/suite/innodb_gis/r/1.result
+++ b/mysql-test/suite/innodb_gis/r/1.result
@@ -660,9 +660,9 @@ object_id ST_geometrytype(geo) ST_ISSIMPLE(GEO) ST_ASTEXT(ST_centroid(geo))
drop table t1;
create table t1 (fl geometry not null);
insert into t1 values (1);
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 values (1.11);
-ERROR HY000: Illegal parameter data types geometry and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 values (ST_pointfromtext('point(1,1)'));
diff --git a/mysql-test/suite/innodb_gis/r/gis.result b/mysql-test/suite/innodb_gis/r/gis.result
index a976bbccaa9..0aa379df487 100644
--- a/mysql-test/suite/innodb_gis/r/gis.result
+++ b/mysql-test/suite/innodb_gis/r/gis.result
@@ -661,9 +661,9 @@ object_id ST_geometrytype(geo) ST_ISSIMPLE(GEO) ST_ASTEXT(ST_centroid(geo))
drop table t1;
create table t1 (fl geometry not null);
insert into t1 values (1);
-ERROR HY000: Illegal parameter data types geometry and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 values (1.11);
-ERROR HY000: Illegal parameter data types geometry and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'geometry' in assignment of `test`.`t1`.`fl`
insert into t1 values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 values (ST_pointfromtext('point(1,1)'));
diff --git a/mysql-test/suite/mariabackup/mdev-14447.result b/mysql-test/suite/mariabackup/mdev-14447.result
index 8f7a1a8708b..16d3ab561f6 100644
--- a/mysql-test/suite/mariabackup/mdev-14447.result
+++ b/mysql-test/suite/mariabackup/mdev-14447.result
@@ -1,6 +1,8 @@
call mtr.add_suppression("InnoDB: New log files created");
+SET GLOBAL innodb_file_per_table=0;
CREATE TABLE t(a varchar(40) PRIMARY KEY, b varchar(40), c varchar(40), d varchar(40), index(b,c,d)) ENGINE INNODB;
# Create full backup , modify table, then create incremental/differential backup
+SET debug_dbug='+d,skip_page_checksum',foreign_key_checks=0,unique_checks=0;
BEGIN;
INSERT INTO t select uuid(), uuid(), uuid(), uuid() from seq_1_to_100000;
COMMIT;
diff --git a/mysql-test/suite/mariabackup/mdev-14447.test b/mysql-test/suite/mariabackup/mdev-14447.test
index b6998976e8c..79a0d075897 100644
--- a/mysql-test/suite/mariabackup/mdev-14447.test
+++ b/mysql-test/suite/mariabackup/mdev-14447.test
@@ -6,6 +6,7 @@ call mtr.add_suppression("InnoDB: New log files created");
let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
+SET GLOBAL innodb_file_per_table=0;
CREATE TABLE t(a varchar(40) PRIMARY KEY, b varchar(40), c varchar(40), d varchar(40), index(b,c,d)) ENGINE INNODB;
echo # Create full backup , modify table, then create incremental/differential backup;
@@ -13,6 +14,7 @@ echo # Create full backup , modify table, then create incremental/differential b
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
--enable_result_log
+SET debug_dbug='+d,skip_page_checksum',foreign_key_checks=0,unique_checks=0;
BEGIN;
INSERT INTO t select uuid(), uuid(), uuid(), uuid() from seq_1_to_100000;
COMMIT;
diff --git a/mysql-test/suite/perfschema/disabled.def b/mysql-test/suite/perfschema/disabled.def
index fb97b011567..935548fce76 100644
--- a/mysql-test/suite/perfschema/disabled.def
+++ b/mysql-test/suite/perfschema/disabled.def
@@ -53,3 +53,13 @@ show_misc: todo
show_plugin: todo
status_reprepare:why P_S filters out Com_* variables?
+
+processlist: todo
+processlist_acl: todo
+processlist_port: todo
+processlist_no_pfs: todo
+ddl_processlist: todo
+dml_processlist: todo
+processlist_57: todo
+processlist_anonymous: todo
+processlist_reg_user: todo
diff --git a/mysql-test/suite/perfschema/include/processlist_load.inc b/mysql-test/suite/perfschema/include/processlist_load.inc
new file mode 100644
index 00000000000..5a14ea17d07
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/processlist_load.inc
@@ -0,0 +1,39 @@
+# ../include/processlist_load.inc
+#
+# SUMMARY
+#
+# Execute PROCESSLIST queries, sorted by user
+#
+# USAGE
+#
+# Example: Using processlist_set.inc to set @@global.performance_schema_show_processlist
+#
+# let $pfs_spl = on/off
+# --source ../include/processlist_set.inc
+# --source ../include/processlist_load.inc
+#
+# Columns
+# 1 <Id> 2 <User> 3 <Host> 4 <db> 5 <Command> 6 <Time> 7 <State> 8 <Info>
+
+# Sort SHOW PROCESSLIST by User instead of Id because Id is not zero-padded
+# Unique usernames give best results
+--echo
+--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
+--replace_regex /Daemon/<Command>/ /Connect/<Command>/ /Sleep/<Command>/
+--sorted_result
+SHOW FULL PROCESSLIST;
+
+--echo
+--echo # Performance Schema processlist table
+--echo
+--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
+--replace_regex /Daemon/<Command>/ /Connect/<Command>/ /Sleep/<Command>/
+select * from performance_schema.processlist order by user, id;
+
+--echo
+--echo # Information Schema processlist table
+--echo
+--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
+--replace_regex /Daemon/<Command>/ /Connect/<Command>/ /Sleep/<Command>/
+select * from information_schema.processlist order by user, id;
+
diff --git a/mysql-test/suite/perfschema/include/processlist_set.inc b/mysql-test/suite/perfschema/include/processlist_set.inc
new file mode 100644
index 00000000000..a15e09fd989
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/processlist_set.inc
@@ -0,0 +1,17 @@
+# ../include/processlist_set.inc
+#
+# SUMMARY
+#
+# Set the value of performance_schema_show_proceslist then
+# wait for the operation to complete
+#
+# USAGE
+#
+# let $pfs_spl = on;
+# --source ../include/processlist_set.inc
+
+eval set @@global.performance_schema_show_processlist = $pfs_spl;
+
+let $wait_condition = show variables where variable_name like '%show_processlist%' and value = '$pfs_spl';
+--source include/wait_condition.inc
+
diff --git a/mysql-test/suite/perfschema/r/ddl_processlist.result b/mysql-test/suite/perfschema/r/ddl_processlist.result
new file mode 100644
index 00000000000..3b1b8608725
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/ddl_processlist.result
@@ -0,0 +1,20 @@
+select @@global.performance_schema_show_processlist into @save_processlist;
+set @@global.performance_schema_show_processlist = 'on';
+alter table performance_schema.processlist
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.processlist;
+ERROR HY000: Invalid performance_schema usage.
+alter table performance_schema.processlist
+add index test_index(info);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+create unique index test_index
+on performance_schema.processlist(host);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+drop index `PRIMARY`
+ on performance_schema.processlist;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE TABLE test.create_select
+AS SELECT * from performance_schema.processlist;
+DROP TABLE test.create_select;
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/r/dml_processlist.result b/mysql-test/suite/perfschema/r/dml_processlist.result
new file mode 100644
index 00000000000..f3627807a49
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/dml_processlist.result
@@ -0,0 +1,24 @@
+select @@global.performance_schema_show_processlist into @save_processlist;
+set @@global.performance_schema_show_processlist = 'on';
+select * from performance_schema.processlist
+where user like 'event_scheduler';
+select * from performance_schema.processlist
+where user = 'FOO';
+insert into performance_schema.processlist
+values (12, 'foo', 'bar', 'test', null, 1000, 'state', 'info');
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'processlist'
+update performance_schema.processlist
+set id=12, user='foo';
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'processlist'
+delete from performance_schema.processlist
+where id <> 99;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'processlist'
+delete from performance_schema.processlist;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'processlist'
+LOCK TABLES performance_schema.processlist READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'processlist'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.processlist WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'processlist'
+UNLOCK TABLES;
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/r/misc_global_status.result b/mysql-test/suite/perfschema/r/misc_global_status.result
new file mode 100644
index 00000000000..1863dde6103
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/misc_global_status.result
@@ -0,0 +1,106 @@
+CREATE USER user1@localhost;
+CREATE USER user2@localhost;
+CREATE USER user3@localhost;
+grant ALL on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+TRUNCATE TABLE performance_schema.accounts;
+FLUSH PRIVILEGES;
+CREATE TABLE test.t_range(a int, b int, PRIMARY KEY(a));
+INSERT INTO test.t_range values (1, 1), (2,2), (3, 3), (4, 4), (5, 5);
+INSERT INTO test.t_range values (6, 6), (7,7), (8, 8), (9, 9), (10, 10);
+FLUSH STATUS;
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+a b
+3 3
+4 4
+5 5
+SELECT * from performance_schema.session_status
+WHERE VARIABLE_NAME = 'Select_range';
+VARIABLE_NAME VARIABLE_VALUE
+Select_range 1
+VARIABLE_NAME DELTA
+Select_range 1
+connect con1, localhost, user1,,;
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+a b
+3 3
+4 4
+5 5
+SELECT * from performance_schema.session_status
+WHERE VARIABLE_NAME = 'Select_range';
+VARIABLE_NAME VARIABLE_VALUE
+Select_range 1
+VARIABLE_NAME DELTA
+Select_range 2
+connect con2, localhost, user2,,;
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+a b
+3 3
+4 4
+5 5
+SELECT * from test.t_range where (a >= 4) AND (a <= 6);
+a b
+4 4
+5 5
+6 6
+SELECT * from performance_schema.session_status
+WHERE VARIABLE_NAME = 'Select_range';
+VARIABLE_NAME VARIABLE_VALUE
+Select_range 2
+VARIABLE_NAME DELTA
+Select_range 4
+connect con3, localhost, user3,,;
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+a b
+3 3
+4 4
+5 5
+SELECT * from test.t_range where (a >= 4) AND (a <= 6);
+a b
+4 4
+5 5
+6 6
+SELECT * from test.t_range where (a >= 5) AND (a <= 7);
+a b
+5 5
+6 6
+7 7
+SELECT * from performance_schema.session_status
+WHERE VARIABLE_NAME = 'Select_range';
+VARIABLE_NAME VARIABLE_VALUE
+Select_range 3
+VARIABLE_NAME DELTA
+Select_range 7
+connection default;
+VARIABLE_NAME DELTA
+Select_range 7
+SELECT `USER`, `HOST`, VARIABLE_NAME, VARIABLE_VALUE
+FROM performance_schema.status_by_account WHERE VARIABLE_NAME = 'Select_range'
+ AND `USER` LIKE 'user%'
+ ORDER BY `USER`;
+USER HOST VARIABLE_NAME VARIABLE_VALUE
+user1 localhost Select_range 1
+user2 localhost Select_range 2
+user3 localhost Select_range 3
+disconnect con1;
+disconnect con2;
+VARIABLE_NAME DELTA
+Select_range 7
+TRUNCATE TABLE performance_schema.accounts;
+VARIABLE_NAME DELTA
+Select_range 7
+disconnect con3;
+VARIABLE_NAME DELTA
+Select_range 7
+TRUNCATE TABLE performance_schema.accounts;
+VARIABLE_NAME DELTA
+Select_range 7
+DROP TABLE test.t_range;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM user2@localhost;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM user3@localhost;
+DROP USER user1@localhost;
+DROP USER user2@localhost;
+DROP USER user3@localhost;
+FLUSH PRIVILEGES;
diff --git a/mysql-test/suite/perfschema/r/processlist.result b/mysql-test/suite/perfschema/r/processlist.result
new file mode 100644
index 00000000000..40c5a0f04a8
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/processlist.result
@@ -0,0 +1,201 @@
+##
+## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+##
+## Test cases:
+## 1. Execute the new SHOW [FULL] PROCESSLIST and SELECT on performance_schema.processlist
+## 2. Execute the legacy SHOW [FULL] PROCESSLIST and SELECT on information_schema.processlist
+## 3. Verify that performance_schema_show_processlist = ON executes the new implementation
+## 4. Verify that performance_schema_show_processlist = OFF executes the legacy code path
+##
+## Results must be manually verified.
+
+### Setup ###
+
+select @@global.performance_schema_show_processlist into @save_processlist;
+
+create user user1@localhost, user2@localhost,
+user3@localhost, user4@localhost;
+
+grant ALL on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+grant ALL on *.* to user4@localhost;
+
+flush privileges;
+
+use test;
+create table test.t1 (s1 int, s2 int, s3 int, s4 int);
+
+# Switch to (con0, localhost, root, , )
+
+insert into test.t1 values(1, 1, 1, 1);
+insert into test.t1 values(2, 2, 2, 2);
+insert into test.t1 values(3, 3, 3, 3);
+insert into test.t1 values(4, 4, 4, 4);
+
+# Lock test.t1, insert/update/deletes will block
+lock tables t1 read;
+
+# Connect (con1, localhost, user1, , )
+insert into test.t1 values (0, 0, 0, 0);
+
+# Connect (con2, localhost, user2, , )
+update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999;;
+
+# Connect (con3, localhost, user3, , )
+delete from test.t1 where s1 = 3;
+
+# Connect (con4, localhost, user4, , )
+insert into test.t1 values (4, 4, 4, 4);
+
+# Connection default
+
+# Wait for queries to appear in the processlist table
+
+
+### Execute new SHOW [FULL] PROCESSLIST and SELECT on performance_schema.processlist
+
+set @@global.performance_schema_show_processlist = on;
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> root <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user1 <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user2 <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999
+<Id> user3 <Host> test Query <Time> <State> delete from test.t1 where s1 = 3
+<Id> user4 <Host> test Query <Time> <State> insert into test.t1 values (4, 4, 4, 4)
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user1 <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user2 <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999
+<Id> user3 <Host> test Query <Time> <State> delete from test.t1 where s1 = 3
+<Id> user4 <Host> test Query <Time> <State> insert into test.t1 values (4, 4, 4, 4)
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user1 <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user2 <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999
+<Id> user3 <Host> test Query <Time> <State> delete from test.t1 where s1 = 3
+<Id> user4 <Host> test Query <Time> <State> insert into test.t1 values (4, 4, 4, 4)
+
+
+### Execute legacy SHOW [FULL] PROCESSLIST and SELECT on information_schema.processlist
+
+set @@global.performance_schema_show_processlist = off;
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> root <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user1 <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user2 <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999
+<Id> user3 <Host> test Query <Time> <State> delete from test.t1 where s1 = 3
+<Id> user4 <Host> test Query <Time> <State> insert into test.t1 values (4, 4, 4, 4)
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user1 <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user2 <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999
+<Id> user3 <Host> test Query <Time> <State> delete from test.t1 where s1 = 3
+<Id> user4 <Host> test Query <Time> <State> insert into test.t1 values (4, 4, 4, 4)
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user1 <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user2 <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999
+<Id> user3 <Host> test Query <Time> <State> delete from test.t1 where s1 = 3
+<Id> user4 <Host> test Query <Time> <State> insert into test.t1 values (4, 4, 4, 4)
+
+
+### Verify feature code path
+
+# Enable SHOW PROCESSLIST via the Performance Schema
+set @@global.performance_schema_show_processlist = on;
+
+# Connection default, send SHOW PROCESSLIST
+SET DEBUG_SYNC='pfs_show_processlist_performance_schema SIGNAL pfs_processlist_pfs WAIT_FOR continue';
+SHOW FULL PROCESSLIST;
+
+# Connection con0
+SET DEBUG_SYNC='now WAIT_FOR pfs_processlist_pfs';
+SET DEBUG_SYNC='now SIGNAL continue';
+
+# Connection default, reap
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> <Info>
+<Id> root <Host> test <Command> <Time> <State> <Info>
+<Id> root <Host> test <Command> <Time> <State> <Info>
+<Id> user1 <Host> test <Command> <Time> <State> <Info>
+<Id> user2 <Host> test <Command> <Time> <State> <Info>
+<Id> user3 <Host> test <Command> <Time> <State> <Info>
+<Id> user4 <Host> test <Command> <Time> <State> <Info>
+
+
+### Verify legacy code path
+
+# Enable the legacy SHOW PROCESSLIST
+set @@global.performance_schema_show_processlist = off;
+
+# Connection default, send SHOW PROCESSLIST
+SET DEBUG_SYNC='RESET';
+SET DEBUG_SYNC='pfs_show_processlist_legacy SIGNAL pfs_processlist_legacy WAIT_FOR continue';
+SHOW FULL PROCESSLIST;
+
+# Connection con0
+SET DEBUG_SYNC='now WAIT_FOR pfs_processlist_legacy';
+SET DEBUG_SYNC='now SIGNAL continue';
+
+# Connection default, reap
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> <Info>
+<Id> root <Host> test <Command> <Time> <State> <Info>
+<Id> root <Host> test <Command> <Time> <State> <Info>
+<Id> user1 <Host> test <Command> <Time> <State> <Info>
+<Id> user2 <Host> test <Command> <Time> <State> <Info>
+<Id> user3 <Host> test <Command> <Time> <State> <Info>
+<Id> user4 <Host> test <Command> <Time> <State> <Info>
+
+
+### Clean up ###
+
+# Connection con0, unlock test.t1, disconnect
+unlock tables;
+
+# Connection con1, reap, disconnect
+# Connection con2, reap, disconnect
+# Connection con3, reap, disconnect
+# Connection con4, reap, disconnect
+
+# Connection default
+
+drop table test.t1;
+drop user user1@localhost;
+drop user user2@localhost;
+drop user user3@localhost;
+drop user user4@localhost;
+
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/r/processlist_57.result b/mysql-test/suite/perfschema/r/processlist_57.result
new file mode 100644
index 00000000000..0068eb6c3cd
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/processlist_57.result
@@ -0,0 +1,345 @@
+call mtr.add_suppression("Optional native table 'performance_schema'.'processlist' has the wrong structure or is missing.");
+call mtr.add_suppression("Column count of performance_schema.processlist is wrong. Expected 8, found 2. The table is probably corrupted");
+##
+## Verify fresh 5.7 instance
+##
+SELECT @@global.performance_schema_show_processlist;
+@@global.performance_schema_show_processlist
+0
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `ID` bigint(20) unsigned NOT NULL,
+ `USER` varchar(32) DEFAULT NULL,
+ `HOST` varchar(66) DEFAULT NULL,
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) DEFAULT NULL,
+ `TIME` bigint(20) DEFAULT NULL,
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+##
+## Simulate old 5.7 instance
+##
+DROP TABLE performance_schema.processlist;
+SHOW CREATE TABLE performance_schema.processlist;
+ERROR 42S02: Table 'performance_schema.processlist' doesn't exist
+##
+## Server shutdown
+##
+##
+### Server restart
+##
+##
+## Verify old 5.7 instance
+##
+SELECT @@global.performance_schema_show_processlist;
+@@global.performance_schema_show_processlist
+0
+SHOW CREATE TABLE performance_schema.processlist;
+ERROR 42S02: Table 'performance_schema.processlist' doesn't exist
+SELECT * FROM performance_schema.processlist;
+ERROR 42S02: Table 'performance_schema.processlist' doesn't exist
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+ERROR 42S02: Table 'performance_schema.processlist' doesn't exist
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+ERROR 42S02: Table 'performance_schema.processlist' doesn't exist
+##
+## Perform broken upgrade (case 1)
+##
+CREATE TABLE performance_schema.processlist (a int, b int);
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+a b
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+a b
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+ERROR 42S22: Unknown column 'ID' in 'field list'
+##
+## Server shutdown
+##
+##
+### Server restart
+##
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+a b
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+a b
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+ERROR 42S22: Unknown column 'ID' in 'field list'
+##
+## Perform broken upgrade (case 2)
+##
+DROP TABLE performance_schema.processlist;
+CREATE TABLE performance_schema.processlist (
+`ID` bigint(20) unsigned NOT NULL,
+`USER` varchar(32) DEFAULT NULL,
+`HOST` varchar(66) DEFAULT NULL,
+`DB` varchar(64) DEFAULT NULL,
+`COMMAND` varchar(16) DEFAULT NULL,
+`TIME` bigint(20) DEFAULT NULL,
+`STATE` varchar(64) DEFAULT NULL,
+`INFO` longtext
+);
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `ID` bigint(20) unsigned NOT NULL,
+ `USER` varchar(32) DEFAULT NULL,
+ `HOST` varchar(66) DEFAULT NULL,
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) DEFAULT NULL,
+ `TIME` bigint(20) DEFAULT NULL,
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+##
+## Server shutdown
+##
+##
+### Server restart
+##
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `ID` bigint(20) unsigned NOT NULL,
+ `USER` varchar(32) DEFAULT NULL,
+ `HOST` varchar(66) DEFAULT NULL,
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) DEFAULT NULL,
+ `TIME` bigint(20) DEFAULT NULL,
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+##
+## Perform broken upgrade (case 3)
+##
+DROP TABLE performance_schema.processlist;
+CREATE TABLE performance_schema.processlist
+LIKE INFORMATION_SCHEMA.PROCESSLIST;
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `ID` bigint(21) unsigned NOT NULL DEFAULT '0',
+ `USER` varchar(32) NOT NULL DEFAULT '',
+ `HOST` varchar(64) NOT NULL DEFAULT '',
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) NOT NULL DEFAULT '',
+ `TIME` int(7) NOT NULL DEFAULT '0',
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+##
+## Server shutdown
+##
+##
+### Server restart
+##
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `ID` bigint(21) unsigned NOT NULL DEFAULT '0',
+ `USER` varchar(32) NOT NULL DEFAULT '',
+ `HOST` varchar(64) NOT NULL DEFAULT '',
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) NOT NULL DEFAULT '',
+ `TIME` int(7) NOT NULL DEFAULT '0',
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+##
+## Perform correct upgrade
+##
+DROP TABLE performance_schema.processlist;
+CREATE TABLE performance_schema.processlist (
+`ID` bigint(20) unsigned NOT NULL,
+`USER` varchar(32) DEFAULT NULL,
+`HOST` varchar(66) DEFAULT NULL,
+`DB` varchar(64) DEFAULT NULL,
+`COMMAND` varchar(16) DEFAULT NULL,
+`TIME` bigint(20) DEFAULT NULL,
+`STATE` varchar(64) DEFAULT NULL,
+`INFO` longtext
+) ENGINE = 'PERFORMANCE_SCHEMA';
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `ID` bigint(20) unsigned NOT NULL,
+ `USER` varchar(32) DEFAULT NULL,
+ `HOST` varchar(66) DEFAULT NULL,
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) DEFAULT NULL,
+ `TIME` bigint(20) DEFAULT NULL,
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] Sending data SELECT * FROM performance_schema.processlist
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] Sending data SELECT * FROM performance_schema.processlist
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] Sending data SHOW PROCESSLIST
+##
+## Server shutdown
+##
+##
+### Server restart
+##
+SHOW CREATE TABLE performance_schema.processlist;
+Table Create Table
+processlist CREATE TABLE `processlist` (
+ `ID` bigint(20) unsigned NOT NULL,
+ `USER` varchar(32) DEFAULT NULL,
+ `HOST` varchar(66) DEFAULT NULL,
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) DEFAULT NULL,
+ `TIME` bigint(20) DEFAULT NULL,
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] Sending data SELECT * FROM performance_schema.processlist
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] starting SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'ON';
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] Sending data SELECT * FROM performance_schema.processlist
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+2 root [HOST:PORT] test Query [TIME] executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+2 root [HOST:PORT] test Query [TIME] Sending data SHOW PROCESSLIST
+SET GLOBAL performance_schema_show_processlist = 'OFF';
diff --git a/mysql-test/suite/perfschema/r/processlist_acl.result b/mysql-test/suite/perfschema/r/processlist_acl.result
new file mode 100644
index 00000000000..2e60b403484
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/processlist_acl.result
@@ -0,0 +1,255 @@
+##
+## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+##
+## Verify handling of the SELECT and PROCESS privileges.
+##
+## Test cases:
+## - Execute SHOW PROCESSLIST (new and legacy) with all privileges
+## - Execute SELECT on the performance_schema.processlist and information_schema.processlist with all privileges
+## - Execute SHOW PROCESSLIST (new and legacy) with no privileges
+## - Execute SELECT on the performance_schema.processlist and information_schema.processlist with no privileges
+##
+## Results must be manually verified.
+
+### Setup ###
+
+select @@global.performance_schema_show_processlist into @save_processlist;
+
+# Control users
+create user user_00@localhost, user_01@localhost;
+grant ALL on *.* to user_00@localhost;
+grant ALL on *.* to user_01@localhost;
+
+# Test users
+create user user_all@localhost, user_none@localhost;
+grant ALL on *.* to user_all@localhost;
+grant USAGE on *.* to user_none@localhost;
+
+flush privileges;
+
+show grants for user_all@localhost;
+Grants for user_all@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'user_all'@'localhost'
+
+show grants for user_none@localhost;
+Grants for user_none@localhost
+GRANT USAGE ON *.* TO 'user_none'@'localhost'
+
+use test;
+create table test.t1 (s1 int, s2 int, s3 int, s4 int);
+
+# Connect (con_00, localhost, user_00, , )
+# Connect (con_01, localhost, user_01, , )
+
+insert into test.t1 values(1, 1, 1, 1);
+insert into test.t1 values(2, 2, 2, 2);
+insert into test.t1 values(3, 3, 3, 3);
+insert into test.t1 values(4, 4, 4, 4);
+
+# Lock test.t1, insert/update/deletes will block
+lock tables t1 read;
+
+# Establish 2 connections for user_all
+# Connect (con_all_1, localhost, user_all, , )
+# Connect (con_all_2, localhost, user_all, , )
+insert into test.t1 values (0, 0, 0, 0);
+
+# Establish 4 connections for user_none
+# Connect (con_none_1, localhost, user_none, , )
+# Connect (con_none_2, localhost, user_none, , )
+# Connect (con_none_3, localhost, user_none, , )
+# Connect (con_none_4, localhost, user_none, , )
+update test.t1 set s1 = s1 + 1, s2 = s2 + 2;;
+
+# Connection con_all_1
+
+# Wait for queries to appear in the processlist table
+
+### Execute SHOW PROCESSLIST with all privileges
+### Expect all users
+
+# New SHOW PROCESSLIST
+set @@global.performance_schema_show_processlist = on;
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user_00 <Host> test <Command> <Time> <State> NULL
+<Id> user_01 <Host> test <Command> <Time> <State> NULL
+<Id> user_all <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user_all <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user_00 <Host> test <Command> <Time> <State> NULL
+<Id> user_01 <Host> test <Command> <Time> <State> NULL
+<Id> user_all <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> user_all <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user_00 <Host> test <Command> <Time> <State> NULL
+<Id> user_01 <Host> test <Command> <Time> <State> NULL
+<Id> user_all <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> user_all <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Legacy SHOW PROCESSLIST
+set @@global.performance_schema_show_processlist = off;
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user_00 <Host> test <Command> <Time> <State> NULL
+<Id> user_01 <Host> test <Command> <Time> <State> NULL
+<Id> user_all <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user_all <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user_00 <Host> test <Command> <Time> <State> NULL
+<Id> user_01 <Host> test <Command> <Time> <State> NULL
+<Id> user_all <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> user_all <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user_00 <Host> test <Command> <Time> <State> NULL
+<Id> user_01 <Host> test <Command> <Time> <State> NULL
+<Id> user_all <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> user_all <Host> test Query <Time> <State> insert into test.t1 values (0, 0, 0, 0)
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+
+### Execute SHOW PROCESSLIST with no SELECT and no PROCESS privileges
+### Expect processes only from user_none
+
+# New SHOW PROCESSLIST
+set @@global.performance_schema_show_processlist = on;
+
+# Connection con_none_1
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> user_none <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> user_none <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Confirm that only processes from user_none are visible
+
+select count(*) as "Expect 0" from performance_schema.processlist
+where user not in ('user_none');
+Expect 0
+0
+
+# Legacy SHOW PROCESSLIST
+set @@global.performance_schema_show_processlist = off;
+
+# Connection con_none_1
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> user_none <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> user_none <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test <Command> <Time> <State> NULL
+<Id> user_none <Host> test Query <Time> <State> update test.t1 set s1 = s1 + 1, s2 = s2 + 2
+
+
+### Clean up ###
+
+# Disconnect con_00
+# Connection con_01, unlock test.t1, disconnect
+unlock tables;
+# Disconnect con_all_1
+# Reap con_all_2, disconnect
+# Disconnect con_none_1
+# Disconnect con_none_2
+# Disconnect con_none_3
+# Reap con_none_4, disconnect
+
+# Connection default
+
+drop table test.t1;
+drop user user_00@localhost;
+drop user user_01@localhost;
+drop user user_all@localhost;
+drop user user_none@localhost;
+
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/r/processlist_anonymous.result b/mysql-test/suite/perfschema/r/processlist_anonymous.result
new file mode 100644
index 00000000000..a27a6df2606
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/processlist_anonymous.result
@@ -0,0 +1,66 @@
+##
+## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+## Verify behavior for anonymous users and PROCESS_ACL.
+##
+SELECT @@global.performance_schema_show_processlist INTO @save_processlist;
+SET @@global.performance_schema_show_processlist = OFF;
+SHOW GRANTS;
+Grants for @localhost
+GRANT USAGE ON *.* TO ''@'localhost'
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SHOW PROCESSLIST;
+ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
+SET @@global.performance_schema_show_processlist = ON;
+SHOW GRANTS;
+Grants for @localhost
+GRANT USAGE ON *.* TO ''@'localhost'
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+ID USER HOST DB COMMAND TIME STATE INFO
+SELECT * FROM performance_schema.processlist;
+ID USER HOST DB COMMAND TIME STATE INFO
+SHOW PROCESSLIST;
+ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
+GRANT PROCESS ON *.* TO ''@'localhost';
+SET @@global.performance_schema_show_processlist = OFF;
+SHOW GRANTS;
+Grants for @localhost
+GRANT PROCESS ON *.* TO ''@'localhost'
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+count(*) >= 2
+1
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+count(*) >= 2
+1
+SHOW PROCESSLIST;
+SELECT "Previous statement is now completed." as status;
+status
+Previous statement is now completed.
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT as BROKEN_ROWS_SENT
+FROM performance_schema.events_statements_history
+WHERE SQL_TEXT = "SHOW PROCESSLIST";
+EVENT_NAME SQL_TEXT BROKEN_ROWS_SENT
+statement/sql/show_processlist SHOW PROCESSLIST 0
+TRUNCATE TABLE performance_schema.events_statements_history;
+set @@global.performance_schema_show_processlist = ON;
+SHOW GRANTS;
+Grants for @localhost
+GRANT PROCESS ON *.* TO ''@'localhost'
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+count(*) >= 2
+1
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+count(*) >= 2
+1
+SHOW PROCESSLIST;
+SELECT "Previous statement is now completed." as status;
+status
+Previous statement is now completed.
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT >= 2
+FROM performance_schema.events_statements_history
+WHERE SQL_TEXT = "SHOW PROCESSLIST";
+EVENT_NAME SQL_TEXT ROWS_SENT >= 2
+statement/sql/show_processlist SHOW PROCESSLIST 1
+SET @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/r/processlist_no_pfs.result b/mysql-test/suite/perfschema/r/processlist_no_pfs.result
new file mode 100644
index 00000000000..16e5a13b52a
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/processlist_no_pfs.result
@@ -0,0 +1,181 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+sys
+test
+select count(*) from performance_schema.performance_timers;
+count(*)
+0
+select count(*) from performance_schema.setup_consumers;
+count(*)
+0
+select count(*) > 4 from performance_schema.setup_instruments;
+count(*) > 4
+0
+select count(*) from performance_schema.setup_timers;
+count(*)
+0
+Warnings:
+Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release.
+select * from performance_schema.accounts;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_stages_current;
+select * from performance_schema.events_stages_history;
+select * from performance_schema.events_stages_history_long;
+select * from performance_schema.events_stages_summary_by_account_by_event_name;
+select * from performance_schema.events_stages_summary_by_host_by_event_name;
+select * from performance_schema.events_stages_summary_by_thread_by_event_name;
+select * from performance_schema.events_stages_summary_by_user_by_event_name;
+select * from performance_schema.events_stages_summary_global_by_event_name;
+select * from performance_schema.events_statements_current;
+select * from performance_schema.events_statements_history;
+select * from performance_schema.events_statements_history_long;
+select * from performance_schema.events_statements_summary_by_account_by_event_name;
+select * from performance_schema.events_statements_summary_by_digest;
+select * from performance_schema.events_statements_summary_by_host_by_event_name;
+select * from performance_schema.events_statements_summary_by_thread_by_event_name;
+select * from performance_schema.events_statements_summary_by_user_by_event_name;
+select * from performance_schema.events_statements_summary_global_by_event_name;
+select * from performance_schema.events_transactions_current;
+select * from performance_schema.events_transactions_history;
+select * from performance_schema.events_transactions_history_long;
+select * from performance_schema.events_transactions_summary_by_account_by_event_name;
+select * from performance_schema.events_transactions_summary_by_host_by_event_name;
+select * from performance_schema.events_transactions_summary_by_thread_by_event_name;
+select * from performance_schema.events_transactions_summary_by_user_by_event_name;
+select * from performance_schema.events_transactions_summary_global_by_event_name;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_account_by_event_name;
+select * from performance_schema.events_waits_summary_by_host_by_event_name;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_by_user_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.memory_summary_by_account_by_event_name;
+select * from performance_schema.memory_summary_by_host_by_event_name;
+select * from performance_schema.memory_summary_by_thread_by_event_name;
+select * from performance_schema.memory_summary_by_user_by_event_name;
+select * from performance_schema.memory_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.host_cache;
+select * from performance_schema.hosts;
+select * from performance_schema.memory_summary_by_account_by_event_name;
+select * from performance_schema.memory_summary_by_host_by_event_name;
+select * from performance_schema.memory_summary_by_thread_by_event_name;
+select * from performance_schema.memory_summary_by_user_by_event_name;
+select * from performance_schema.memory_summary_global_by_event_name;
+select * from performance_schema.metadata_locks;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.objects_summary_global_by_type;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.session_account_connect_attrs;
+select * from performance_schema.session_connect_attrs;
+select * from performance_schema.setup_actors;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_objects;
+select * from performance_schema.setup_timers;
+select * from performance_schema.socket_instances;
+select * from performance_schema.socket_summary_by_instance;
+select * from performance_schema.socket_summary_by_event_name;
+select * from performance_schema.table_handles;
+select * from performance_schema.table_io_waits_summary_by_index_usage;
+select * from performance_schema.table_io_waits_summary_by_table;
+select * from performance_schema.table_lock_waits_summary_by_table;
+select * from performance_schema.threads;
+select * from performance_schema.users;
+select * from performance_schema.replication_connection_configuration;
+select * from performance_schema.replication_connection_status;
+select * from performance_schema.replication_applier_configuration;
+select * from performance_schema.replication_applier_status;
+select * from performance_schema.replication_applier_status_by_coordinator;
+select * from performance_schema.replication_applier_status_by_worker;
+select * from performance_schema.global_status;
+select * from performance_schema.status_by_thread;
+select * from performance_schema.status_by_user;
+select * from performance_schema.status_by_host;
+select * from performance_schema.status_by_account;
+select * from performance_schema.session_status;
+select * from performance_schema.global_variables;
+select * from performance_schema.variables_by_thread;
+select * from performance_schema.session_variables;
+show global variables like "performance_schema%";
+Variable_name Value
+performance_schema OFF
+performance_schema_accounts_size 0
+performance_schema_digests_size 0
+performance_schema_events_stages_history_long_size 0
+performance_schema_events_stages_history_size 0
+performance_schema_events_statements_history_long_size 0
+performance_schema_events_statements_history_size 0
+performance_schema_events_transactions_history_long_size 0
+performance_schema_events_transactions_history_size 0
+performance_schema_events_waits_history_long_size 0
+performance_schema_events_waits_history_size 0
+performance_schema_hosts_size 0
+performance_schema_max_cond_classes 0
+performance_schema_max_cond_instances 0
+performance_schema_max_digest_length 0
+performance_schema_max_file_classes 0
+performance_schema_max_file_handles 0
+performance_schema_max_file_instances 0
+performance_schema_max_index_stat 0
+performance_schema_max_memory_classes 0
+performance_schema_max_metadata_locks 0
+performance_schema_max_mutex_classes 0
+performance_schema_max_mutex_instances 0
+performance_schema_max_prepared_statements_instances 0
+performance_schema_max_program_instances 0
+performance_schema_max_rwlock_classes 0
+performance_schema_max_rwlock_instances 0
+performance_schema_max_socket_classes 0
+performance_schema_max_socket_instances 0
+performance_schema_max_sql_text_length 0
+performance_schema_max_stage_classes 0
+performance_schema_max_statement_classes 0
+performance_schema_max_statement_stack 0
+performance_schema_max_table_handles 0
+performance_schema_max_table_instances 0
+performance_schema_max_table_lock_stat 0
+performance_schema_max_thread_classes 0
+performance_schema_max_thread_instances 0
+performance_schema_session_connect_attrs_size 0
+performance_schema_setup_actors_size 0
+performance_schema_setup_objects_size 0
+performance_schema_show_processlist ON
+performance_schema_users_size 0
+show engine PERFORMANCE_SCHEMA status;
+show global status like "performance_schema%";
+
+select * from information_schema.engines
+where engine = "PERFORMANCE_SCHEMA";
+ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
+PERFORMANCE_SCHEMA YES Performance Schema NO NO NO
+
+# If the Performance Schema is disabled, then expect
+# performance-schema-show-processlist = OFF
+# regardless of its initial setting
+
+select @@global.performance_schema_show_processlist;
+@@global.performance_schema_show_processlist
+1
+
+# If the Performance Schema is disabled, then setting
+# performance-schema-show-processlist = ON
+# succeeds, SHOW PROCESSLIST returns no data.
+
+set @@global.performance_schema_show_processlist = ON;
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+
+show global variables like "performance_schema";
+Variable_name Value
+performance_schema OFF
diff --git a/mysql-test/suite/perfschema/r/processlist_port.result b/mysql-test/suite/perfschema/r/processlist_port.result
new file mode 100644
index 00000000000..c11ff41f112
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/processlist_port.result
@@ -0,0 +1,145 @@
+##
+## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+##
+## Verify the Host field (hostname:port) against the legacy implementation.
+##
+
+### Setup ###
+
+select @@global.performance_schema_show_processlist into @save_processlist;
+
+# Control user
+create user user0@localhost;
+grant ALL on *.* to user0@localhost;
+# Test users
+
+create user user1@localhost, user2@localhost,
+user3@localhost, user4@localhost;
+
+grant USAGE on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+grant ALL on *.* to user4@localhost;
+
+flush privileges;
+
+show grants for user1@localhost;
+Grants for user1@localhost
+GRANT USAGE ON *.* TO 'user1'@'localhost'
+
+# Connect (con_user0, 127.0.0.1, user0, , , MASTER_MYPORT, )
+
+select connection_id() into @con_user0_id;
+# Connect (con_user1, 127.0.0.1, user1, , , MASTER_MYPORT, )
+# Connect (con_user2, 127.0.0.1, user2, , , MASTER_MYPORT, )
+# Connect (con_user3, 127.0.0.1, user3, , , MASTER_MYPORT, )
+# Connect (con_user4, 127.0.0.1, user4, , , MASTER_MYPORT, )
+# Connection user0
+
+### Compare the SHOW PROCESSLIST Host column between the new and old implementations
+
+## New SHOW PROCESSLIST
+set @@global.performance_schema_show_processlist = on;
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user0 <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user1 <Host> test <Command> <Time> <State> NULL
+<Id> user2 <Host> test <Command> <Time> <State> NULL
+<Id> user3 <Host> test <Command> <Time> <State> NULL
+<Id> user4 <Host> test <Command> <Time> <State> NULL
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user0 <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> user1 <Host> test <Command> <Time> <State> NULL
+<Id> user2 <Host> test <Command> <Time> <State> NULL
+<Id> user3 <Host> test <Command> <Time> <State> NULL
+<Id> user4 <Host> test <Command> <Time> <State> NULL
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user0 <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> user1 <Host> test <Command> <Time> <State> NULL
+<Id> user2 <Host> test <Command> <Time> <State> NULL
+<Id> user3 <Host> test <Command> <Time> <State> NULL
+<Id> user4 <Host> test <Command> <Time> <State> NULL
+
+# Connection user1
+# Get Host:Port, new
+
+## Legacy SHOW PROCESSLIST
+set @@global.performance_schema_show_processlist = off;
+
+SHOW FULL PROCESSLIST;
+Id User Host db Command Time State Info
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user0 <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
+<Id> user1 <Host> test <Command> <Time> <State> NULL
+<Id> user2 <Host> test <Command> <Time> <State> NULL
+<Id> user3 <Host> test <Command> <Time> <State> NULL
+<Id> user4 <Host> test <Command> <Time> <State> NULL
+
+# Performance Schema processlist table
+
+select * from performance_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user0 <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
+<Id> user1 <Host> test <Command> <Time> <State> NULL
+<Id> user2 <Host> test <Command> <Time> <State> NULL
+<Id> user3 <Host> test <Command> <Time> <State> NULL
+<Id> user4 <Host> test <Command> <Time> <State> NULL
+
+# Information Schema processlist table
+
+select * from information_schema.processlist order by user, id;
+ID USER HOST DB COMMAND TIME STATE INFO
+<Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
+<Id> root <Host> test <Command> <Time> <State> NULL
+<Id> user0 <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
+<Id> user1 <Host> test <Command> <Time> <State> NULL
+<Id> user2 <Host> test <Command> <Time> <State> NULL
+<Id> user3 <Host> test <Command> <Time> <State> NULL
+<Id> user4 <Host> test <Command> <Time> <State> NULL
+
+# Connection user1
+# Get Host:Port, legacy
+
+***SUCCESS*** The SHOW PROCESSLIST Host fields match
+
+### Compare the processlist Host column between Performance Schema and the Information Schema
+
+# Connection con_user0
+
+***SUCCESS*** The processlist Host fields match between the Performance Schema and the Information Schema
+
+
+### Clean up ###
+
+# Disconnect con_user0
+# Disconnect con_user1
+# Disconnect con_user2
+# Disconnect con_user3
+# Disconnect con_user4
+# Connection default
+
+drop user user0@localhost;
+drop user user1@localhost;
+drop user user2@localhost;
+drop user user3@localhost;
+drop user user4@localhost;
+
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/r/processlist_reg_user.result b/mysql-test/suite/perfschema/r/processlist_reg_user.result
new file mode 100644
index 00000000000..72e879e4c09
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/processlist_reg_user.result
@@ -0,0 +1,89 @@
+##
+## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+## Verify behavior for regular users and PROCESS_ACL.
+##
+SELECT @@global.performance_schema_show_processlist INTO @save_processlist;
+SET @@global.performance_schema_show_processlist = OFF;
+CREATE USER 'regular'@'localhost';
+SHOW GRANTS;
+Grants for regular@localhost
+GRANT USAGE ON *.* TO 'regular'@'localhost'
+SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
+USER INFO
+regular SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST
+SELECT USER, INFO FROM performance_schema.processlist;
+USER INFO
+regular SELECT USER, INFO FROM performance_schema.processlist
+SHOW PROCESSLIST;
+SELECT "Previous statement is now completed." as status;
+status
+Previous statement is now completed.
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT as BROKEN_ROWS_SENT
+FROM performance_schema.events_statements_history
+WHERE SQL_TEXT = "SHOW PROCESSLIST";
+EVENT_NAME SQL_TEXT BROKEN_ROWS_SENT
+statement/sql/show_processlist SHOW PROCESSLIST 0
+TRUNCATE TABLE performance_schema.events_statements_history;
+SET @@global.performance_schema_show_processlist = ON;
+SHOW GRANTS;
+Grants for regular@localhost
+GRANT USAGE ON *.* TO 'regular'@'localhost'
+SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
+USER INFO
+regular SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST
+SELECT USER, INFO FROM performance_schema.processlist;
+USER INFO
+regular SELECT USER, INFO FROM performance_schema.processlist
+SHOW PROCESSLIST;
+SELECT "Previous statement is now completed." as status;
+status
+Previous statement is now completed.
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT
+FROM performance_schema.events_statements_history
+WHERE SQL_TEXT = "SHOW PROCESSLIST";
+EVENT_NAME SQL_TEXT ROWS_SENT
+statement/sql/show_processlist SHOW PROCESSLIST 1
+TRUNCATE TABLE performance_schema.events_statements_history;
+GRANT PROCESS ON *.* TO 'regular'@'localhost';
+SET @@global.performance_schema_show_processlist = OFF;
+SHOW GRANTS;
+Grants for regular@localhost
+GRANT PROCESS ON *.* TO 'regular'@'localhost'
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+count(*) >= 2
+1
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+count(*) >= 2
+1
+SHOW PROCESSLIST;
+SELECT "Previous statement is now completed." as status;
+status
+Previous statement is now completed.
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT as BROKEN_ROWS_SENT
+FROM performance_schema.events_statements_history
+WHERE SQL_TEXT = "SHOW PROCESSLIST";
+EVENT_NAME SQL_TEXT BROKEN_ROWS_SENT
+statement/sql/show_processlist SHOW PROCESSLIST 0
+TRUNCATE TABLE performance_schema.events_statements_history;
+SET @@global.performance_schema_show_processlist = ON;
+SHOW GRANTS;
+Grants for regular@localhost
+GRANT PROCESS ON *.* TO 'regular'@'localhost'
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+count(*) >= 2
+1
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+count(*) >= 2
+1
+SHOW PROCESSLIST;
+SELECT "Previous statement is now completed." as status;
+status
+Previous statement is now completed.
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT >= 2
+FROM performance_schema.events_statements_history
+WHERE SQL_TEXT = "SHOW PROCESSLIST";
+EVENT_NAME SQL_TEXT ROWS_SENT >= 2
+statement/sql/show_processlist SHOW PROCESSLIST 1
+TRUNCATE TABLE performance_schema.events_statements_history;
+SET @@global.performance_schema_show_processlist = @save_processlist;
+DROP USER 'regular'@'localhost';
diff --git a/mysql-test/suite/perfschema/r/show_sanity.result b/mysql-test/suite/perfschema/r/show_sanity.result
index dc326dd7f64..6fb33ea4d17 100644
--- a/mysql-test/suite/perfschema/r/show_sanity.result
+++ b/mysql-test/suite/perfschema/r/show_sanity.result
@@ -414,6 +414,7 @@ SHOW_MODE SOURCE VARIABLE_NAME
5.6 I_S.SESSION_VARIABLES INNODB_STATS_INCLUDE_DELETE_MARKED
5.6 I_S.SESSION_VARIABLES KEYRING_OPERATIONS
5.6 I_S.SESSION_VARIABLES LOG_STATEMENTS_UNSAFE_FOR_BINLOG
+5.6 I_S.SESSION_VARIABLES PERFORMANCE_SCHEMA_SHOW_PROCESSLIST
5.6 I_S.SESSION_VARIABLES REPLICATION_OPTIMIZE_FOR_STATIC_PLUGIN_CONFIG
5.6 I_S.SESSION_VARIABLES REPLICATION_SENDER_OBSERVE_COMMIT_ONLY
5.6 I_S.SESSION_VARIABLES TLS_VERSION
@@ -444,6 +445,7 @@ SHOW_MODE SOURCE VARIABLE_NAME
5.6 I_S.SESSION_VARIABLES INNODB_STATS_INCLUDE_DELETE_MARKED
5.6 I_S.SESSION_VARIABLES KEYRING_OPERATIONS
5.6 I_S.SESSION_VARIABLES LOG_STATEMENTS_UNSAFE_FOR_BINLOG
+5.6 I_S.SESSION_VARIABLES PERFORMANCE_SCHEMA_SHOW_PROCESSLIST
5.6 I_S.SESSION_VARIABLES REPLICATION_OPTIMIZE_FOR_STATIC_PLUGIN_CONFIG
5.6 I_S.SESSION_VARIABLES REPLICATION_SENDER_OBSERVE_COMMIT_ONLY
5.6 I_S.SESSION_VARIABLES TLS_VERSION
diff --git a/mysql-test/suite/perfschema/r/threads_mysql.result b/mysql-test/suite/perfschema/r/threads_mysql.result
index d0748349af3..20c119da31f 100644
--- a/mysql-test/suite/perfschema/r/threads_mysql.result
+++ b/mysql-test/suite/perfschema/r/threads_mysql.result
@@ -3,7 +3,7 @@ SELECT name, type, processlist_user, processlist_host, processlist_db,
processlist_command, processlist_info, connection_type,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
-role, instrumented
+`role`, instrumented
FROM performance_schema.threads
WHERE name LIKE 'thread/sql%'
ORDER BY name;
@@ -39,7 +39,7 @@ processlist_info SELECT name, type, processlist_user, processlist_host, processl
processlist_command, processlist_info, connection_type,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
-role, instrumented
+`role`, instrumented
FROM performance_schema.threads
WHERE name LIKE 'thread/sql%'
ORDER BY name
@@ -66,7 +66,7 @@ SELECT name, type, processlist_user, processlist_host, processlist_db,
processlist_command, processlist_info,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
-role, instrumented
+`role`, instrumented
FROM performance_schema.threads
WHERE name LIKE 'thread/sql%'
AND thread_id NOT IN (SELECT thread_id FROM t1)
@@ -94,7 +94,7 @@ SELECT name, type, processlist_user, processlist_host, processlist_db,
processlist_command, processlist_info,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
-role, instrumented
+`role`, instrumented
FROM performance_schema.threads
WHERE name LIKE 'thread/sql%'
AND thread_id NOT IN (SELECT thread_id FROM t1)
diff --git a/mysql-test/suite/perfschema/t/ddl_processlist.test b/mysql-test/suite/perfschema/t/ddl_processlist.test
new file mode 100644
index 00000000000..d960bf2df89
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/ddl_processlist.test
@@ -0,0 +1,32 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+
+select @@global.performance_schema_show_processlist into @save_processlist;
+set @@global.performance_schema_show_processlist = 'on';
+
+--error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.processlist
+ add column foo integer;
+
+--error ER_WRONG_PERFSCHEMA_USAGE
+truncate table performance_schema.processlist;
+
+--error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.processlist
+ add index test_index(info);
+
+--error ER_DBACCESS_DENIED_ERROR
+create unique index test_index
+ on performance_schema.processlist(host);
+
+-- error ER_DBACCESS_DENIED_ERROR
+drop index `PRIMARY`
+ on performance_schema.processlist;
+
+CREATE TABLE test.create_select
+ AS SELECT * from performance_schema.processlist;
+
+DROP TABLE test.create_select;
+
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/t/dml_processlist.test b/mysql-test/suite/perfschema/t/dml_processlist.test
new file mode 100644
index 00000000000..c075db3eabd
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_processlist.test
@@ -0,0 +1,39 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+
+select @@global.performance_schema_show_processlist into @save_processlist;
+set @@global.performance_schema_show_processlist = 'on';
+
+--disable_result_log
+select * from performance_schema.processlist
+ where user like 'event_scheduler';
+
+select * from performance_schema.processlist
+ where user = 'FOO';
+--enable_result_log
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.processlist
+ values (12, 'foo', 'bar', 'test', null, 1000, 'state', 'info');
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.processlist
+ set id=12, user='foo';
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.processlist
+ where id <> 99;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.processlist;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.processlist READ;
+UNLOCK TABLES;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.processlist WRITE;
+UNLOCK TABLES;
+
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/t/misc_global_status-master.opt b/mysql-test/suite/perfschema/t/misc_global_status-master.opt
new file mode 100644
index 00000000000..26b61f08d4e
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/misc_global_status-master.opt
@@ -0,0 +1 @@
+--loose-performance_schema_hosts_size=0
diff --git a/mysql-test/suite/perfschema/t/misc_global_status.test b/mysql-test/suite/perfschema/t/misc_global_status.test
new file mode 100644
index 00000000000..be20835c66e
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/misc_global_status.test
@@ -0,0 +1,134 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source include/have_query_cache_disabled.inc
+
+CREATE USER user1@localhost;
+CREATE USER user2@localhost;
+CREATE USER user3@localhost;
+
+grant ALL on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+
+# To aggregate to accounts
+#SET GLOBAL show_compatibility_56=0;
+
+TRUNCATE TABLE performance_schema.accounts;
+
+FLUSH PRIVILEGES;
+
+CREATE TABLE test.t_range(a int, b int, PRIMARY KEY(a));
+
+INSERT INTO test.t_range values (1, 1), (2,2), (3, 3), (4, 4), (5, 5);
+INSERT INTO test.t_range values (6, 6), (7,7), (8, 8), (9, 9), (10, 10);
+
+FLUSH STATUS;
+
+let $initial= `SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range'`;
+
+# Causes Select_range to increment (+1)
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+
+SELECT * from performance_schema.session_status
+ WHERE VARIABLE_NAME = 'Select_range';
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+connect(con1, localhost, user1,,);
+# Causes Select_range to increment (+1)
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+
+SELECT * from performance_schema.session_status
+ WHERE VARIABLE_NAME = 'Select_range';
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+connect(con2, localhost, user2,,);
+# Causes Select_range to increment (+2)
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+SELECT * from test.t_range where (a >= 4) AND (a <= 6);
+
+SELECT * from performance_schema.session_status
+ WHERE VARIABLE_NAME = 'Select_range';
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+connect(con3, localhost, user3,,);
+# Causes Select_range to increment (+3)
+SELECT * from test.t_range where (a >= 3) AND (a <= 5);
+SELECT * from test.t_range where (a >= 4) AND (a <= 6);
+SELECT * from test.t_range where (a >= 5) AND (a <= 7);
+
+SELECT * from performance_schema.session_status
+ WHERE VARIABLE_NAME = 'Select_range';
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+--connection default
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+SELECT `USER`, `HOST`, VARIABLE_NAME, VARIABLE_VALUE
+ FROM performance_schema.status_by_account WHERE VARIABLE_NAME = 'Select_range'
+ AND `USER` LIKE 'user%'
+ ORDER BY `USER`;
+
+--disconnect con1
+--disconnect con2
+
+# Wait till all disconnects are completed
+let $count_sessions= 2;
+--source include/wait_until_count_sessions.inc
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+TRUNCATE TABLE performance_schema.accounts;
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+--disconnect con3
+
+# Wait till all disconnects are completed
+let $count_sessions= 1;
+--source include/wait_until_count_sessions.inc
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+# Make sure TRUNCATE on accounts does not add to global_status
+TRUNCATE TABLE performance_schema.accounts;
+
+--disable_query_log
+eval SELECT VARIABLE_NAME, (VARIABLE_VALUE - $initial) AS DELTA from performance_schema.global_status WHERE VARIABLE_NAME = 'Select_range';
+--enable_query_log
+
+DROP TABLE test.t_range;
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM user2@localhost;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM user3@localhost;
+DROP USER user1@localhost;
+DROP USER user2@localhost;
+DROP USER user3@localhost;
+
+#SET GLOBAL show_compatibility_56=1;
+
+FLUSH PRIVILEGES;
+
diff --git a/mysql-test/suite/perfschema/t/processlist-master.opt b/mysql-test/suite/perfschema/t/processlist-master.opt
new file mode 100644
index 00000000000..f93413a61e5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist-master.opt
@@ -0,0 +1 @@
+--event-scheduler
diff --git a/mysql-test/suite/perfschema/t/processlist.test b/mysql-test/suite/perfschema/t/processlist.test
new file mode 100644
index 00000000000..fed22153931
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist.test
@@ -0,0 +1,197 @@
+--echo ##
+--echo ## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+--echo ##
+--echo ## Test cases:
+--echo ## 1. Execute the new SHOW [FULL] PROCESSLIST and SELECT on performance_schema.processlist
+--echo ## 2. Execute the legacy SHOW [FULL] PROCESSLIST and SELECT on information_schema.processlist
+--echo ## 3. Verify that performance_schema_show_processlist = ON executes the new implementation
+--echo ## 4. Verify that performance_schema_show_processlist = OFF executes the legacy code path
+--echo ##
+--echo ## Results must be manually verified.
+
+--source include/no_protocol.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/not_embedded.inc
+
+--echo
+--echo ### Setup ###
+--echo
+select @@global.performance_schema_show_processlist into @save_processlist;
+
+--echo
+create user user1@localhost, user2@localhost,
+ user3@localhost, user4@localhost;
+--echo
+grant ALL on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+grant ALL on *.* to user4@localhost;
+--echo
+flush privileges;
+
+--echo
+use test;
+create table test.t1 (s1 int, s2 int, s3 int, s4 int);
+
+--echo
+--echo # Switch to (con0, localhost, root, , )
+connect (con0, localhost, root, , );
+--echo
+insert into test.t1 values(1, 1, 1, 1);
+insert into test.t1 values(2, 2, 2, 2);
+insert into test.t1 values(3, 3, 3, 3);
+insert into test.t1 values(4, 4, 4, 4);
+
+--echo
+--echo # Lock test.t1, insert/update/deletes will block
+lock tables t1 read;
+
+--echo
+--echo # Connect (con1, localhost, user1, , )
+connect (con1, localhost, user1, , );
+--send insert into test.t1 values (0, 0, 0, 0)
+
+--echo
+--echo # Connect (con2, localhost, user2, , )
+connect (con2, localhost, user2, , );
+# Create a query > 100 characters
+--send update test.t1 set s1 = s1 + 1, s2 = s2 + 2, s3 = s3 + 3, s4 = ((s4 + 4) * (s4 + 5)) + 12345 + 67890 + 11111 + 22222 + 33333 + 44444 + 55555 + 99999;
+--echo
+--echo # Connect (con3, localhost, user3, , )
+connect (con3, localhost, user3, , );
+--send delete from test.t1 where s1 = 3
+
+--echo
+--echo # Connect (con4, localhost, user4, , )
+connect (con4, localhost, user4, , );
+--send insert into test.t1 values (4, 4, 4, 4)
+
+--echo
+--echo # Connection default
+--connection default
+
+--echo
+--echo # Wait for queries to appear in the processlist table
+let $wait_condition = select count(*) >= 4 from information_schema.processlist
+ where state like '%metadata%';
+--source include/wait_condition.inc
+
+--echo
+--echo
+--echo ### Execute new SHOW [FULL] PROCESSLIST and SELECT on performance_schema.processlist
+--echo
+let $pfs_spl = on;
+--source ../include/processlist_set.inc
+--source ../include/processlist_load.inc
+
+--echo
+--echo
+--echo ### Execute legacy SHOW [FULL] PROCESSLIST and SELECT on information_schema.processlist
+--echo
+let $pfs_spl = off;
+--source ../include/processlist_set.inc
+--source ../include/processlist_load.inc
+
+--echo
+--echo
+--echo ### Verify feature code path
+--echo
+--echo # Enable SHOW PROCESSLIST via the Performance Schema
+let $pfs_spl = on;
+--source ../include/processlist_set.inc
+
+--echo
+--echo # Connection default, send SHOW PROCESSLIST
+--connection default
+SET DEBUG_SYNC='pfs_show_processlist_performance_schema SIGNAL pfs_processlist_pfs WAIT_FOR continue';
+--send SHOW FULL PROCESSLIST
+
+--echo
+--echo # Connection con0
+--connection con0
+SET DEBUG_SYNC='now WAIT_FOR pfs_processlist_pfs';
+SET DEBUG_SYNC='now SIGNAL continue';
+
+--echo
+--echo # Connection default, reap
+--connection default
+--replace_column 1 <Id> 3 <Host> 5 <Command> 6 <Time> 7 <State> 8 <Info>
+--sorted_result
+--reap
+
+--echo
+--echo
+--echo ### Verify legacy code path
+--echo
+--echo # Enable the legacy SHOW PROCESSLIST
+let $pfs_spl = off;
+--source ../include/processlist_set.inc
+
+--echo
+--echo # Connection default, send SHOW PROCESSLIST
+--connection default
+SET DEBUG_SYNC='RESET';
+SET DEBUG_SYNC='pfs_show_processlist_legacy SIGNAL pfs_processlist_legacy WAIT_FOR continue';
+--send SHOW FULL PROCESSLIST
+
+--echo
+--echo # Connection con0
+--connection con0
+SET DEBUG_SYNC='now WAIT_FOR pfs_processlist_legacy';
+SET DEBUG_SYNC='now SIGNAL continue';
+
+--echo
+--echo # Connection default, reap
+--connection default
+--replace_column 1 <Id> 3 <Host> 5 <Command> 6 <Time> 7 <State> 8 <Info>
+--sorted_result
+--reap
+
+--echo
+--echo
+--echo ### Clean up ###
+--echo
+
+--echo # Connection con0, unlock test.t1, disconnect
+--connection con0
+unlock tables;
+--disconnect con0
+
+--disable_query_log
+--disable_result_log
+--echo
+--echo # Connection con1, reap, disconnect
+--connection con1
+--reap
+--disconnect con1
+
+--echo # Connection con2, reap, disconnect
+--connection con2
+--reap
+--disconnect con2
+
+--echo # Connection con3, reap, disconnect
+--connection con3
+--reap
+--disconnect con3
+
+--echo # Connection con4, reap, disconnect
+--connection con4
+--reap
+--disconnect con4
+--enable_result_log
+--enable_query_log
+
+--echo
+--echo # Connection default
+--connection default
+
+--echo
+drop table test.t1;
+drop user user1@localhost;
+drop user user2@localhost;
+drop user user3@localhost;
+drop user user4@localhost;
+--echo
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/t/processlist_57.test b/mysql-test/suite/perfschema/t/processlist_57.test
new file mode 100644
index 00000000000..748d8b7402b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_57.test
@@ -0,0 +1,349 @@
+
+--source include/no_protocol.inc
+--source include/not_embedded.inc
+
+call mtr.add_suppression("Optional native table 'performance_schema'.'processlist' has the wrong structure or is missing.");
+call mtr.add_suppression("Column count of performance_schema.processlist is wrong. Expected 8, found 2. The table is probably corrupted");
+
+--echo ##
+--echo ## Verify fresh 5.7 instance
+--echo ##
+
+SELECT @@global.performance_schema_show_processlist;
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+--echo ##
+--echo ## Simulate old 5.7 instance
+--echo ##
+
+DROP TABLE performance_schema.processlist;
+
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE performance_schema.processlist;
+
+let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
+--exec echo "wait" > $restart_file
+--echo ##
+--echo ## Server shutdown
+--echo ##
+--shutdown_server
+--source include/wait_until_disconnected.inc
+--echo ##
+--echo ### Server restart
+--echo ##
+--exec echo "restart:">$restart_file
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--echo ##
+--echo ## Verify old 5.7 instance
+--echo ##
+
+SELECT @@global.performance_schema_show_processlist;
+
+--error ER_NO_SUCH_TABLE
+SHOW CREATE TABLE performance_schema.processlist;
+
+--error ER_NO_SUCH_TABLE
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+--error ER_NO_SUCH_TABLE
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--error ER_NO_SUCH_TABLE
+SHOW PROCESSLIST;
+
+--echo ##
+--echo ## Perform broken upgrade (case 1)
+--echo ##
+
+CREATE TABLE performance_schema.processlist (a int, b int);
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--error ER_BAD_FIELD_ERROR
+SHOW PROCESSLIST;
+
+--exec echo "wait" > $restart_file
+--echo ##
+--echo ## Server shutdown
+--echo ##
+--shutdown_server
+--source include/wait_until_disconnected.inc
+--echo ##
+--echo ### Server restart
+--echo ##
+--exec echo "restart:">$restart_file
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--error ER_BAD_FIELD_ERROR
+SHOW PROCESSLIST;
+
+--echo ##
+--echo ## Perform broken upgrade (case 2)
+--echo ##
+
+DROP TABLE performance_schema.processlist;
+CREATE TABLE performance_schema.processlist (
+ `ID` bigint(20) unsigned NOT NULL,
+ `USER` varchar(32) DEFAULT NULL,
+ `HOST` varchar(66) DEFAULT NULL,
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) DEFAULT NULL,
+ `TIME` bigint(20) DEFAULT NULL,
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+);
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Works and returns no data, innodb table is empty.
+SHOW PROCESSLIST;
+
+--exec echo "wait" > $restart_file
+--echo ##
+--echo ## Server shutdown
+--echo ##
+--shutdown_server
+--source include/wait_until_disconnected.inc
+--echo ##
+--echo ### Server restart
+--echo ##
+--exec echo "restart:">$restart_file
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Works and returns no data, innodb table is empty.
+SHOW PROCESSLIST;
+
+--echo ##
+--echo ## Perform broken upgrade (case 3)
+--echo ##
+
+DROP TABLE performance_schema.processlist;
+CREATE TABLE performance_schema.processlist
+ LIKE INFORMATION_SCHEMA.PROCESSLIST;
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Works and returns no data, innodb table is empty.
+SHOW PROCESSLIST;
+
+--exec echo "wait" > $restart_file
+--echo ##
+--echo ## Server shutdown
+--echo ##
+--shutdown_server
+--source include/wait_until_disconnected.inc
+--echo ##
+--echo ### Server restart
+--echo ##
+--exec echo "restart:">$restart_file
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Works and returns no data, innodb table is empty.
+SHOW PROCESSLIST;
+
+--echo ##
+--echo ## Perform correct upgrade
+--echo ##
+
+DROP TABLE performance_schema.processlist;
+CREATE TABLE performance_schema.processlist (
+ `ID` bigint(20) unsigned NOT NULL,
+ `USER` varchar(32) DEFAULT NULL,
+ `HOST` varchar(66) DEFAULT NULL,
+ `DB` varchar(64) DEFAULT NULL,
+ `COMMAND` varchar(16) DEFAULT NULL,
+ `TIME` bigint(20) DEFAULT NULL,
+ `STATE` varchar(64) DEFAULT NULL,
+ `INFO` longtext
+) ENGINE = 'PERFORMANCE_SCHEMA';
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+--exec echo "wait" > $restart_file
+--echo ##
+--echo ## Server shutdown
+--echo ##
+--shutdown_server
+--source include/wait_until_disconnected.inc
+--echo ##
+--echo ### Server restart
+--echo ##
+--exec echo "restart:">$restart_file
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+SHOW CREATE TABLE performance_schema.processlist;
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+SET GLOBAL performance_schema_show_processlist = 'ON';
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM performance_schema.processlist;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+--replace_column 3 [HOST:PORT] 6 [TIME]
+SHOW PROCESSLIST;
+
+# Cleanup
+
+SET GLOBAL performance_schema_show_processlist = 'OFF';
+
diff --git a/mysql-test/suite/perfschema/t/processlist_acl-master.opt b/mysql-test/suite/perfschema/t/processlist_acl-master.opt
new file mode 100644
index 00000000000..f93413a61e5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_acl-master.opt
@@ -0,0 +1 @@
+--event-scheduler
diff --git a/mysql-test/suite/perfschema/t/processlist_acl.test b/mysql-test/suite/perfschema/t/processlist_acl.test
new file mode 100644
index 00000000000..f0733865ebc
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_acl.test
@@ -0,0 +1,196 @@
+--echo ##
+--echo ## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+--echo ##
+--echo ## Verify handling of the SELECT and PROCESS privileges.
+--echo ##
+--echo ## Test cases:
+--echo ## - Execute SHOW PROCESSLIST (new and legacy) with all privileges
+--echo ## - Execute SELECT on the performance_schema.processlist and information_schema.processlist with all privileges
+--echo ## - Execute SHOW PROCESSLIST (new and legacy) with no privileges
+--echo ## - Execute SELECT on the performance_schema.processlist and information_schema.processlist with no privileges
+--echo ##
+--echo ## Results must be manually verified.
+--echo
+
+--source include/no_protocol.inc
+--source include/not_embedded.inc
+
+--echo ### Setup ###
+--echo
+select @@global.performance_schema_show_processlist into @save_processlist;
+
+--echo
+--echo # Control users
+create user user_00@localhost, user_01@localhost;
+grant ALL on *.* to user_00@localhost;
+grant ALL on *.* to user_01@localhost;
+
+--echo
+--echo # Test users
+create user user_all@localhost, user_none@localhost;
+grant ALL on *.* to user_all@localhost;
+grant USAGE on *.* to user_none@localhost;
+--echo
+flush privileges;
+
+--echo
+show grants for user_all@localhost;
+--echo
+show grants for user_none@localhost;
+
+--echo
+use test;
+create table test.t1 (s1 int, s2 int, s3 int, s4 int);
+
+--echo
+--echo # Connect (con_00, localhost, user_00, , )
+connect (con_00, localhost, user_00, , );
+
+--echo # Connect (con_01, localhost, user_01, , )
+connect (con_01, localhost, user_01, , );
+--echo
+insert into test.t1 values(1, 1, 1, 1);
+insert into test.t1 values(2, 2, 2, 2);
+insert into test.t1 values(3, 3, 3, 3);
+insert into test.t1 values(4, 4, 4, 4);
+
+--echo
+--echo # Lock test.t1, insert/update/deletes will block
+lock tables t1 read;
+
+--echo
+--echo # Establish 2 connections for user_all
+--echo # Connect (con_all_1, localhost, user_all, , )
+connect (con_all_1, localhost, user_all, , );
+
+--echo # Connect (con_all_2, localhost, user_all, , )
+connect (con_all_2, localhost, user_all, , );
+--send insert into test.t1 values (0, 0, 0, 0)
+
+--echo
+--echo # Establish 4 connections for user_none
+--echo # Connect (con_none_1, localhost, user_none, , )
+connect (con_none_1, localhost, user_none, , );
+
+--echo # Connect (con_none_2, localhost, user_none, , )
+connect (con_none_2, localhost, user_none, , );
+
+--echo # Connect (con_none_3, localhost, user_none, , )
+connect (con_none_3, localhost, user_none, , );
+
+--echo # Connect (con_none_4, localhost, user_none, , )
+connect (con_none_4, localhost, user_none, , );
+--send update test.t1 set s1 = s1 + 1, s2 = s2 + 2;
+
+--echo
+--echo # Connection con_all_1
+--connection con_all_1
+
+# Note: When expecting processlist results for all users, the wait_condition
+# and subsequent execution of SHOW PROCESSLIST should be conducted from the
+# same connection to ensure consistent values in the Command and Info columns.
+
+--echo
+--echo # Wait for queries to appear in the processlist table
+let $wait_condition = select count(*) >= 2 from information_schema.processlist
+ where state like '%metadata%';
+--source include/wait_condition.inc
+
+--echo
+--echo ### Execute SHOW PROCESSLIST with all privileges
+--echo ### Expect all users
+--echo
+--echo # New SHOW PROCESSLIST
+let $pfs_spl = on;
+--source ../include/processlist_set.inc
+--source ../include/processlist_load.inc
+
+--echo
+--echo # Legacy SHOW PROCESSLIST
+let $pfs_spl = off;
+--source ../include/processlist_set.inc
+--source ../include/processlist_load.inc
+
+--echo
+--echo
+--echo ### Execute SHOW PROCESSLIST with no SELECT and no PROCESS privileges
+--echo ### Expect processes only from user_none
+--echo
+--echo # New SHOW PROCESSLIST
+let $pfs_spl = on;
+--source ../include/processlist_set.inc
+
+--echo
+--echo # Connection con_none_1
+--connection con_none_1
+--source ../include/processlist_load.inc
+
+--echo
+--echo # Confirm that only processes from user_none are visible
+--echo
+select count(*) as "Expect 0" from performance_schema.processlist
+ where user not in ('user_none');
+
+--echo
+--echo # Legacy SHOW PROCESSLIST
+--connection con_00
+let $pfs_spl = off;
+--source ../include/processlist_set.inc
+
+--echo
+--echo # Connection con_none_1
+--connection con_none_1
+--source ../include/processlist_load.inc
+
+--echo
+--echo
+--echo ### Clean up ###
+--echo
+
+--echo # Disconnect con_00
+--connection con_00
+--disconnect con_00
+
+--echo # Connection con_01, unlock test.t1, disconnect
+--connection con_01
+unlock tables;
+--disconnect con_01
+
+--echo # Disconnect con_all_1
+--connection con_all_1
+--disconnect con_all_1
+
+--echo # Reap con_all_2, disconnect
+--connection con_all_2
+--reap
+--disconnect con_all_2
+
+--echo # Disconnect con_none_1
+--connection con_none_1
+--disconnect con_none_1
+
+--echo # Disconnect con_none_2
+--connection con_none_2
+--disconnect con_none_2
+
+--echo # Disconnect con_none_3
+--connection con_none_3
+--disconnect con_none_3
+
+--echo # Reap con_none_4, disconnect
+--connection con_none_4
+--reap
+--disconnect con_none_4
+
+--echo
+--echo # Connection default
+--connection default
+
+--echo
+drop table test.t1;
+drop user user_00@localhost;
+drop user user_01@localhost;
+drop user user_all@localhost;
+drop user user_none@localhost;
+--echo
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/t/processlist_anonymous.test b/mysql-test/suite/perfschema/t/processlist_anonymous.test
new file mode 100644
index 00000000000..4b8e7ec2e1f
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_anonymous.test
@@ -0,0 +1,111 @@
+--echo ##
+--echo ## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+--echo ## Verify behavior for anonymous users and PROCESS_ACL.
+--echo ##
+
+--source include/no_protocol.inc
+--source include/not_embedded.inc
+
+SELECT @@global.performance_schema_show_processlist INTO @save_processlist;
+
+--source include/add_anonymous_users.inc
+
+SET @@global.performance_schema_show_processlist = OFF;
+
+connect (anon,localhost,test,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+
+SHOW GRANTS;
+
+# Empty
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Empty
+SELECT * FROM performance_schema.processlist;
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SHOW PROCESSLIST;
+
+connection default;
+
+SET @@global.performance_schema_show_processlist = ON;
+
+connection anon;
+
+SHOW GRANTS;
+
+# Empty
+SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Empty
+SELECT * FROM performance_schema.processlist;
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SHOW PROCESSLIST;
+
+disconnect anon;
+connection default;
+
+GRANT PROCESS ON *.* TO ''@'localhost';
+
+SET @@global.performance_schema_show_processlist = OFF;
+
+connect (anon2,localhost,test,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+
+SHOW GRANTS;
+
+# Full rows
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Full rows
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+
+# Full rows
+--disable_result_log
+SHOW PROCESSLIST;
+--enable_result_log
+
+SELECT "Previous statement is now completed." as status;
+
+connection default;
+# Returns ROWS_SENT = 0 even when SHOW PROCESSLIST has rows
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT as BROKEN_ROWS_SENT
+ FROM performance_schema.events_statements_history
+ WHERE SQL_TEXT = "SHOW PROCESSLIST";
+connection anon2;
+
+
+connection default;
+
+TRUNCATE TABLE performance_schema.events_statements_history;
+set @@global.performance_schema_show_processlist = ON;
+
+
+connection anon2;
+
+SHOW GRANTS;
+
+# Full rows
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Full rows
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+
+# Full rows
+--disable_result_log
+SHOW PROCESSLIST;
+--enable_result_log
+
+SELECT "Previous statement is now completed." as status;
+
+connection default;
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT >= 2
+ FROM performance_schema.events_statements_history
+ WHERE SQL_TEXT = "SHOW PROCESSLIST";
+
+disconnect anon2;
+connection default;
+
+--source include/delete_anonymous_users.inc
+
+SET @@global.performance_schema_show_processlist = @save_processlist;
+
diff --git a/mysql-test/suite/perfschema/t/processlist_no_pfs-master.opt b/mysql-test/suite/perfschema/t/processlist_no_pfs-master.opt
new file mode 100644
index 00000000000..6fb075f60bc
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_no_pfs-master.opt
@@ -0,0 +1,2 @@
+--loose-disable-performance-schema
+--loose-performance-schema-show-processlist=ON
diff --git a/mysql-test/suite/perfschema/t/processlist_no_pfs.test b/mysql-test/suite/perfschema/t/processlist_no_pfs.test
new file mode 100644
index 00000000000..273e180a18a
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_no_pfs.test
@@ -0,0 +1,29 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+
+--source ../include/start_server_common.inc
+
+--echo
+select * from information_schema.engines
+ where engine = "PERFORMANCE_SCHEMA";
+
+--echo
+--echo # If the Performance Schema is disabled, then expect
+--echo # performance-schema-show-processlist = OFF
+--echo # regardless of its initial setting
+--echo
+select @@global.performance_schema_show_processlist;
+
+--echo
+--echo # If the Performance Schema is disabled, then setting
+--echo # performance-schema-show-processlist = ON
+--echo # succeeds, SHOW PROCESSLIST returns no data.
+--echo
+set @@global.performance_schema_show_processlist = ON;
+
+SHOW PROCESSLIST;
+
+--echo
+show global variables like "performance_schema";
+
diff --git a/mysql-test/suite/perfschema/t/processlist_port-master.opt b/mysql-test/suite/perfschema/t/processlist_port-master.opt
new file mode 100644
index 00000000000..f93413a61e5
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_port-master.opt
@@ -0,0 +1 @@
+--event-scheduler
diff --git a/mysql-test/suite/perfschema/t/processlist_port.test b/mysql-test/suite/perfschema/t/processlist_port.test
new file mode 100644
index 00000000000..8403b0c793b
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_port.test
@@ -0,0 +1,162 @@
+--echo ##
+--echo ## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+--echo ##
+--echo ## Verify the Host field (hostname:port) against the legacy implementation.
+--echo ##
+
+--source include/no_protocol.inc
+--source include/not_embedded.inc
+
+--echo
+--echo ### Setup ###
+--echo
+select @@global.performance_schema_show_processlist into @save_processlist;
+
+--echo
+--echo # Control user
+create user user0@localhost;
+grant ALL on *.* to user0@localhost;
+
+--echo # Test users
+--echo
+create user user1@localhost, user2@localhost,
+ user3@localhost, user4@localhost;
+--echo
+# Grant no privileges to user1 to ensure only one process
+grant USAGE on *.* to user1@localhost;
+grant ALL on *.* to user2@localhost;
+grant ALL on *.* to user3@localhost;
+grant ALL on *.* to user4@localhost;
+--echo
+flush privileges;
+--echo
+show grants for user1@localhost;
+
+--echo
+--echo # Connect (con_user0, 127.0.0.1, user0, , , MASTER_MYPORT, )
+connect (con_user0, 127.0.0.1, user0, , , $MASTER_MYPORT, );
+--echo
+select connection_id() into @con_user0_id;
+
+--echo # Connect (con_user1, 127.0.0.1, user1, , , MASTER_MYPORT, )
+connect (con_user1, 127.0.0.1, user1, , , $MASTER_MYPORT, );
+
+--echo # Connect (con_user2, 127.0.0.1, user2, , , MASTER_MYPORT, )
+connect (con_user2, 127.0.0.1, user2, , , $MASTER_MYPORT, );
+
+--echo # Connect (con_user3, 127.0.0.1, user3, , , MASTER_MYPORT, )
+connect (con_user3, 127.0.0.1, user3, , , $MASTER_MYPORT, );
+
+--echo # Connect (con_user4, 127.0.0.1, user4, , , MASTER_MYPORT, )
+connect (con_user4, 127.0.0.1, user4, , , $MASTER_MYPORT, );
+
+--echo # Connection user0
+--connection con_user0
+let $wait_condition = select connection_id() = @con_user0_id;
+--source include/wait_condition.inc
+
+--echo
+--echo ### Compare the SHOW PROCESSLIST Host column between the new and old implementations
+--echo
+--echo ## New SHOW PROCESSLIST
+let $pfs_spl = on;
+--source ../include/processlist_set.inc
+--source ../include/processlist_load.inc
+
+--echo
+--echo # Connection user1
+--connection con_user1
+
+--echo # Get Host:Port, new
+let $host_new = query_get_value(SHOW FULL PROCESSLIST, Host, 1);
+
+--echo
+--echo ## Legacy SHOW PROCESSLIST
+--connection con_user0
+let $pfs_spl = off;
+--source ../include/processlist_set.inc
+--source ../include/processlist_load.inc
+
+--echo
+--echo # Connection user1
+--connection con_user1
+
+--echo # Get Host:Port, legacy
+let $host_old = query_get_value(SHOW FULL PROCESSLIST, Host, 1);
+
+--echo
+
+## DEBUG ONLY
+## --echo DEBUG: New: $host_new Old: $host_old
+
+if ($host_new == $host_old)
+{
+ --echo ***SUCCESS*** The SHOW PROCESSLIST Host fields match
+}
+
+if ($host_new != $host_old)
+{
+ --echo ***ERROR*** SHOW PROCESSLIST Host fields do not match. New: $host_new Old: $host_old
+}
+
+--echo
+--echo ### Compare the processlist Host column between Performance Schema and the Information Schema
+--echo
+--echo # Connection con_user0
+--connection con_user0
+let $count_new = `select count(*) from performance_schema.processlist`;
+let $count_old = `select count(*) from information_schema.processlist`;
+let $count_join = `select count(*) from performance_schema.processlist pspl
+ left join information_schema.processlist ispl on pspl.host = ispl.host and pspl.id = ispl.id`;
+
+--echo
+
+if ($count_old == $count_join)
+{
+ --echo ***SUCCESS*** The processlist Host fields match between the Performance Schema and the Information Schema
+}
+
+if ($count_old != $count_join)
+{
+ --echo ***ERROR*** The processlist Host fields do not match
+ --echo Count new: $count_new Count old: $count_old Count join: $count_join
+ --echo
+ select * from performance_schema.processlist order by host, id;
+ --echo
+ select * from information_schema.processlist order by host, id;
+ --echo
+ select * from performance_schema.processlist pspl
+ left join information_schema.processlist ispl on pspl.host = ispl.host and pspl.id = ispl.id;
+}
+
+--echo
+--echo
+--echo ### Clean up ###
+--echo
+
+--echo # Disconnect con_user0
+--connection con_user0
+--disconnect con_user0
+--echo # Disconnect con_user1
+--connection con_user1
+--disconnect con_user1
+--echo # Disconnect con_user2
+--connection con_user2
+--disconnect con_user2
+--echo # Disconnect con_user3
+--connection con_user3
+--disconnect con_user3
+--echo # Disconnect con_user4
+--connection con_user4
+--disconnect con_user4
+
+--echo # Connection default
+--connection default
+--echo
+drop user user0@localhost;
+drop user user1@localhost;
+drop user user2@localhost;
+drop user user3@localhost;
+drop user user4@localhost;
+--echo
+set @@global.performance_schema_show_processlist = @save_processlist;
diff --git a/mysql-test/suite/perfschema/t/processlist_reg_user.test b/mysql-test/suite/perfschema/t/processlist_reg_user.test
new file mode 100644
index 00000000000..53dc8abfa63
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/processlist_reg_user.test
@@ -0,0 +1,134 @@
+--echo ##
+--echo ## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
+--echo ## Verify behavior for regular users and PROCESS_ACL.
+--echo ##
+
+--source include/no_protocol.inc
+--source include/not_embedded.inc
+
+SELECT @@global.performance_schema_show_processlist INTO @save_processlist;
+
+--source include/add_anonymous_users.inc
+
+SET @@global.performance_schema_show_processlist = OFF;
+
+CREATE USER 'regular'@'localhost';
+
+connect (reg,localhost,regular,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+
+SHOW GRANTS;
+
+# Self rows only
+SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Self rows only
+SELECT USER, INFO FROM performance_schema.processlist;
+
+# Self rows only
+--disable_result_log
+SHOW PROCESSLIST;
+--enable_result_log
+
+SELECT "Previous statement is now completed." as status;
+
+connection default;
+
+# Returns ROWS_SENT = 0 even when SHOW PROCESSLIST has rows
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT as BROKEN_ROWS_SENT
+ FROM performance_schema.events_statements_history
+ WHERE SQL_TEXT = "SHOW PROCESSLIST";
+
+TRUNCATE TABLE performance_schema.events_statements_history;
+SET @@global.performance_schema_show_processlist = ON;
+
+connection reg;
+
+SHOW GRANTS;
+
+# Self rows only
+SELECT USER, INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Self rows only
+SELECT USER, INFO FROM performance_schema.processlist;
+
+# Self rows only
+--disable_result_log
+SHOW PROCESSLIST;
+--enable_result_log
+
+SELECT "Previous statement is now completed." as status;
+
+connection default;
+
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT
+ FROM performance_schema.events_statements_history
+ WHERE SQL_TEXT = "SHOW PROCESSLIST";
+
+TRUNCATE TABLE performance_schema.events_statements_history;
+
+disconnect reg;
+
+GRANT PROCESS ON *.* TO 'regular'@'localhost';
+
+SET @@global.performance_schema_show_processlist = OFF;
+
+connect (reg2,localhost,regular,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
+
+SHOW GRANTS;
+
+# Full rows
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Full rows
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+
+# Full rows
+--disable_result_log
+SHOW PROCESSLIST;
+--enable_result_log
+
+SELECT "Previous statement is now completed." as status;
+
+connection default;
+
+# Returns ROWS_SENT = 0 even when SHOW PROCESSLIST has rows
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT as BROKEN_ROWS_SENT
+ FROM performance_schema.events_statements_history
+ WHERE SQL_TEXT = "SHOW PROCESSLIST";
+
+TRUNCATE TABLE performance_schema.events_statements_history;
+SET @@global.performance_schema_show_processlist = ON;
+
+connection reg2;
+
+SHOW GRANTS;
+
+# Full rows
+SELECT count(*) >= 2 FROM INFORMATION_SCHEMA.PROCESSLIST;
+
+# Full rows
+SELECT count(*) >= 2 FROM performance_schema.processlist;
+
+# Full rows
+--disable_result_log
+SHOW PROCESSLIST;
+--enable_result_log
+
+SELECT "Previous statement is now completed." as status;
+
+connection default;
+
+SELECT EVENT_NAME, SQL_TEXT, ROWS_SENT >= 2
+ FROM performance_schema.events_statements_history
+ WHERE SQL_TEXT = "SHOW PROCESSLIST";
+
+TRUNCATE TABLE performance_schema.events_statements_history;
+
+disconnect reg2;
+
+--source include/delete_anonymous_users.inc
+
+SET @@global.performance_schema_show_processlist = @save_processlist;
+
+DROP USER 'regular'@'localhost';
+
diff --git a/mysql-test/suite/perfschema/t/threads_mysql.test b/mysql-test/suite/perfschema/t/threads_mysql.test
index 8a021055d44..e19b3664f21 100644
--- a/mysql-test/suite/perfschema/t/threads_mysql.test
+++ b/mysql-test/suite/perfschema/t/threads_mysql.test
@@ -35,7 +35,7 @@ SELECT name, type, processlist_user, processlist_host, processlist_db,
processlist_command, processlist_info, connection_type,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
- role, instrumented
+ `role`, instrumented
FROM performance_schema.threads
WHERE name LIKE 'thread/sql%'
ORDER BY name;
@@ -54,7 +54,7 @@ SELECT name, type, processlist_user, processlist_host, processlist_db,
processlist_command, processlist_info,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
- role, instrumented
+ `role`, instrumented
FROM performance_schema.threads
WHERE name LIKE 'thread/sql%'
AND thread_id NOT IN (SELECT thread_id FROM t1)
@@ -94,7 +94,7 @@ SELECT name, type, processlist_user, processlist_host, processlist_db,
processlist_command, processlist_info,
IF(parent_thread_id IS NULL, parent_thread_id, 'unified parent_thread_id')
AS unified_parent_thread_id,
- role, instrumented
+ `role`, instrumented
FROM performance_schema.threads
WHERE name LIKE 'thread/sql%'
AND thread_id NOT IN (SELECT thread_id FROM t1)
diff --git a/mysql-test/suite/plugins/r/binlog-simple_plugin_check.result b/mysql-test/suite/plugins/r/binlog-simple_plugin_check.result
index 6c960ee325c..1cba628db07 100644
--- a/mysql-test/suite/plugins/r/binlog-simple_plugin_check.result
+++ b/mysql-test/suite/plugins/r/binlog-simple_plugin_check.result
@@ -8,7 +8,7 @@ simple_password_check
#
CREATE USER user1@localhost IDENTIFIED BY 'BsG9#9.cem#!85';
CREATE USER user2@localhost IDENTIFIED BY 'bsg9#d.cem#!85';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
DROP USER user1@localhost;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
diff --git a/mysql-test/suite/plugins/r/cracklib_password_check.result b/mysql-test/suite/plugins/r/cracklib_password_check.result
index fb24ec142b8..192d41d2ccf 100644
--- a/mysql-test/suite/plugins/r/cracklib_password_check.result
+++ b/mysql-test/suite/plugins/r/cracklib_password_check.result
@@ -14,41 +14,41 @@ LOAD_OPTION ON
PLUGIN_MATURITY Stable
PLUGIN_AUTH_VERSION 1.0
grant select on *.* to foocar identified by 'foocar';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (cracklib_password_check)
show warnings;
Level Code Message
Warning 1819 cracklib: it is based on your username
-Error 1819 Your password does not satisfy the current policy requirements
+Error 1819 Your password does not satisfy the current policy requirements (cracklib_password_check)
grant select on *.* to foocar identified by 'racoof';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (cracklib_password_check)
show warnings;
Level Code Message
Warning 1819 cracklib: it is based on your username
-Error 1819 Your password does not satisfy the current policy requirements
+Error 1819 Your password does not satisfy the current policy requirements (cracklib_password_check)
grant select on *.* to foo@barbar identified by 'barbar';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (cracklib_password_check)
show warnings;
Level Code Message
Warning 1819 cracklib: it does not contain enough DIFFERENT characters
-Error 1819 Your password does not satisfy the current policy requirements
+Error 1819 Your password does not satisfy the current policy requirements (cracklib_password_check)
grant select on *.* to foobar identified by 'qwerty';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (cracklib_password_check)
show warnings;
Level Code Message
Warning 1819 cracklib: it is based on a dictionary word
-Error 1819 Your password does not satisfy the current policy requirements
+Error 1819 Your password does not satisfy the current policy requirements (cracklib_password_check)
grant select on *.* to foocar@localhost identified by 'localhost';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (cracklib_password_check)
show warnings;
Level Code Message
Warning 1819 cracklib: it is based upon your password entry
-Error 1819 Your password does not satisfy the current policy requirements
+Error 1819 Your password does not satisfy the current policy requirements (cracklib_password_check)
grant select on *.* to foocar@localhost identified by 'foocar@localhost';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (cracklib_password_check)
show warnings;
Level Code Message
Warning 1819 cracklib: it is derived from your password entry
-Error 1819 Your password does not satisfy the current policy requirements
+Error 1819 Your password does not satisfy the current policy requirements (cracklib_password_check)
grant select on *.* to foobar identified by 'q$%^&*rty';
drop user foobar;
#
@@ -56,7 +56,7 @@ drop user foobar;
# when using cracklib plugin
#
create user 'newuser'@'localhost';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (cracklib_password_check)
uninstall plugin cracklib_password_check;
create user foo1 identified by 'pwd';
drop user foo1;
diff --git a/mysql-test/suite/plugins/r/password_reuse_check.result b/mysql-test/suite/plugins/r/password_reuse_check.result
index e4f4dc0fab8..a1d68066e3c 100644
--- a/mysql-test/suite/plugins/r/password_reuse_check.result
+++ b/mysql-test/suite/plugins/r/password_reuse_check.result
@@ -7,17 +7,17 @@ password_reuse_check_interval 0
# insert user
grant select on *.* to user_name@localhost identified by 'test_pwd';
grant select on *.* to user_name@localhost identified by 'test_pwd';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (password_reuse_check)
show warnings;
Level Code Message
Warning 1819 password_reuse_check: The password was already used
-Error 1819 Your password does not satisfy the current policy requirements
+Error 1819 Your password does not satisfy the current policy requirements (password_reuse_check)
alter user user_name@localhost identified by 'test_pwd';
ERROR HY000: Operation ALTER USER failed for 'user_name'@'localhost'
show warnings;
Level Code Message
Warning 1819 password_reuse_check: The password was already used
-Error 1819 Your password does not satisfy the current policy requirements
+Error 1819 Your password does not satisfy the current policy requirements (password_reuse_check)
Error 1396 Operation ALTER USER failed for 'user_name'@'localhost'
# check exparation
set global password_reuse_check_interval= 10;
@@ -26,7 +26,7 @@ ERROR HY000: Operation ALTER USER failed for 'user_name'@'localhost'
show warnings;
Level Code Message
Warning 1819 password_reuse_check: The password was already used
-Error 1819 Your password does not satisfy the current policy requirements
+Error 1819 Your password does not satisfy the current policy requirements (password_reuse_check)
Error 1396 Operation ALTER USER failed for 'user_name'@'localhost'
select hex(hash) from mysql.password_reuse_check_history;
hex(hash)
@@ -58,18 +58,18 @@ Note 1051 Unknown table 'mysql.password_reuse_check_history'
# test error messages
create table mysql.password_reuse_check_history (wrong_structure int);
grant select on *.* to user_name@localhost identified by 'test_pwd';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (password_reuse_check)
show warnings;
Level Code Message
Warning 1105 password_reuse_check:[1054] Unknown column 'hash' in 'field list'
-Error 1819 Your password does not satisfy the current policy requirements
+Error 1819 Your password does not satisfy the current policy requirements (password_reuse_check)
set global password_reuse_check_interval= 10;
grant select on *.* to user_name@localhost identified by 'test_pwd';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (password_reuse_check)
show warnings;
Level Code Message
Warning 1105 password_reuse_check:[1054] Unknown column 'time' in 'where clause'
-Error 1819 Your password does not satisfy the current policy requirements
+Error 1819 Your password does not satisfy the current policy requirements (password_reuse_check)
drop table mysql.password_reuse_check_history;
#
# MDEV-28838: password_reuse_check plugin mixes username and password
diff --git a/mysql-test/suite/plugins/r/simple_password_check.result b/mysql-test/suite/plugins/r/simple_password_check.result
index 0617e7872aa..30f68ba8193 100644
--- a/mysql-test/suite/plugins/r/simple_password_check.result
+++ b/mysql-test/suite/plugins/r/simple_password_check.result
@@ -75,13 +75,37 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
GLOBAL_VALUE_PATH NULL
create user foo1 identified by 'pwd';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
+show warnings;
+Level Code Message
+Warning 1819 simple_password_check: Too short password (< 8)
+Warning 1819 simple_password_check: Not enough upper case letters (< 1)
+Warning 1819 simple_password_check: Not enough digits (< 1)
+Warning 1819 simple_password_check: Not enough special characters (< 1)
+Error 1819 Your password does not satisfy the current policy requirements (simple_password_check)
+Error 1396 Operation CREATE USER failed for 'foo1'@'%'
create user foo1;
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
+show warnings;
+Level Code Message
+Warning 1819 simple_password_check: The password equal to the user name
+Error 1819 Your password does not satisfy the current policy requirements (simple_password_check)
+Error 1396 Operation CREATE USER failed for 'foo1'@'%'
grant select on *.* to foo1 identified by 'pwd';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
+show warnings;
+Level Code Message
+Warning 1819 simple_password_check: Too short password (< 8)
+Warning 1819 simple_password_check: Not enough upper case letters (< 1)
+Warning 1819 simple_password_check: Not enough digits (< 1)
+Warning 1819 simple_password_check: Not enough special characters (< 1)
+Error 1819 Your password does not satisfy the current policy requirements (simple_password_check)
grant select on *.* to `FooBar1!` identified by 'FooBar1!';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
+show warnings;
+Level Code Message
+Warning 1819 simple_password_check: The password equal to the user name
+Error 1819 Your password does not satisfy the current policy requirements (simple_password_check)
grant select on *.* to `BarFoo1!` identified by 'FooBar1!';
drop user `BarFoo1!`;
create user foo1 identified by 'aA.12345';
@@ -103,28 +127,64 @@ simple_password_check_other_characters 3
create user foo1 identified by '123:qwe:ASD!';
drop user foo1;
create user foo1 identified by '-23:qwe:ASD!';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
+show warnings;
+Level Code Message
+Warning 1819 simple_password_check: Not enough digits (< 3)
+Error 1819 Your password does not satisfy the current policy requirements (simple_password_check)
+Error 1396 Operation CREATE USER failed for 'foo1'@'%'
create user foo1 identified by '123:4we:ASD!';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
+show warnings;
+Level Code Message
+Warning 1819 simple_password_check: Not enough lower case letters (< 3)
+Error 1819 Your password does not satisfy the current policy requirements (simple_password_check)
+Error 1396 Operation CREATE USER failed for 'foo1'@'%'
create user foo1 identified by '123:qwe:4SD!';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
+show warnings;
+Level Code Message
+Warning 1819 simple_password_check: Not enough upper case letters (< 3)
+Error 1819 Your password does not satisfy the current policy requirements (simple_password_check)
+Error 1396 Operation CREATE USER failed for 'foo1'@'%'
create user foo1 identified by '123:qwe:ASD4';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
+show warnings;
+Level Code Message
+Warning 1819 simple_password_check: Not enough special characters (< 3)
+Error 1819 Your password does not satisfy the current policy requirements (simple_password_check)
+Error 1396 Operation CREATE USER failed for 'foo1'@'%'
create user foo1 identified by '123:qwe:ASD!';
set password for foo1 = password('qwe:-23:ASD!');
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
+show warnings;
+Level Code Message
+Warning 1819 simple_password_check: Not enough digits (< 3)
+Error 1819 Your password does not satisfy the current policy requirements (simple_password_check)
set password for foo1 = old_password('4we:123:ASD!');
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
set password for foo1 = password('qwe:123:4SD!');
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
+show warnings;
+Level Code Message
+Warning 1819 simple_password_check: Not enough upper case letters (< 3)
+Error 1819 Your password does not satisfy the current policy requirements (simple_password_check)
set password for foo1 = old_password('qwe:123:ASD4');
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
+show warnings;
+Level Code Message
+Warning 1819 simple_password_check: Not enough special characters (< 3)
+Error 1819 Your password does not satisfy the current policy requirements (simple_password_check)
set password for foo1 = password('qwe:123:ASD!');
select @@strict_password_validation;
@@strict_password_validation
1
set password for foo1 = '';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
+show warnings;
+Level Code Message
+Warning 1819 simple_password_check: The password equal to the user name
+Error 1819 Your password does not satisfy the current policy requirements (simple_password_check)
set password for foo1 = '2222222222222222';
ERROR HY000: The MariaDB server is running with the --strict-password-validation option so it cannot execute this statement
set password for foo1 = '11111111111111111111111111111111111111111';
@@ -138,15 +198,24 @@ ERROR HY000: The MariaDB server is running with the --strict-password-validation
grant select on *.* to foo2 identified with mysql_old_password using '2222222222222222';
ERROR HY000: The MariaDB server is running with the --strict-password-validation option so it cannot execute this statement
create user foo2 identified with mysql_native_password using '';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
+show warnings;
+Level Code Message
+Warning 1819 simple_password_check: The password equal to the user name
+Error 1819 Your password does not satisfy the current policy requirements (simple_password_check)
+Error 1396 Operation CREATE USER failed for 'foo2'@'%'
grant select on *.* to foo2 identified with mysql_old_password using '';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
grant select on *.* to foo2 identified with mysql_old_password;
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
update mysql.global_priv set priv=json_set(priv, '$.authentication_string', 'xxx') where user='foo1';
set global strict_password_validation=0;
set password for foo1 = '';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
+show warnings;
+Level Code Message
+Warning 1819 simple_password_check: The password equal to the user name
+Error 1819 Your password does not satisfy the current policy requirements (simple_password_check)
set password for foo1 = '2222222222222222';
set password for foo1 = '11111111111111111111111111111111111111111';
create user foo2 identified by password '11111111111111111111111111111111111111111';
diff --git a/mysql-test/suite/plugins/r/two_password_validations.result b/mysql-test/suite/plugins/r/two_password_validations.result
index dc6bab3c2d5..4bd674baebb 100644
--- a/mysql-test/suite/plugins/r/two_password_validations.result
+++ b/mysql-test/suite/plugins/r/two_password_validations.result
@@ -5,16 +5,18 @@ install soname "cracklib_password_check";
grant select on *.* to foobar identified by 'q$%^&*R1234ty';
drop user foobar;
grant select on *.* to Fff_fff1 identified by '1fff_ffF';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (cracklib_password_check)
show warnings;
Level Code Message
Warning 1819 cracklib: it does not contain enough DIFFERENT characters
-Error 1819 Your password does not satisfy the current policy requirements
+Error 1819 Your password does not satisfy the current policy requirements (cracklib_password_check)
grant select on *.* to foobar identified by 'q-%^&*rty';
-ERROR HY000: Your password does not satisfy the current policy requirements
+ERROR HY000: Your password does not satisfy the current policy requirements (simple_password_check)
show warnings;
Level Code Message
-Error 1819 Your password does not satisfy the current policy requirements
+Warning 1819 simple_password_check: Not enough upper case letters (< 1)
+Warning 1819 simple_password_check: Not enough digits (< 1)
+Error 1819 Your password does not satisfy the current policy requirements (simple_password_check)
uninstall plugin simple_password_check;
grant select on *.* to foobar identified by 'q-%^&*rty';
drop user foobar;
diff --git a/mysql-test/suite/plugins/t/simple_password_check.test b/mysql-test/suite/plugins/t/simple_password_check.test
index dfb078df638..3ce2d86cd68 100644
--- a/mysql-test/suite/plugins/t/simple_password_check.test
+++ b/mysql-test/suite/plugins/t/simple_password_check.test
@@ -15,16 +15,20 @@ select * from information_schema.system_variables where variable_name like 'simp
--error ER_NOT_VALID_PASSWORD
create user foo1 identified by 'pwd';
+show warnings;
# Create user with no password.
--error ER_NOT_VALID_PASSWORD
create user foo1;
+show warnings;
--error ER_NOT_VALID_PASSWORD
grant select on *.* to foo1 identified by 'pwd';
+show warnings;
--error ER_NOT_VALID_PASSWORD
grant select on *.* to `FooBar1!` identified by 'FooBar1!';
+show warnings;
grant select on *.* to `BarFoo1!` identified by 'FooBar1!';
drop user `BarFoo1!`;
@@ -43,25 +47,32 @@ drop user foo1;
--error ER_NOT_VALID_PASSWORD
create user foo1 identified by '-23:qwe:ASD!';
+show warnings;
--error ER_NOT_VALID_PASSWORD
create user foo1 identified by '123:4we:ASD!';
+show warnings;
--error ER_NOT_VALID_PASSWORD
create user foo1 identified by '123:qwe:4SD!';
+show warnings;
--error ER_NOT_VALID_PASSWORD
create user foo1 identified by '123:qwe:ASD4';
+show warnings;
create user foo1 identified by '123:qwe:ASD!';
--error ER_NOT_VALID_PASSWORD
set password for foo1 = password('qwe:-23:ASD!');
+show warnings;
--error ER_NOT_VALID_PASSWORD
set password for foo1 = old_password('4we:123:ASD!');
--error ER_NOT_VALID_PASSWORD
set password for foo1 = password('qwe:123:4SD!');
+show warnings;
--error ER_NOT_VALID_PASSWORD
set password for foo1 = old_password('qwe:123:ASD4');
+show warnings;
set password for foo1 = password('qwe:123:ASD!');
# now, strict_password_validation
@@ -69,6 +80,7 @@ select @@strict_password_validation;
--error ER_NOT_VALID_PASSWORD
set password for foo1 = '';
+show warnings;
--error ER_OPTION_PREVENTS_STATEMENT
set password for foo1 = '2222222222222222';
--error ER_OPTION_PREVENTS_STATEMENT
@@ -83,6 +95,7 @@ create user foo2 identified with mysql_native_password using '111111111111111111
grant select on *.* to foo2 identified with mysql_old_password using '2222222222222222';
--error ER_NOT_VALID_PASSWORD
create user foo2 identified with mysql_native_password using '';
+show warnings;
--error ER_NOT_VALID_PASSWORD
grant select on *.* to foo2 identified with mysql_old_password using '';
--error ER_NOT_VALID_PASSWORD
@@ -95,6 +108,7 @@ set global strict_password_validation=0;
--error ER_NOT_VALID_PASSWORD
set password for foo1 = '';
+show warnings;
set password for foo1 = '2222222222222222';
set password for foo1 = '11111111111111111111111111111111111111111';
create user foo2 identified by password '11111111111111111111111111111111111111111';
diff --git a/mysql-test/suite/roles/definer.result b/mysql-test/suite/roles/definer.result
index a83a42a0c67..235716fca77 100644
--- a/mysql-test/suite/roles/definer.result
+++ b/mysql-test/suite/roles/definer.result
@@ -280,39 +280,34 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v1` (
- `a+b` tinyint NOT NULL,
- `c` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v1` AS SELECT
+ 1 AS `a+b`,
+ 1 AS `c` */;
SET character_set_client = @saved_cs_client;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v2` (
- `a+b` tinyint NOT NULL,
- `c` tinyint NOT NULL,
- `current_role()` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v2` AS SELECT
+ 1 AS `a+b`,
+ 1 AS `c`,
+ 1 AS `current_role()` */;
SET character_set_client = @saved_cs_client;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v3` (
- `a+b` tinyint NOT NULL,
- `c` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v3` AS SELECT
+ 1 AS `a+b`,
+ 1 AS `c` */;
SET character_set_client = @saved_cs_client;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v4` (
- `a+b` tinyint NOT NULL,
- `c` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v4` AS SELECT
+ 1 AS `a+b`,
+ 1 AS `c` */;
SET character_set_client = @saved_cs_client;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
-/*!50001 CREATE TABLE `v5` (
- `a+b` tinyint NOT NULL,
- `c` tinyint NOT NULL
-) ENGINE=MyISAM */;
+/*!50001 CREATE VIEW `v5` AS SELECT
+ 1 AS `a+b`,
+ 1 AS `c` */;
SET character_set_client = @saved_cs_client;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET latin1 */;
@@ -539,7 +534,7 @@ DELIMITER ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
USE `test`;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
+/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -550,7 +545,7 @@ USE `test`;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
+/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -561,7 +556,7 @@ USE `test`;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v3`*/;
+/*!50001 DROP VIEW IF EXISTS `v3`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -574,7 +569,7 @@ USE `test`;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v4`*/;
+/*!50001 DROP VIEW IF EXISTS `v4`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -587,7 +582,7 @@ USE `test`;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v5`*/;
+/*!50001 DROP VIEW IF EXISTS `v5`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
diff --git a/mysql-test/suite/roles/rename_user.result b/mysql-test/suite/roles/rename_user.result
index 9550e15953a..367f6e4b0fe 100644
--- a/mysql-test/suite/roles/rename_user.result
+++ b/mysql-test/suite/roles/rename_user.result
@@ -25,3 +25,12 @@ newhost test_user_rm test_role1 N
delete from mysql.roles_mapping;
delete from mysql.user where user like 'test%';
flush privileges;
+#
+# MDEV-29131 Assertion `status == 0' failed when renaming user after deleting table roles_mapping
+#
+create role r;
+rename table mysql.roles_mapping to test.t1;
+rename user current_user to a@a;
+rename user a@a to root@localhost;
+rename table test.t1 to mysql.roles_mapping;
+drop role r;
diff --git a/mysql-test/suite/roles/rename_user.test b/mysql-test/suite/roles/rename_user.test
index 45429b76666..8c899352847 100644
--- a/mysql-test/suite/roles/rename_user.test
+++ b/mysql-test/suite/roles/rename_user.test
@@ -36,3 +36,13 @@ delete from mysql.roles_mapping;
delete from mysql.user where user like 'test%';
flush privileges;
+--echo #
+--echo # MDEV-29131 Assertion `status == 0' failed when renaming user after deleting table roles_mapping
+--echo #
+create role r;
+rename table mysql.roles_mapping to test.t1;
+rename user current_user to a@a;
+rename user a@a to root@localhost;
+rename table test.t1 to mysql.roles_mapping;
+drop role r;
+
diff --git a/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result b/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result
index 64e555e96e1..53420891754 100644
--- a/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result
+++ b/mysql-test/suite/rpl/r/rpl_blackhole_row_annotate.result
@@ -200,7 +200,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_hrtime.result b/mysql-test/suite/rpl/r/rpl_hrtime.result
index 406b1d145d1..5f0b8f4123a 100644
--- a/mysql-test/suite/rpl/r/rpl_hrtime.result
+++ b/mysql-test/suite/rpl/r/rpl_hrtime.result
@@ -37,7 +37,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1293832861/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result
index 5ec40d81ade..b88b47b2dfa 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev382.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev382.result
@@ -179,7 +179,7 @@ ROLLBACK/*!*/;
use `db1``; select 'oops!'`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -279,7 +279,7 @@ ROLLBACK/*!*/;
use `db1``; select 'oops!'`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -388,7 +388,7 @@ START TRANSACTION
use `ts``et`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_old_master_29078.result b/mysql-test/suite/rpl/r/rpl_old_master_29078.result
new file mode 100644
index 00000000000..8d9f7e8e789
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_old_master_29078.result
@@ -0,0 +1,92 @@
+#
+# MDEV-29078 For old binary logs explicit_defaults_for_timestamp presumed to be OFF, server value ignored
+#
+include/master-slave.inc
+[connection master]
+connection slave;
+include/stop_slave.inc
+connection master;
+flush binary logs;
+create table t2 (a timestamp);
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+ROLLBACK/*!*/;
+use `test`/*!*/;
+SET TIMESTAMP=1658586280/*!*/;
+SET @@session.pseudo_thread_id=999999999/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
+SET @@session.sql_mode=1411383296/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C utf8mb3 *//*!*/;
+SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+create table t1 (f1 timestamp, f2 timestamp)
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1658586288/*!*/;
+insert t1 values (NULL, NULL)
+/*!*/;
+SET TIMESTAMP=1658586288/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1658586335/*!*/;
+insert t1 () values ()
+/*!*/;
+SET TIMESTAMP=1658586335/*!*/;
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
+connection slave;
+set global explicit_defaults_for_timestamp=1;
+reset slave;
+include/start_slave.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` timestamp NULL DEFAULT NULL,
+ `f2` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+set time_zone='+2:00';
+select * from t1;
+f1 f2
+NULL NULL
+NULL NULL
+drop table t1;
+include/stop_slave.inc
+set global explicit_defaults_for_timestamp=0;
+reset slave;
+include/start_slave.inc
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
+ `f2` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+select * from t1;
+f1 f2
+2022-07-23 16:24:48 2022-07-23 16:24:48
+2022-07-23 16:25:35 0000-00-00 00:00:00
+drop table t1;
+connection master;
+drop table t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
index baabcf65dc5..83f16122d96 100644
--- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
@@ -168,7 +168,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -191,7 +191,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -306,7 +306,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -335,7 +335,7 @@ ROLLBACK/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index dad89db8135..3c3fed4d9cf 100644
--- a/mysql-test/suite/rpl/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -784,7 +784,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
SET TIMESTAMP=t/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=0/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_timestamp.result b/mysql-test/suite/rpl/r/rpl_timestamp.result
new file mode 100644
index 00000000000..862f19b143c
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_timestamp.result
@@ -0,0 +1,48 @@
+include/master-slave.inc
+[connection master]
+set timestamp=1656940000;
+set explicit_defaults_for_timestamp=!@@explicit_defaults_for_timestamp;
+connection master;
+create table t1 (f1 timestamp, f2 timestamp);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` timestamp NULL DEFAULT NULL,
+ `f2` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection slave;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` timestamp NULL DEFAULT NULL,
+ `f2` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection master;
+drop table t1;
+flush binary logs;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+ROLLBACK/*!*/;
+use `test`/*!*/;
+SET TIMESTAMP=1656940000/*!*/;
+SET @@session.pseudo_thread_id=999999999/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=1/*!*/;
+SET @@session.sql_mode=1411383296/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+create table t1 (f1 timestamp, f2 timestamp)
+/*!*/;
+SET TIMESTAMP=1656940000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_old_master_29078-master.opt b/mysql-test/suite/rpl/t/rpl_old_master_29078-master.opt
new file mode 100644
index 00000000000..3efc6fb8e29
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_old_master_29078-master.opt
@@ -0,0 +1 @@
+--version=10.5.99
diff --git a/mysql-test/suite/rpl/t/rpl_old_master_29078.test b/mysql-test/suite/rpl/t/rpl_old_master_29078.test
new file mode 100644
index 00000000000..b19fd6466e5
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_old_master_29078.test
@@ -0,0 +1,49 @@
+--echo #
+--echo # MDEV-29078 For old binary logs explicit_defaults_for_timestamp presumed to be OFF, server value ignored
+--echo #
+
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+--connection slave
+--source include/stop_slave.inc
+
+--connection master
+--let $datadir= `SELECT @@datadir`
+
+flush binary logs;
+create table t2 (a timestamp);
+
+--save_master_pos
+
+--remove_file $datadir/master-bin.000001
+--copy_file $MYSQL_TEST_DIR/std_data/mdev29078-mysql-bin.000001 $datadir/master-bin.000001
+
+--exec $MYSQL_BINLOG --short-form $datadir/master-bin.000001
+
+--connection slave
+
+set global explicit_defaults_for_timestamp=1;
+reset slave;
+--source include/start_slave.inc
+--sync_with_master
+show create table t1;
+show create table t2;
+set time_zone='+2:00';
+select * from t1;
+drop table t1;
+--source include/stop_slave.inc
+
+set global explicit_defaults_for_timestamp=0;
+reset slave;
+--source include/start_slave.inc
+--sync_with_master
+show create table t1;
+show create table t2;
+select * from t1;
+drop table t1;
+
+--connection master
+drop table t2;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_timestamp.test b/mysql-test/suite/rpl/t/rpl_timestamp.test
new file mode 100644
index 00000000000..a3f4010f24a
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_timestamp.test
@@ -0,0 +1,18 @@
+source include/master-slave.inc;
+
+set timestamp=1656940000;
+set explicit_defaults_for_timestamp=!@@explicit_defaults_for_timestamp;
+connection master;
+
+create table t1 (f1 timestamp, f2 timestamp);
+show create table t1;
+sync_slave_with_master;
+show create table t1;
+connection master;
+drop table t1;
+flush binary logs;
+
+let $datadir=`select @@datadir`;
+exec $MYSQL_BINLOG -s $datadir/master-bin.000001;
+
+source include/rpl_end.inc;
diff --git a/mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc b/mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc
index 1fea4ca5bb9..0cd8aa2c568 100644
--- a/mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc
+++ b/mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc
@@ -5,19 +5,10 @@ CREATE TABLE t1 (a TIMESTAMP NULL);
SHOW CREATE TABLE t1;
DROP TABLE t1;
-
-if (`SELECT @@explicit_defaults_for_timestamp=0`)
-{
- --error ER_INVALID_DEFAULT
- CREATE TABLE t1 (a TIMESTAMP DEFAULT NULL);
-}
-
-if (`SELECT @@explicit_defaults_for_timestamp=1`)
-{
- CREATE TABLE t1 (a TIMESTAMP DEFAULT NULL);
- SHOW CREATE TABLE t1;
- DROP TABLE t1;
-}
+CREATE TABLE t1 (a TIMESTAMP DEFAULT NULL);
+INSERT t1 () VALUES ();
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP DEFAULT '0000-00-00 00:00:00');
SHOW CREATE TABLE t1;
@@ -110,3 +101,34 @@ SELECT * FROM t1;
DROP TABLE t1;
SET sql_mode=DEFAULT;
SET timestamp=DEFAULT;
+
+--echo #
+--echo # MDEV-29075 Changing explicit_defaults_for_timestamp within stored procedure works inconsistently
+--echo #
+set statement explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp for create table t1 (ts timestamp);
+show create table t1;
+drop table t1;
+
+--delimiter $
+create procedure pr()
+begin
+ set explicit_defaults_for_timestamp= 1-@@explicit_defaults_for_timestamp;
+ create table t1 (ts timestamp);
+end $
+--delimiter ;
+
+call pr();
+show create table t1;
+drop procedure pr;
+drop table t1;
+
+prepare stmt from 'create or replace table t1 (a timestamp)';
+execute stmt;
+show create table t1;
+set explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp;
+execute stmt;
+show create table t1;
+set explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp;
+execute stmt;
+show create table t1;
+drop table t1;
diff --git a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_basic.result b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_basic.result
deleted file mode 100644
index d9a9a2909ce..00000000000
--- a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_basic.result
+++ /dev/null
@@ -1,21 +0,0 @@
-select @@global.explicit_defaults_for_timestamp;
-@@global.explicit_defaults_for_timestamp
-0
-select @@session.explicit_defaults_for_timestamp;
-ERROR HY000: Variable 'explicit_defaults_for_timestamp' is a GLOBAL variable
-show global variables like 'explicit_defaults_for_timestamp';
-Variable_name Value
-explicit_defaults_for_timestamp OFF
-show session variables like 'explicit_defaults_for_timestamp';
-Variable_name Value
-explicit_defaults_for_timestamp OFF
-select * from information_schema.global_variables where variable_name='explicit_defaults_for_timestamp';
-VARIABLE_NAME VARIABLE_VALUE
-EXPLICIT_DEFAULTS_FOR_TIMESTAMP OFF
-select * from information_schema.session_variables where variable_name='explicit_defaults_for_timestamp';
-VARIABLE_NAME VARIABLE_VALUE
-EXPLICIT_DEFAULTS_FOR_TIMESTAMP OFF
-set global explicit_defaults_for_timestamp=true;
-ERROR HY000: Variable 'explicit_defaults_for_timestamp' is a read only variable
-set session explicit_defaults_for_timestamp=true;
-ERROR HY000: Variable 'explicit_defaults_for_timestamp' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result
index e94766be8bd..016b130285f 100644
--- a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result
+++ b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result
@@ -1,3 +1,4 @@
+set @@explicit_defaults_for_timestamp=0;
CREATE TABLE t1 (a TIMESTAMP);
SHOW CREATE TABLE t1;
Table Create Table
@@ -13,7 +14,13 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP DEFAULT NULL);
-ERROR 42000: Invalid default value for 'a'
+INSERT t1 () VALUES ();
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP DEFAULT '0000-00-00 00:00:00');
SHOW CREATE TABLE t1;
Table Create Table
@@ -186,3 +193,48 @@ a
DROP TABLE t1;
SET sql_mode=DEFAULT;
SET timestamp=DEFAULT;
+#
+# MDEV-29075 Changing explicit_defaults_for_timestamp within stored procedure works inconsistently
+#
+set statement explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp for create table t1 (ts timestamp);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `ts` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create procedure pr()
+begin
+set explicit_defaults_for_timestamp= 1-@@explicit_defaults_for_timestamp;
+create table t1 (ts timestamp);
+end $
+call pr();
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `ts` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop procedure pr;
+drop table t1;
+prepare stmt from 'create or replace table t1 (a timestamp)';
+execute stmt;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+set explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp;
+execute stmt;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+set explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp;
+execute stmt;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
diff --git a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result
index dac796b4319..e4aabdef93e 100644
--- a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result
+++ b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result
@@ -1,3 +1,4 @@
+set @@explicit_defaults_for_timestamp=1;
CREATE TABLE t1 (a TIMESTAMP);
SHOW CREATE TABLE t1;
Table Create Table
@@ -13,6 +14,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP DEFAULT NULL);
+INSERT t1 () VALUES ();
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -193,3 +195,48 @@ a
DROP TABLE t1;
SET sql_mode=DEFAULT;
SET timestamp=DEFAULT;
+#
+# MDEV-29075 Changing explicit_defaults_for_timestamp within stored procedure works inconsistently
+#
+set statement explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp for create table t1 (ts timestamp);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `ts` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create procedure pr()
+begin
+set explicit_defaults_for_timestamp= 1-@@explicit_defaults_for_timestamp;
+create table t1 (ts timestamp);
+end $
+call pr();
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `ts` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop procedure pr;
+drop table t1;
+prepare stmt from 'create or replace table t1 (a timestamp)';
+execute stmt;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+set explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp;
+execute stmt;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NULL DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+set explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp;
+execute stmt;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
index 906da9edace..4d0f34bf451 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
@@ -923,14 +923,14 @@ ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME EXPLICIT_DEFAULTS_FOR_TIMESTAMP
-VARIABLE_SCOPE GLOBAL
+VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT This option causes CREATE TABLE to create all TIMESTAMP columns as NULL with DEFAULT NULL attribute, Without this option, TIMESTAMP columns are NOT NULL and have implicit DEFAULT clauses.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
-READ_ONLY YES
+READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME EXTERNAL_USER
VARIABLE_SCOPE SESSION ONLY
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
index be89907c1cb..abf738f5c15 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -953,14 +953,14 @@ ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME EXPLICIT_DEFAULTS_FOR_TIMESTAMP
-VARIABLE_SCOPE GLOBAL
+VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT This option causes CREATE TABLE to create all TIMESTAMP columns as NULL with DEFAULT NULL attribute, Without this option, TIMESTAMP columns are NOT NULL and have implicit DEFAULT clauses.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
-READ_ONLY YES
+READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME EXTERNAL_USER
VARIABLE_SCOPE SESSION ONLY
diff --git a/mysql-test/suite/sys_vars/t/completion_type_func.test b/mysql-test/suite/sys_vars/t/completion_type_func.test
index 2411cacf8bb..5c343cee9ab 100644
--- a/mysql-test/suite/sys_vars/t/completion_type_func.test
+++ b/mysql-test/suite/sys_vars/t/completion_type_func.test
@@ -146,7 +146,7 @@ COMMIT;
--echo ## Inserting rows should give error here because connection should ##
--echo ## disconnect after using COMMIT ##
---Error 2006,2013,ER_QUERY_INTERRUPTED,ER_CONNECTION_KILLED
+--Error 2006,2013,ER_QUERY_INTERRUPTED,ER_CONNECTION_KILLED,5014
INSERT INTO t1 VALUES(4,'Record_4');
connection test_con2;
@@ -160,7 +160,7 @@ INSERT INTO t1 VALUES(12,'Record_12');
ROLLBACK;
--echo ## Expect a failure due to COMMIT/ROLLBACK AND RELEASE behavior ##
---Error 2006,2013,ER_QUERY_INTERRUPTED,ER_CONNECTION_KILLED
+--Error 2006,2013,ER_QUERY_INTERRUPTED,ER_CONNECTION_KILLED,5014
INSERT INTO t1 VALUES(4,'Record_4');
connection default;
diff --git a/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_basic.test b/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_basic.test
deleted file mode 100644
index da451aec610..00000000000
--- a/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_basic.test
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# show the global and session values;
-#
-select @@global.explicit_defaults_for_timestamp;
-
-#
-# Test that it's a global-only variable
-#
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.explicit_defaults_for_timestamp;
-
-show global variables like 'explicit_defaults_for_timestamp';
-show session variables like 'explicit_defaults_for_timestamp';
-
---disable_warnings
-select * from information_schema.global_variables where variable_name='explicit_defaults_for_timestamp';
-select * from information_schema.session_variables where variable_name='explicit_defaults_for_timestamp';
---enable_warnings
-
-#
-# show that it's read-only
-#
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global explicit_defaults_for_timestamp=true;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set session explicit_defaults_for_timestamp=true;
diff --git a/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_off.test b/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_off.test
index 2159b7cb6a8..3f881761504 100644
--- a/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_off.test
+++ b/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_off.test
@@ -1,8 +1,3 @@
---disable_query_log
-if (`SELECT @@explicit_defaults_for_timestamp`)
-{
- Skip Need explicit-defaults-for-timestamp=off;
-}
---enable_query_log
+set @@explicit_defaults_for_timestamp=0;
--source inc/explicit_defaults_for_timestamp.inc
diff --git a/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on-master.opt b/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on-master.opt
deleted file mode 100644
index b84d51e2ad1..00000000000
--- a/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---explicit-defaults-for-timestamp=on
diff --git a/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on.test b/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on.test
index 5c03eaa28de..67b93824eb4 100644
--- a/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on.test
+++ b/mysql-test/suite/sys_vars/t/explicit_defaults_for_timestamp_on.test
@@ -1,8 +1,3 @@
---disable_query_log
-if (!`SELECT @@explicit_defaults_for_timestamp`)
-{
- Skip Need explicit-defaults-for-timestamp=on;
-}
---enable_query_log
+set @@explicit_defaults_for_timestamp=1;
--source inc/explicit_defaults_for_timestamp.inc
diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result
index 4ec57413a15..a09939c8cc2 100644
--- a/mysql-test/suite/vcol/r/vcol_misc.result
+++ b/mysql-test/suite/vcol/r/vcol_misc.result
@@ -550,3 +550,19 @@ drop table t1;
#
# End of 10.2 tests
#
+#
+# RAND is session func
+#
+create table t1 (a int, b float default rand(1));
+insert into t1 (a) values (1);
+insert into t1 (a) values (2);
+insert into t1 (a) values (3);
+select * from t1;
+a b
+1 0.405404
+2 0.405404
+3 0.405404
+drop table t1;
+#
+# End of 10.3 tests
+#
diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test
index 3062e5a685d..c3f36d93316 100644
--- a/mysql-test/suite/vcol/t/vcol_misc.test
+++ b/mysql-test/suite/vcol/t/vcol_misc.test
@@ -514,3 +514,17 @@ drop table t1;
--echo #
--echo # End of 10.2 tests
--echo #
+
+--echo #
+--echo # RAND is session func
+--echo #
+create table t1 (a int, b float default rand(1));
+insert into t1 (a) values (1);
+insert into t1 (a) values (2);
+insert into t1 (a) values (3);
+select * from t1;
+drop table t1;
+
+--echo #
+--echo # End of 10.3 tests
+--echo #
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 653fe844093..9f13ca7a424 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -1632,7 +1632,8 @@ void my_print_help(const struct my_option *options)
}
}
putchar('\n');
- if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL)
+ if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL ||
+ (optp->var_type & GET_TYPE_MASK) == GET_BIT)
{
if (optp->def_value != 0)
{
diff --git a/mysys/psi_noop.c b/mysys/psi_noop.c
index e81ad4893b7..403be3c94e9 100644
--- a/mysys/psi_noop.c
+++ b/mysys/psi_noop.c
@@ -1,17 +1,29 @@
-/* Copyright (c) 2011, 2016, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
+
+ Without limiting anything contained in the foregoing, this file,
+ which is part of C Driver for MySQL (Connector/C), is also subject to the
+ Universal FOSS Exception, version 1.0, a copy of which can be found at
+ http://oss.oracle.com/licenses/universal-foss-exception.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ GNU General Public License, version 2.0, for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
+ 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
/*
Always provide the noop performance interface, for plugins.
@@ -262,6 +274,11 @@ static void set_thread_noop(PSI_thread* thread NNN)
return;
}
+static void set_thread_peer_port_noop(PSI_thread * thread NNN, uint port NNN)
+{
+ return;
+}
+
static void delete_current_thread_noop(void)
{
return;
@@ -481,7 +498,7 @@ static void end_file_rename_wait_noop(PSI_file_locker *locker NNN,
static PSI_stage_progress*
start_stage_noop(PSI_stage_key key NNN,
- const char *src_file NNN, int src_line NNN)
+ const char *src_file NNN, int src_line NNN)
{
return NULL;
}
@@ -776,9 +793,9 @@ digest_end_noop(PSI_digest_locker *locker NNN,
}
static int
-set_thread_connect_attrs_noop(const char *buffer NNN,
- uint length NNN,
- const void *from_cs NNN)
+set_thread_connect_attrs_noop(const char *buffer __attribute__ ((unused)),
+ uint length __attribute__ ((unused)),
+ const void *from_cs __attribute__ ((unused)))
{
return 0;
}
@@ -1025,7 +1042,9 @@ static PSI PSI_noop=
set_metadata_lock_status_noop,
destroy_metadata_lock_noop,
start_metadata_wait_noop,
- end_metadata_wait_noop
+ end_metadata_wait_noop,
+
+ set_thread_peer_port_noop
};
/**
diff --git a/plugin/simple_password_check/simple_password_check.c b/plugin/simple_password_check/simple_password_check.c
index e9d852d54ab..929906c6afe 100644
--- a/plugin/simple_password_check/simple_password_check.c
+++ b/plugin/simple_password_check/simple_password_check.c
@@ -31,7 +31,13 @@ static int validate(const MYSQL_CONST_LEX_STRING *username,
const char *ptr= password->str, *end= ptr + length;
if (strncmp(password->str, username->str, length) == 0)
+ {
+ // warning used to do not change error code
+ my_printf_error(ER_NOT_VALID_PASSWORD,
+ "simple_password_check: The password equal to the user name",
+ ME_WARNING);
return 1;
+ }
/* everything non-ascii is the "other" character and is good for the password */
for(; ptr < end; ptr++)
@@ -45,6 +51,28 @@ static int validate(const MYSQL_CONST_LEX_STRING *username,
else
others++;
}
+
+ // warnings used to do not change error code
+ if (length < min_length)
+ my_printf_error(ER_NOT_VALID_PASSWORD,
+ "simple_password_check: Too short password (< %u)",
+ ME_WARNING, min_length);
+ if (uppers < min_letters)
+ my_printf_error(ER_NOT_VALID_PASSWORD,
+ "simple_password_check: Not enough upper case "
+ "letters (< %u)",ME_WARNING, min_letters);
+ if (lowers < min_letters)
+ my_printf_error(ER_NOT_VALID_PASSWORD,
+ "simple_password_check: Not enough lower case "
+ "letters (< %u)",ME_WARNING, min_letters);
+ if (digits < min_digits)
+ my_printf_error(ER_NOT_VALID_PASSWORD,
+ "simple_password_check: Not enough digits (< %u)",
+ ME_WARNING, min_digits);
+ if (others < min_others)
+ my_printf_error(ER_NOT_VALID_PASSWORD,
+ "simple_password_check: Not enough special "
+ "characters (< %u)",ME_WARNING, min_others);
/* remember TRUE means the password failed the validation */
return length < min_length ||
uppers < min_letters ||
diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6.result b/plugin/type_inet/mysql-test/type_inet/type_inet6.result
index 9cb5e3206ad..618883142c1 100644
--- a/plugin/type_inet/mysql-test/type_inet/type_inet6.result
+++ b/plugin/type_inet/mysql-test/type_inet/type_inet6.result
@@ -192,9 +192,9 @@ CREATE TABLE t1 (a INET6);
INSERT INTO t1 VALUES ('x');
ERROR 22007: Incorrect inet6 value: 'x' for column `test`.`t1`.`a` at row 1
INSERT INTO t1 VALUES (1);
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t1`.`a`
INSERT INTO t1 VALUES (TIME'10:20:30');
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t1`.`a`
INSERT INTO t1 VALUES (0x00);
ERROR 22007: Incorrect inet6 value: '\x00' for column `test`.`t1`.`a` at row 1
DROP TABLE t1;
@@ -820,15 +820,15 @@ DROP TABLE t1;
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (CAST('::' AS INET6));
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t1`.`a`
DROP TABLE t1;
CREATE TABLE t1 (a DOUBLE);
INSERT INTO t1 VALUES (CAST('::' AS INET6));
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t1`.`a`
DROP TABLE t1;
CREATE TABLE t1 (a DECIMAL(32,0));
INSERT INTO t1 VALUES (CAST('::' AS INET6));
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t1`.`a`
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(64));
INSERT INTO t1 VALUES (CAST('::' AS INET6));
@@ -1606,7 +1606,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INET6, b INT);
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1614,7 +1614,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INET6, b DOUBLE);
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1622,7 +1622,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INET6, b DECIMAL(32,0));
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1630,7 +1630,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INET6, b YEAR);
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types year and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'year' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1641,7 +1641,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT, b INET6);
INSERT INTO t1 VALUES (1, NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1649,7 +1649,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a DOUBLE, b INET6);
INSERT INTO t1 VALUES (1, NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1657,7 +1657,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a DECIMAL(32,0), b INET6);
INSERT INTO t1 VALUES (1, NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1665,7 +1665,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a YEAR, b INET6);
INSERT INTO t1 VALUES (1, NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types inet6 and year for operation 'SET'
+ERROR HY000: Cannot cast 'year' as 'inet6' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1676,7 +1676,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INET6, b TIME);
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1684,7 +1684,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INET6, b DATE);
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types date and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'date' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1692,7 +1692,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INET6, b DATETIME);
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types datetime and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'datetime' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1700,7 +1700,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INET6, b TIMESTAMP NULL DEFAULT NULL);
INSERT INTO t1 VALUES ('ffff::ffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types timestamp and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'timestamp' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1711,7 +1711,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a TIME, b INET6);
INSERT INTO t1 VALUES ('00:00:00', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1719,7 +1719,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a DATE, b INET6);
INSERT INTO t1 VALUES ('2001-01:01', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types inet6 and date for operation 'SET'
+ERROR HY000: Cannot cast 'date' as 'inet6' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1727,7 +1727,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a DATETIME, b INET6);
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types inet6 and datetime for operation 'SET'
+ERROR HY000: Cannot cast 'datetime' as 'inet6' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1735,7 +1735,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP, b INET6);
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types inet6 and timestamp for operation 'SET'
+ERROR HY000: Cannot cast 'timestamp' as 'inet6' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -1922,7 +1922,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INET6, b INT);
INSERT INTO t1 (a) VALUES ('::');
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t1`.`b`
SELECT * FROM t1;
a b
:: NULL
@@ -1931,7 +1931,7 @@ SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
CREATE TABLE t1 (a INET6, b TIMESTAMP);
INSERT INTO t1 (a) VALUES ('::');
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types timestamp and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'timestamp' in assignment of `test`.`t1`.`b`
SELECT * FROM t1;
a b
:: 2001-01-01 10:20:30
@@ -1940,7 +1940,7 @@ SET timestamp=DEFAULT;
CREATE OR REPLACE TABLE t1 (a INET6);
INSERT INTO t1 (a) VALUES ('::');
ALTER TABLE t1 MODIFY a DATE;
-ERROR HY000: Illegal parameter data types date and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'date' in assignment of `test`.`t1`.`a`
DROP TABLE t1;
#
# MDEV-20818 ER_CRASHED_ON_USAGE or Assertion `length <= column->length' failed in write_block_record on temporary table
diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_decimal.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_decimal.result
index 024b9d012be..230b19f5a42 100644
--- a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_decimal.result
+++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_decimal.result
@@ -6,6 +6,7 @@
#
CREATE TABLE t1 (target INET6 DEFAULT '::0', source DECIMAL(38,0) DEFAULT 0);
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -30,7 +35,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -62,37 +67,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 :: 0
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target decimal(38,0)
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -103,15 +108,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a inet6) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst inet6)
BEGIN
@@ -126,10 +131,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types inet6 and decimal for operation 'SET'
+Error 4078 Cannot cast 'decimal' as 'inet6' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -141,7 +146,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -152,7 +157,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -166,13 +171,14 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
DROP TABLE t1;
CREATE TABLE t1 (target DECIMAL(38,0) DEFAULT 0, source INET6 DEFAULT '::0');
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -197,7 +207,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -229,37 +239,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect decimal value: '::' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 0 ::
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target inet6
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types inet6 and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'inet6' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -270,15 +280,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a decimal(38,0)) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a decimal(38,0)) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst decimal(38,0))
BEGIN
@@ -293,10 +303,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types decimal and inet6 for operation 'SET'
+Error 4078 Cannot cast 'inet6' as 'decimal' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -308,7 +318,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -319,7 +329,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -333,7 +343,7 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types decimal and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'decimal' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double.result
index 41baf7b8ca3..f677e768a7d 100644
--- a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double.result
+++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double.result
@@ -6,6 +6,7 @@
#
CREATE TABLE t1 (target INET6 DEFAULT '::0', source DOUBLE DEFAULT 0);
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -30,7 +35,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -62,37 +67,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 :: 0
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target double
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -103,15 +108,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a inet6) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst inet6)
BEGIN
@@ -126,10 +131,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types inet6 and double for operation 'SET'
+Error 4078 Cannot cast 'double' as 'inet6' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -141,7 +146,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -152,7 +157,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -166,13 +171,14 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
DROP TABLE t1;
CREATE TABLE t1 (target DOUBLE DEFAULT 0, source INET6 DEFAULT '::0');
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -197,7 +207,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -229,37 +239,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect double value: '::' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 0 ::
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target inet6
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types inet6 and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -270,15 +280,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a double) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a double) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst double)
BEGIN
@@ -293,10 +303,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types double and inet6 for operation 'SET'
+Error 4078 Cannot cast 'inet6' as 'double' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -308,7 +318,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -319,7 +329,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -333,7 +343,7 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types double and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_loose.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_loose.result
new file mode 100644
index 00000000000..e624b95b980
--- /dev/null
+++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_loose.result
@@ -0,0 +1,406 @@
+#
+# Start of 10.7 tests
+#
+#
+# MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
+#
+SET sql_mode='';
+CREATE TABLE t1 (target INET6 DEFAULT '::0', source DOUBLE DEFAULT 0);
+# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
+SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
+WHERE COLUMN_NAME='source'
+ AND TABLE_NAME='t1'
+ AND TABLE_SCHEMA='test');
+SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
+WHERE COLUMN_NAME='target'
+ AND TABLE_NAME='t1'
+ AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
+CREATE TABLE t2 LIKE t1;
+ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
+INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL,
+ `target` inet6 DEFAULT '::',
+ `source` double DEFAULT 0,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TABLE t3 LIKE t2;
+INSERT INTO t3 VALUES
+(1,
+(SELECT source FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1));
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+DROP TABLE t3;
+SET sql_mode='';
+CREATE TABLE t3 LIKE t2;
+ALTER TABLE t3 ENGINE=MyISAM;
+EXECUTE IMMEDIATE
+CONCAT('CREATE VIEW v3 AS SELECT id,',
+IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
+IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
+' FROM t3');
+INSERT INTO t3 VALUES
+(1,
+(SELECT target FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1)),
+(2,
+(SELECT source FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1));
+Warnings:
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2
+SELECT * FROM v3;
+id target source
+1 :: 0
+2 :: 0
+TRUNCATE TABLE t3;
+SET sql_mode=STRICT_ALL_TABLES;
+INSERT INTO t3 VALUES
+(1,
+(SELECT target FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1)),
+(2,
+(SELECT source FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1));
+ERROR 22007: Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2
+SELECT * FROM v3;
+id target source
+1 :: 0
+TRUNCATE TABLE t3;
+SET sql_mode=@sql_mode_save;
+DROP TABLE t3;
+DROP VIEW v3;
+CREATE TABLE t3 LIKE t2;
+INSERT INTO t3 SELECT id,source,source FROM t2;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+UPDATE t3 SET target=source;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column ``.`(temporary)`.`target` at row 1
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
+SELECT @alter;
+@alter
+ALTER TABLE t3 MODIFY target double
+EXECUTE IMMEDIATE @alter;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+DROP TABLE t3;
+DROP TABLE t2;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE src double DEFAULT NULL;
+DECLARE dst inet6 DEFAULT NULL;
+SET dst=src;
+END;
+$$
+CALL p1;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `dst`
+DROP PROCEDURE p1;
+CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;;
+SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
+f1((SELECT source FROM t1 ORDER BY source LIMIT 1))
+NULL
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `a`
+DROP FUNCTION f1;
+CREATE PROCEDURE p1(a inet6) BEGIN END;;
+CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `a`
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1(OUT dst inet6)
+BEGIN
+DECLARE src double DEFAULT NULL;
+SET dst=src;
+END;
+$$
+CREATE PROCEDURE p2()
+BEGIN
+DECLARE dst inet6 DEFAULT NULL;
+CALL p1(dst);
+END;
+$$
+CALL p2();
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `dst`
+SHOW WARNINGS;
+Level Code Message
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `dst`
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+CREATE FUNCTION f1() RETURNS inet6
+BEGIN
+DECLARE rc double DEFAULT NULL;
+RETURN rc;
+END;
+$$
+SELECT f1();
+f1()
+NULL
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `f1()`
+DROP FUNCTION f1;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE src double DEFAULT NULL;
+DECLARE cur1 CURSOR(t inet6) FOR SELECT * FROM t1 WHERE target=t;
+OPEN cur1(src);
+CLOSE cur1;
+END;
+$$
+CALL p1();
+DROP PROCEDURE p1;
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t2 VALUES ();
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE dst inet6 DEFAULT NULL;
+DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
+OPEN cur2;
+FETCH cur2 INTO dst;
+CLOSE cur2;
+END;
+$$
+CALL p1();
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `dst`
+Warning 1292 Incorrect inet6 value: '0' for column ``.``.`dst` at row 1
+DROP PROCEDURE p1;
+DROP TABLE t2;
+# End of type_store_assignment_incompatible.inc
+DROP TABLE t1;
+CREATE TABLE t1 (target DOUBLE DEFAULT 0, source INET6 DEFAULT '::0');
+# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
+SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
+WHERE COLUMN_NAME='source'
+ AND TABLE_NAME='t1'
+ AND TABLE_SCHEMA='test');
+SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
+WHERE COLUMN_NAME='target'
+ AND TABLE_NAME='t1'
+ AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
+CREATE TABLE t2 LIKE t1;
+ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
+INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL,
+ `target` double DEFAULT 0,
+ `source` inet6 DEFAULT '::',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TABLE t3 LIKE t2;
+INSERT INTO t3 VALUES
+(1,
+(SELECT source FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1));
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+DROP TABLE t3;
+SET sql_mode='';
+CREATE TABLE t3 LIKE t2;
+ALTER TABLE t3 ENGINE=MyISAM;
+EXECUTE IMMEDIATE
+CONCAT('CREATE VIEW v3 AS SELECT id,',
+IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
+IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
+' FROM t3');
+INSERT INTO t3 VALUES
+(1,
+(SELECT target FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1)),
+(2,
+(SELECT source FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1));
+Warnings:
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 2
+SELECT * FROM v3;
+id target source
+1 0 ::
+2 0 ::
+TRUNCATE TABLE t3;
+SET sql_mode=STRICT_ALL_TABLES;
+INSERT INTO t3 VALUES
+(1,
+(SELECT target FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1)),
+(2,
+(SELECT source FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1));
+ERROR 22007: Incorrect double value: '::' for column `test`.`t3`.`target` at row 2
+SELECT * FROM v3;
+id target source
+1 0 ::
+TRUNCATE TABLE t3;
+SET sql_mode=@sql_mode_save;
+DROP TABLE t3;
+DROP VIEW v3;
+CREATE TABLE t3 LIKE t2;
+INSERT INTO t3 SELECT id,source,source FROM t2;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+UPDATE t3 SET target=source;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column ``.`(temporary)`.`target` at row 1
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
+SELECT @alter;
+@alter
+ALTER TABLE t3 MODIFY target inet6
+EXECUTE IMMEDIATE @alter;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+DROP TABLE t3;
+DROP TABLE t2;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE src inet6 DEFAULT NULL;
+DECLARE dst double DEFAULT NULL;
+SET dst=src;
+END;
+$$
+CALL p1;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `dst`
+DROP PROCEDURE p1;
+CREATE FUNCTION f1(a double) RETURNS INT RETURN NULL;;
+SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
+f1((SELECT source FROM t1 ORDER BY source LIMIT 1))
+NULL
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `a`
+DROP FUNCTION f1;
+CREATE PROCEDURE p1(a double) BEGIN END;;
+CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `a`
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1(OUT dst double)
+BEGIN
+DECLARE src inet6 DEFAULT NULL;
+SET dst=src;
+END;
+$$
+CREATE PROCEDURE p2()
+BEGIN
+DECLARE dst double DEFAULT NULL;
+CALL p1(dst);
+END;
+$$
+CALL p2();
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `dst`
+SHOW WARNINGS;
+Level Code Message
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `dst`
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+CREATE FUNCTION f1() RETURNS double
+BEGIN
+DECLARE rc inet6 DEFAULT NULL;
+RETURN rc;
+END;
+$$
+SELECT f1();
+f1()
+NULL
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `f1()`
+DROP FUNCTION f1;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE src inet6 DEFAULT NULL;
+DECLARE cur1 CURSOR(t double) FOR SELECT * FROM t1 WHERE target=t;
+OPEN cur1(src);
+CLOSE cur1;
+END;
+$$
+CALL p1();
+DROP PROCEDURE p1;
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t2 VALUES ();
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE dst double DEFAULT NULL;
+DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
+OPEN cur2;
+FETCH cur2 INTO dst;
+CLOSE cur2;
+END;
+$$
+CALL p1();
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `dst`
+Warning 1366 Incorrect double value: '::' for column ``.``.`dst` at row 1
+DROP PROCEDURE p1;
+DROP TABLE t2;
+# End of type_store_assignment_incompatible.inc
+DROP TABLE t1;
+#
+# End of 10.7 tests
+#
diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_loose.test b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_loose.test
new file mode 100644
index 00000000000..2721d9c5643
--- /dev/null
+++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_loose.test
@@ -0,0 +1,21 @@
+--echo #
+--echo # Start of 10.7 tests
+--echo #
+
+--echo #
+--echo # MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
+--echo #
+
+SET sql_mode='';
+
+CREATE TABLE t1 (target INET6 DEFAULT '::0', source DOUBLE DEFAULT 0);
+--source include/type_mix_incompatible.inc
+DROP TABLE t1;
+
+CREATE TABLE t1 (target DOUBLE DEFAULT 0, source INET6 DEFAULT '::0');
+--source include/type_mix_incompatible.inc
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.7 tests
+--echo #
diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_strict_ignore.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_strict_ignore.result
new file mode 100644
index 00000000000..9b76306d510
--- /dev/null
+++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_strict_ignore.result
@@ -0,0 +1,400 @@
+#
+# Start of 10.7 tests
+#
+#
+# MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
+#
+SET @ignore='IGNORE';
+CREATE TABLE t1 (target INET6 DEFAULT '::0', source DOUBLE DEFAULT 0);
+# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
+SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
+WHERE COLUMN_NAME='source'
+ AND TABLE_NAME='t1'
+ AND TABLE_SCHEMA='test');
+SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
+WHERE COLUMN_NAME='target'
+ AND TABLE_NAME='t1'
+ AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
+CREATE TABLE t2 LIKE t1;
+ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
+INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL,
+ `target` inet6 DEFAULT '::',
+ `source` double DEFAULT 0,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TABLE t3 LIKE t2;
+INSERT IGNORE INTO t3 VALUES
+(1,
+(SELECT source FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1));
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+DROP TABLE t3;
+SET sql_mode='';
+CREATE TABLE t3 LIKE t2;
+ALTER TABLE t3 ENGINE=MyISAM;
+EXECUTE IMMEDIATE
+CONCAT('CREATE VIEW v3 AS SELECT id,',
+IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
+IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
+' FROM t3');
+INSERT IGNORE INTO t3 VALUES
+(1,
+(SELECT target FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1)),
+(2,
+(SELECT source FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1));
+Warnings:
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2
+SELECT * FROM v3;
+id target source
+1 :: 0
+2 :: 0
+TRUNCATE TABLE t3;
+SET sql_mode=STRICT_ALL_TABLES;
+INSERT IGNORE INTO t3 VALUES
+(1,
+(SELECT target FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1)),
+(2,
+(SELECT source FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1));
+Warnings:
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2
+SELECT * FROM v3;
+id target source
+1 :: 0
+2 :: 0
+TRUNCATE TABLE t3;
+SET sql_mode=@sql_mode_save;
+DROP TABLE t3;
+DROP VIEW v3;
+CREATE TABLE t3 LIKE t2;
+INSERT IGNORE INTO t3 SELECT id,source,source FROM t2;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+INSERT IGNORE INTO t3 (id,target,source) SELECT id,source,source FROM t2;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+Warning 1062 Duplicate entry '1' for key 'PRIMARY'
+INSERT IGNORE INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+INSERT IGNORE INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+INSERT IGNORE INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+INSERT IGNORE INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+UPDATE IGNORE t3 SET target=source;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+UPDATE IGNORE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column ``.`(temporary)`.`target` at row 1
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
+SELECT @alter;
+@alter
+ALTER IGNORE TABLE t3 MODIFY target double
+EXECUTE IMMEDIATE @alter;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+DROP TABLE t3;
+DROP TABLE t2;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE src double DEFAULT NULL;
+DECLARE dst inet6 DEFAULT NULL;
+SET dst=src;
+END;
+$$
+CALL p1;
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `dst`
+DROP PROCEDURE p1;
+CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;;
+SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `a`
+DROP FUNCTION f1;
+CREATE PROCEDURE p1(a inet6) BEGIN END;;
+CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `a`
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1(OUT dst inet6)
+BEGIN
+DECLARE src double DEFAULT NULL;
+SET dst=src;
+END;
+$$
+CREATE PROCEDURE p2()
+BEGIN
+DECLARE dst inet6 DEFAULT NULL;
+CALL p1(dst);
+END;
+$$
+CALL p2();
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `dst`
+SHOW WARNINGS;
+Level Code Message
+Error 4078 Cannot cast 'double' as 'inet6' in assignment of `dst`
+Note 4094 At line 4 in test.p1
+Note 4094 At line 4 in test.p2
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+CREATE FUNCTION f1() RETURNS inet6
+BEGIN
+DECLARE rc double DEFAULT NULL;
+RETURN rc;
+END;
+$$
+SELECT f1();
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `f1()`
+DROP FUNCTION f1;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE src double DEFAULT NULL;
+DECLARE cur1 CURSOR(t inet6) FOR SELECT * FROM t1 WHERE target=t;
+OPEN cur1(src);
+CLOSE cur1;
+END;
+$$
+CALL p1();
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `t`
+DROP PROCEDURE p1;
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t2 VALUES ();
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE dst inet6 DEFAULT NULL;
+DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
+OPEN cur2;
+FETCH cur2 INTO dst;
+CLOSE cur2;
+END;
+$$
+CALL p1();
+ERROR HY000: Cannot cast 'double' as 'inet6' in assignment of `dst`
+DROP PROCEDURE p1;
+DROP TABLE t2;
+# End of type_store_assignment_incompatible.inc
+DROP TABLE t1;
+CREATE TABLE t1 (target DOUBLE DEFAULT 0, source INET6 DEFAULT '::0');
+# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
+SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
+WHERE COLUMN_NAME='source'
+ AND TABLE_NAME='t1'
+ AND TABLE_SCHEMA='test');
+SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
+WHERE COLUMN_NAME='target'
+ AND TABLE_NAME='t1'
+ AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
+CREATE TABLE t2 LIKE t1;
+ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
+INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL,
+ `target` double DEFAULT 0,
+ `source` inet6 DEFAULT '::',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TABLE t3 LIKE t2;
+INSERT IGNORE INTO t3 VALUES
+(1,
+(SELECT source FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1));
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+DROP TABLE t3;
+SET sql_mode='';
+CREATE TABLE t3 LIKE t2;
+ALTER TABLE t3 ENGINE=MyISAM;
+EXECUTE IMMEDIATE
+CONCAT('CREATE VIEW v3 AS SELECT id,',
+IF(@target_type='geometry','AsText(target)','target'), ' AS target,',
+IF(@source_type='geometry','AsText(source)','source'), ' AS source ',
+' FROM t3');
+INSERT IGNORE INTO t3 VALUES
+(1,
+(SELECT target FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1)),
+(2,
+(SELECT source FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1));
+Warnings:
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 2
+SELECT * FROM v3;
+id target source
+1 0 ::
+2 0 ::
+TRUNCATE TABLE t3;
+SET sql_mode=STRICT_ALL_TABLES;
+INSERT IGNORE INTO t3 VALUES
+(1,
+(SELECT target FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1)),
+(2,
+(SELECT source FROM t2 ORDER BY id LIMIT 1),
+(SELECT source FROM t2 ORDER BY id LIMIT 1));
+Warnings:
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 2
+SELECT * FROM v3;
+id target source
+1 0 ::
+2 0 ::
+TRUNCATE TABLE t3;
+SET sql_mode=@sql_mode_save;
+DROP TABLE t3;
+DROP VIEW v3;
+CREATE TABLE t3 LIKE t2;
+INSERT IGNORE INTO t3 SELECT id,source,source FROM t2;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+INSERT IGNORE INTO t3 (id,target,source) SELECT id,source,source FROM t2;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+Warning 1062 Duplicate entry '1' for key 'PRIMARY'
+INSERT IGNORE INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+INSERT IGNORE INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+INSERT IGNORE INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+INSERT IGNORE INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+UPDATE IGNORE t3 SET target=source;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column `test`.`t3`.`target` at row 1
+UPDATE IGNORE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
+Warnings:
+Warning 4078 Cannot cast 'inet6' as 'double' in assignment of `test`.`t3`.`target`
+Warning 1366 Incorrect double value: '::' for column ``.`(temporary)`.`target` at row 1
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
+SELECT @alter;
+@alter
+ALTER IGNORE TABLE t3 MODIFY target inet6
+EXECUTE IMMEDIATE @alter;
+Warnings:
+Warning 4078 Cannot cast 'double' as 'inet6' in assignment of `test`.`t3`.`target`
+Warning 1292 Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 1
+DROP TABLE t3;
+DROP TABLE t2;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE src inet6 DEFAULT NULL;
+DECLARE dst double DEFAULT NULL;
+SET dst=src;
+END;
+$$
+CALL p1;
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `dst`
+DROP PROCEDURE p1;
+CREATE FUNCTION f1(a double) RETURNS INT RETURN NULL;;
+SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `a`
+DROP FUNCTION f1;
+CREATE PROCEDURE p1(a double) BEGIN END;;
+CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `a`
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1(OUT dst double)
+BEGIN
+DECLARE src inet6 DEFAULT NULL;
+SET dst=src;
+END;
+$$
+CREATE PROCEDURE p2()
+BEGIN
+DECLARE dst double DEFAULT NULL;
+CALL p1(dst);
+END;
+$$
+CALL p2();
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `dst`
+SHOW WARNINGS;
+Level Code Message
+Error 4078 Cannot cast 'inet6' as 'double' in assignment of `dst`
+Note 4094 At line 4 in test.p1
+Note 4094 At line 4 in test.p2
+DROP PROCEDURE p2;
+DROP PROCEDURE p1;
+CREATE FUNCTION f1() RETURNS double
+BEGIN
+DECLARE rc inet6 DEFAULT NULL;
+RETURN rc;
+END;
+$$
+SELECT f1();
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `f1()`
+DROP FUNCTION f1;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE src inet6 DEFAULT NULL;
+DECLARE cur1 CURSOR(t double) FOR SELECT * FROM t1 WHERE target=t;
+OPEN cur1(src);
+CLOSE cur1;
+END;
+$$
+CALL p1();
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `t`
+DROP PROCEDURE p1;
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t2 VALUES ();
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE dst double DEFAULT NULL;
+DECLARE cur2 CURSOR FOR SELECT source FROM t2 ORDER BY source LIMIT 1;
+OPEN cur2;
+FETCH cur2 INTO dst;
+CLOSE cur2;
+END;
+$$
+CALL p1();
+ERROR HY000: Cannot cast 'inet6' as 'double' in assignment of `dst`
+DROP PROCEDURE p1;
+DROP TABLE t2;
+# End of type_store_assignment_incompatible.inc
+DROP TABLE t1;
+#
+# End of 10.7 tests
+#
diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_strict_ignore.test b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_strict_ignore.test
new file mode 100644
index 00000000000..ebb41854df2
--- /dev/null
+++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_double_strict_ignore.test
@@ -0,0 +1,21 @@
+--echo #
+--echo # Start of 10.7 tests
+--echo #
+
+--echo #
+--echo # MDEV-28918 Implicit cast from INET6 UNSIGNED works differently on UPDATE vs ALTER
+--echo #
+
+SET @ignore='IGNORE';
+
+CREATE TABLE t1 (target INET6 DEFAULT '::0', source DOUBLE DEFAULT 0);
+--source include/type_mix_incompatible.inc
+DROP TABLE t1;
+
+CREATE TABLE t1 (target DOUBLE DEFAULT 0, source INET6 DEFAULT '::0');
+--source include/type_mix_incompatible.inc
+DROP TABLE t1;
+
+--echo #
+--echo # End of 10.7 tests
+--echo #
diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_int.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_int.result
index 80a2e70cd7a..dd078efc38f 100644
--- a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_int.result
+++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_int.result
@@ -6,6 +6,7 @@
#
CREATE TABLE t1 (target INET6 DEFAULT '::0', source INT DEFAULT 0);
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -30,7 +35,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -62,37 +67,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 :: 0
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target int(11)
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -103,15 +108,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a inet6) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst inet6)
BEGIN
@@ -126,10 +131,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types inet6 and int for operation 'SET'
+Error 4078 Cannot cast 'int' as 'inet6' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -141,7 +146,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -152,7 +157,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -166,13 +171,14 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
DROP TABLE t1;
CREATE TABLE t1 (target INT DEFAULT 0, source INET6 DEFAULT '::0');
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -197,7 +207,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -229,37 +239,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect integer value: '::' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 0 ::
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target inet6
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types inet6 and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'inet6' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -270,15 +280,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a int(11)) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a int(11)) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst int(11))
BEGIN
@@ -293,10 +303,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types int and inet6 for operation 'SET'
+Error 4078 Cannot cast 'inet6' as 'int' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -308,7 +318,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -319,7 +329,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -333,7 +343,7 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types int and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_time.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_time.result
index ffca3fb441f..afdbd9e1999 100644
--- a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_time.result
+++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_time.result
@@ -6,6 +6,7 @@
#
CREATE TABLE t1 (target INET6 DEFAULT '::0', source TIME DEFAULT '00:00:00');
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -30,7 +35,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -62,37 +67,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect inet6 value: '00:00:00' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 :: 00:00:00
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target time
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -103,15 +108,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a inet6) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst inet6)
BEGIN
@@ -126,10 +131,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types inet6 and time for operation 'SET'
+Error 4078 Cannot cast 'time' as 'inet6' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -141,7 +146,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -152,7 +157,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -166,13 +171,14 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
DROP TABLE t1;
CREATE TABLE t1 (target TIME DEFAULT '00:00:00', source INET6 DEFAULT '::0');
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -197,7 +207,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -229,37 +239,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect time value: '::' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 00:00:00 ::
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target inet6
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types inet6 and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'inet6' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -270,15 +280,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a time) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a time) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst time)
BEGIN
@@ -293,10 +303,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types time and inet6 for operation 'SET'
+Error 4078 Cannot cast 'inet6' as 'time' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -308,7 +318,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -319,7 +329,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -333,7 +343,7 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types time and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'time' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
diff --git a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_uint.result b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_uint.result
index 7fa4df73dab..88439222de2 100644
--- a/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_uint.result
+++ b/plugin/type_inet/mysql-test/type_inet/type_inet6_mix_uint.result
@@ -6,6 +6,7 @@
#
CREATE TABLE t1 (target INET6 DEFAULT '::0', source INT UNSIGNED DEFAULT 0);
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -30,7 +35,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -62,37 +67,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect inet6 value: '0' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 :: 0
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target int(10) unsigned
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -103,15 +108,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a inet6) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a inet6) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst inet6)
BEGIN
@@ -126,10 +131,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types inet6 and int unsigned for operation 'SET'
+Error 4078 Cannot cast 'int unsigned' as 'inet6' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -141,7 +146,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -152,7 +157,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -166,13 +171,14 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
DROP TABLE t1;
CREATE TABLE t1 (target INT UNSIGNED DEFAULT 0, source INET6 DEFAULT '::0');
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -197,7 +207,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -229,37 +239,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect integer value: '::' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 0 ::
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target inet6
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types inet6 and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'inet6' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -270,15 +280,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a int(10) unsigned) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a int(10) unsigned) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst int(10) unsigned)
BEGIN
@@ -293,10 +303,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types int unsigned and inet6 for operation 'SET'
+Error 4078 Cannot cast 'inet6' as 'int unsigned' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -308,7 +318,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -319,7 +329,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -333,7 +343,7 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types int unsigned and inet6 for operation 'SET'
+ERROR HY000: Cannot cast 'inet6' as 'int unsigned' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid.result
index adcafc51ece..2a96b2df592 100644
--- a/plugin/type_uuid/mysql-test/type_uuid/type_uuid.result
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid.result
@@ -195,9 +195,9 @@ CREATE TABLE t1 (a UUID);
INSERT INTO t1 VALUES ('x');
ERROR 22007: Incorrect uuid value: 'x' for column `test`.`t1`.`a` at row 1
INSERT INTO t1 VALUES (1);
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t1`.`a`
INSERT INTO t1 VALUES (TIME'10:20:30');
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t1`.`a`
INSERT INTO t1 VALUES (0x00);
ERROR 22007: Incorrect uuid value: '\x00' for column `test`.`t1`.`a` at row 1
DROP TABLE t1;
@@ -1931,15 +1931,15 @@ DROP TABLE t1;
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t1`.`a`
DROP TABLE t1;
CREATE TABLE t1 (a DOUBLE);
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t1`.`a`
DROP TABLE t1;
CREATE TABLE t1 (a DECIMAL(32,0));
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t1`.`a`
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(64));
INSERT INTO t1 VALUES (CAST('00000000-0000-0000-0000-000000000000' AS UUID));
@@ -2762,7 +2762,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a UUID, b INT);
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -2770,7 +2770,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a UUID, b DOUBLE);
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -2778,7 +2778,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a UUID, b DECIMAL(32,0));
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -2786,7 +2786,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a UUID, b YEAR);
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types year and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'year' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -2797,7 +2797,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT, b UUID);
INSERT INTO t1 VALUES (1, NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -2805,7 +2805,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a DOUBLE, b UUID);
INSERT INTO t1 VALUES (1, NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -2813,7 +2813,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a DECIMAL(32,0), b UUID);
INSERT INTO t1 VALUES (1, NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -2821,7 +2821,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a YEAR, b UUID);
INSERT INTO t1 VALUES (1, NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types uuid and year for operation 'SET'
+ERROR HY000: Cannot cast 'year' as 'uuid' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -2832,7 +2832,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a UUID, b TIME);
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -2840,7 +2840,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a UUID, b DATE);
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types date and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'date' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -2848,7 +2848,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a UUID, b DATETIME);
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types datetime and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'datetime' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -2856,7 +2856,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a UUID, b TIMESTAMP NULL DEFAULT NULL);
INSERT INTO t1 VALUES ('ffffffff-ffff-ffff-ffff-ffffffffffff', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types timestamp and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'timestamp' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -2867,7 +2867,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a TIME, b UUID);
INSERT INTO t1 VALUES ('00:00:00', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -2875,7 +2875,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a DATE, b UUID);
INSERT INTO t1 VALUES ('2001-01:01', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types uuid and date for operation 'SET'
+ERROR HY000: Cannot cast 'date' as 'uuid' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -2883,7 +2883,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a DATETIME, b UUID);
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types uuid and datetime for operation 'SET'
+ERROR HY000: Cannot cast 'datetime' as 'uuid' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
@@ -2891,7 +2891,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP, b UUID);
INSERT INTO t1 VALUES ('2001-01-01 10:20:30', NULL);
UPDATE t1 SET b=a;
-ERROR HY000: Illegal parameter data types uuid and timestamp for operation 'SET'
+ERROR HY000: Cannot cast 'timestamp' as 'uuid' in assignment of `test`.`t1`.`b`
SELECT b FROM t1;
b
NULL
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_decimal.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_decimal.result
index 91519b1e677..4eae75fbfc3 100644
--- a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_decimal.result
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_decimal.result
@@ -6,6 +6,7 @@
#
CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source DECIMAL(38,0) DEFAULT 0);
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -30,7 +35,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -62,37 +67,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect uuid value: '0' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 00000000-0000-0000-0000-000000000000 0
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target decimal(38,0)
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -103,15 +108,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a uuid) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a uuid) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst uuid)
BEGIN
@@ -126,10 +131,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types uuid and decimal for operation 'SET'
+Error 4078 Cannot cast 'decimal' as 'uuid' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -141,7 +146,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -152,7 +157,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -166,13 +171,14 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
DROP TABLE t1;
CREATE TABLE t1 (target DECIMAL(38,0) DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000');
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -197,7 +207,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -229,37 +239,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 01000: Data truncated for column 'target' at row 2
SELECT * FROM v3;
id target source
1 0 00000000-0000-0000-0000-000000000000
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target uuid
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types uuid and decimal for operation 'SET'
+ERROR HY000: Cannot cast 'decimal' as 'uuid' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -270,15 +280,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a decimal(38,0)) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a decimal(38,0)) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst decimal(38,0))
BEGIN
@@ -293,10 +303,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types decimal and uuid for operation 'SET'
+Error 4078 Cannot cast 'uuid' as 'decimal' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -308,7 +318,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -319,7 +329,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -333,7 +343,7 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types decimal and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'decimal' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_double.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_double.result
index 2f045078eb7..60f1a1a09ae 100644
--- a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_double.result
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_double.result
@@ -6,6 +6,7 @@
#
CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source DOUBLE DEFAULT 0);
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -30,7 +35,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -62,37 +67,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect uuid value: '0' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 00000000-0000-0000-0000-000000000000 0
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target double
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -103,15 +108,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a uuid) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a uuid) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst uuid)
BEGIN
@@ -126,10 +131,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types uuid and double for operation 'SET'
+Error 4078 Cannot cast 'double' as 'uuid' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -141,7 +146,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -152,7 +157,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -166,13 +171,14 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
DROP TABLE t1;
CREATE TABLE t1 (target DOUBLE DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000');
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -197,7 +207,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -229,37 +239,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 01000: Data truncated for column 'target' at row 2
SELECT * FROM v3;
id target source
1 0 00000000-0000-0000-0000-000000000000
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target uuid
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types uuid and double for operation 'SET'
+ERROR HY000: Cannot cast 'double' as 'uuid' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -270,15 +280,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a double) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a double) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst double)
BEGIN
@@ -293,10 +303,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types double and uuid for operation 'SET'
+Error 4078 Cannot cast 'uuid' as 'double' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -308,7 +318,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -319,7 +329,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -333,7 +343,7 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types double and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'double' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_int.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_int.result
index 4eb2b803a98..cb3f4c282e3 100644
--- a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_int.result
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_int.result
@@ -6,6 +6,7 @@
#
CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source INT DEFAULT 0);
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -30,7 +35,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -62,37 +67,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect uuid value: '0' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 00000000-0000-0000-0000-000000000000 0
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target int(11)
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -103,15 +108,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a uuid) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a uuid) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst uuid)
BEGIN
@@ -126,10 +131,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types uuid and int for operation 'SET'
+Error 4078 Cannot cast 'int' as 'uuid' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -141,7 +146,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -152,7 +157,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -166,13 +171,14 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
DROP TABLE t1;
CREATE TABLE t1 (target INT DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000');
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -197,7 +207,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -229,37 +239,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 01000: Data truncated for column 'target' at row 2
SELECT * FROM v3;
id target source
1 0 00000000-0000-0000-0000-000000000000
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target uuid
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types uuid and int for operation 'SET'
+ERROR HY000: Cannot cast 'int' as 'uuid' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -270,15 +280,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a int(11)) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a int(11)) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst int(11))
BEGIN
@@ -293,10 +303,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types int and uuid for operation 'SET'
+Error 4078 Cannot cast 'uuid' as 'int' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -308,7 +318,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -319,7 +329,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -333,7 +343,7 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types int and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_time.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_time.result
index bb41af1ebf0..c86d46085e9 100644
--- a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_time.result
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_time.result
@@ -6,6 +6,7 @@
#
CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source TIME DEFAULT '00:00:00');
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -30,7 +35,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -62,37 +67,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect uuid value: '00:00:00' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 00000000-0000-0000-0000-000000000000 00:00:00
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target time
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -103,15 +108,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a uuid) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a uuid) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst uuid)
BEGIN
@@ -126,10 +131,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types uuid and time for operation 'SET'
+Error 4078 Cannot cast 'time' as 'uuid' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -141,7 +146,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -152,7 +157,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -166,13 +171,14 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
DROP TABLE t1;
CREATE TABLE t1 (target TIME DEFAULT '00:00:00', source UUID DEFAULT '00000000-0000-0000-0000-000000000000');
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -197,7 +207,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -229,37 +239,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect time value: '00000000-0000-0000-0000-000000000000' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 00:00:00 00000000-0000-0000-0000-000000000000
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target uuid
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types uuid and time for operation 'SET'
+ERROR HY000: Cannot cast 'time' as 'uuid' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -270,15 +280,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a time) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a time) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst time)
BEGIN
@@ -293,10 +303,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types time and uuid for operation 'SET'
+Error 4078 Cannot cast 'uuid' as 'time' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -308,7 +318,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -319,7 +329,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -333,7 +343,7 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types time and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'time' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
diff --git a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_uint.result b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_uint.result
index 9c61cfb1171..5202cd83865 100644
--- a/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_uint.result
+++ b/plugin/type_uuid/mysql-test/type_uuid/type_uuid_mix_uint.result
@@ -6,6 +6,7 @@
#
CREATE TABLE t1 (target UUID DEFAULT '00000000-0000-0000-0000-000000000000', source INT UNSIGNED DEFAULT 0);
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -14,6 +15,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -30,7 +35,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -62,37 +67,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 22007: Incorrect uuid value: '0' for column `test`.`t3`.`target` at row 2
SELECT * FROM v3;
id target source
1 00000000-0000-0000-0000-000000000000 0
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target int(10) unsigned
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -103,15 +108,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a uuid) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a uuid) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst uuid)
BEGIN
@@ -126,10 +131,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types uuid and int unsigned for operation 'SET'
+Error 4078 Cannot cast 'int unsigned' as 'uuid' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -141,7 +146,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -152,7 +157,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -166,13 +171,14 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
DROP TABLE t1;
CREATE TABLE t1 (target INT UNSIGNED DEFAULT 0, source UUID DEFAULT '00000000-0000-0000-0000-000000000000');
# Start of type_store_assignment_incompatible.inc
+SET @sql_mode_save= @@sql_mode;
SET @source_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='source'
AND TABLE_NAME='t1'
@@ -181,6 +187,10 @@ SET @target_type= (SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME='target'
AND TABLE_NAME='t1'
AND TABLE_SCHEMA='test');
+SET @ignore= CASE WHEN @ignore IS NULL OR @ignore = '' THEN ''
+ WHEN @ignore NOT LIKE ' %' THEN CONCAT(' ',@ignore)
+ELSE @ignore
+END;
CREATE TABLE t2 LIKE t1;
ALTER TABLE t2 ADD id INT NOT NULL PRIMARY KEY FIRST;
INSERT INTO t2 VALUES (1,DEFAULT,DEFAULT);
@@ -197,7 +207,7 @@ INSERT INTO t3 VALUES
(1,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
SET sql_mode='';
CREATE TABLE t3 LIKE t2;
@@ -229,37 +239,37 @@ INSERT INTO t3 VALUES
(2,
(SELECT source FROM t2 ORDER BY id LIMIT 1),
(SELECT source FROM t2 ORDER BY id LIMIT 1));
-Got one of the listed errors
+ERROR 01000: Data truncated for column 'target' at row 2
SELECT * FROM v3;
id target source
1 0 00000000-0000-0000-0000-000000000000
TRUNCATE TABLE t3;
-SET sql_mode=DEFAULT;
+SET sql_mode=@sql_mode_save;
DROP TABLE t3;
DROP VIEW v3;
CREATE TABLE t3 LIKE t2;
INSERT INTO t3 SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT id,source,source FROM t2;
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target`
INSERT INTO t3 VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) VALUES (1,DEFAULT,DEFAULT) ON DUPLICATE KEY UPDATE target=source;
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target`
INSERT INTO t3 SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target`
INSERT INTO t3 (id,target,source) SELECT 1,DEFAULT(t2.target),DEFAULT(t2.source) FROM t2 ON DUPLICATE KEY UPDATE t3.target=t2.source;
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target`
UPDATE t3 SET target=source;
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target`
UPDATE t2, t3 SET t3.target=t2.source WHERE t2.id=t3.id;
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
-SET @alter=CONCAT('ALTER TABLE t3 MODIFY target ', @source_type);
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `test`.`t3`.`target`
+SET @alter=CONCAT('ALTER', @ignore, ' TABLE t3 MODIFY target ', @source_type);
SELECT @alter;
@alter
ALTER TABLE t3 MODIFY target uuid
EXECUTE IMMEDIATE @alter;
-ERROR HY000: Illegal parameter data types uuid and int unsigned for operation 'SET'
+ERROR HY000: Cannot cast 'int unsigned' as 'uuid' in assignment of `test`.`t3`.`target`
DROP TABLE t3;
DROP TABLE t2;
CREATE PROCEDURE p1()
@@ -270,15 +280,15 @@ SET dst=src;
END;
$$
CALL p1;
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `dst`
DROP PROCEDURE p1;
CREATE FUNCTION f1(a int(10) unsigned) RETURNS INT RETURN NULL;;
SELECT f1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `a`
DROP FUNCTION f1;
CREATE PROCEDURE p1(a int(10) unsigned) BEGIN END;;
CALL p1((SELECT source FROM t1 ORDER BY source LIMIT 1));
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `a`
DROP PROCEDURE p1;
CREATE PROCEDURE p1(OUT dst int(10) unsigned)
BEGIN
@@ -293,10 +303,10 @@ CALL p1(dst);
END;
$$
CALL p2();
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `dst`
SHOW WARNINGS;
Level Code Message
-Error 4078 Illegal parameter data types int unsigned and uuid for operation 'SET'
+Error 4078 Cannot cast 'uuid' as 'int unsigned' in assignment of `dst`
Note 4094 At line 4 in test.p1
Note 4094 At line 4 in test.p2
DROP PROCEDURE p2;
@@ -308,7 +318,7 @@ RETURN rc;
END;
$$
SELECT f1();
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `f1()`
DROP FUNCTION f1;
CREATE PROCEDURE p1()
BEGIN
@@ -319,7 +329,7 @@ CLOSE cur1;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `t`
DROP PROCEDURE p1;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES ();
@@ -333,7 +343,7 @@ CLOSE cur2;
END;
$$
CALL p1();
-ERROR HY000: Illegal parameter data types int unsigned and uuid for operation 'SET'
+ERROR HY000: Cannot cast 'uuid' as 'int unsigned' in assignment of `dst`
DROP PROCEDURE p1;
DROP TABLE t2;
# End of type_store_assignment_incompatible.inc
diff --git a/scripts/fill_help_tables.sql b/scripts/fill_help_tables.sql
index d0efb750330..952d9e69663 100644
--- a/scripts/fill_help_tables.sql
+++ b/scripts/fill_help_tables.sql
@@ -78,746 +78,741 @@ insert into help_category (help_category_id,name,parent_category_id,url) values
insert into help_category (help_category_id,name,parent_category_id,url) values (43,'Spider Functions',38,'');
insert into help_category (help_category_id,name,parent_category_id,url) values (44,'Dynamic Column Functions',38,'');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (1,9,'HELP_DATE','This help information was generated from the MariaDB Knowledge Base\non 22 July 2019.','','');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (2,2,'AREA','A synonym for ST_AREA.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/polygon-properties-area/','','https://mariadb.com/kb/en/library/polygon-properties-area/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (3,2,'CENTROID','A synonym for ST_CENTROID.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/centroid/','','https://mariadb.com/kb/en/library/centroid/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (4,2,'ExteriorRing','A synonym for ST_ExteriorRing.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/polygon-properties-exteriorring/','','https://mariadb.com/kb/en/library/polygon-properties-exteriorring/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (5,2,'InteriorRingN','A synonym for ST_InteriorRingN.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/polygon-properties-interiorringn/','','https://mariadb.com/kb/en/library/polygon-properties-interiorringn/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (6,2,'NumInteriorRings','A synonym for ST_NumInteriorRings.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/polygon-properties-numinteriorrings/','','https://mariadb.com/kb/en/library/polygon-properties-numinteriorrings/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (7,2,'ST_AREA','Syntax\n------ \nST_Area(poly)\nArea(poly)\n \nDescription\n----------- \nReturns as a double-precision number the area of the Polygon\nvalue poly, as measured in its spatial reference system.\n \nST_Area() and Area() are synonyms.\n \nExamples\n-------- \nSET @poly = \'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1\n1))\';\n \nSELECT Area(GeomFromText(@poly));\n+---------------------------+\n| Area(GeomFromText(@poly)) |\n+---------------------------+\n| 4 |\n+---------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_area/','','https://mariadb.com/kb/en/library/st_area/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (8,2,'ST_CENTROID','Syntax\n------ \nST_Centroid(mpoly)\nCentroid(mpoly)\n \nDescription\n----------- \nReturns a point reflecting the mathematical centroid\n(geometric center) for the MultiPolygon mpoly. The resulting\npoint will not necessarily be on the MultiPolygon. \n \nST_Centroid() and Centroid() are synonyms.\n \nExamples\n-------- \nSET @poly = ST_GeomFromText(\'POLYGON((0 0,20 0,20 20,0 20,0\n0))\');\nSELECT ST_AsText(ST_Centroid(@poly)) AS center;\n \n+--------------+\n| center |\n+--------------+\n| POINT(10 10) |\n+--------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_centroid/','','https://mariadb.com/kb/en/library/st_centroid/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (9,2,'ST_ExteriorRing','Syntax\n------ \nST_ExteriorRing(poly)\nExteriorRing(poly)\n \nDescription\n----------- \nReturns the exterior ring of the Polygon value poly as a\nLineString.\n \nST_ExteriorRing() and ExteriorRing() are synonyms.\n \nExamples\n-------- \nSET @poly = \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2\n1,1 1))\';\n \nSELECT AsText(ExteriorRing(GeomFromText(@poly)));\n+-------------------------------------------+\n| AsText(ExteriorRing(GeomFromText(@poly))) |\n+-------------------------------------------+\n| LINESTRING(0 0,0 3,3 3,3 0,0 0) |\n+-------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_exteriorring/','','https://mariadb.com/kb/en/library/st_exteriorring/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (10,2,'ST_InteriorRingN','Syntax\n------ \nST_InteriorRingN(poly,N)\nInteriorRingN(poly,N)\n \nDescription\n----------- \nReturns the N-th interior ring for the Polygon value poly as\na LineString. Rings are numbered beginning with 1.\n \nST_InteriorRingN() and InteriorRingN() are synonyms.\n \nExamples\n-------- \nSET @poly = \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2\n1,1 1))\';\n \nSELECT AsText(InteriorRingN(GeomFromText(@poly),1));\n+----------------------------------------------+\n| AsText(InteriorRingN(GeomFromText(@poly),1)) |\n+----------------------------------------------+\n| LINESTRING(1 1,1 2,2 2,2 1,1 1) |\n+----------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_interiorringn/','','https://mariadb.com/kb/en/library/st_interiorringn/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (11,2,'ST_NumInteriorRings','Syntax\n------ \nST_NumInteriorRings(poly)\nNumInteriorRings(poly)\n \nDescription\n----------- \nReturns an integer containing the number of interior rings\nin the Polygon value poly.\n \nNote that according the the OpenGIS standard, a POLYGON\nshould have exactly one ExteriorRing and all other rings\nshould lie within that ExteriorRing and thus be the\nInteriorRings. Practically, however, some systems, including\nMariaDB\'s, permit polygons to have several\n\'ExteriorRings\'. In the case of there being multiple,\nnon-overlapping exterior rings ST_NumInteriorRings() will\nreturn 1.\n \nST_NumInteriorRings() and NumInteriorRings() are synonyms.\n \nExamples\n-------- \nSET @poly = \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2\n1,1 1))\';\n \nSELECT NumInteriorRings(GeomFromText(@poly));\n+---------------------------------------+\n| NumInteriorRings(GeomFromText(@poly)) |\n+---------------------------------------+\n| 1 |\n+---------------------------------------+\n \nNon-overlapping \'polygon\':\n \nSELECT ST_NumInteriorRings(ST_PolyFromText(\'POLYGON((0 0,10\n0,10 10,0 10,0 0),\n (-1 -1,-5 -1,-5 -5,-1 -5,-1 -1))\')) AS NumInteriorRings;\n \n+------------------+\n| NumInteriorRings |\n+------------------+\n| 1 |\n+------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_numinteriorrings/','','https://mariadb.com/kb/en/library/st_numinteriorrings/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (12,3,'WKT Definition','Description\n----------- \nThe Well-Known Text (WKT) representation of Geometry is\ndesigned to exchange geometry data in ASCII form. Examples\nof the basic geometry types include:\n \nGeometry Types | \n \nPOINT | \n \nLINESTRING | \n \nPOLYGON | \n \nMULTIPOINT | \n \nMULTILINESTRING | \n \nMULTIPOLYGON | \n \nGEOMETRYCOLLECTION | \n \nGEOMETRY | \n \n\n\nURL: https://mariadb.com/kb/en/library/wkt-definition/','','https://mariadb.com/kb/en/library/wkt-definition/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (13,3,'AsText','A synonym for ST_AsText().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/wkt-astext/','','https://mariadb.com/kb/en/library/wkt-astext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (14,3,'AsWKT','A synonym for ST_AsText().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/wkt-aswkt/','','https://mariadb.com/kb/en/library/wkt-aswkt/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (15,3,'GeomCollFromText','A synonym for ST_GeomCollFromText.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/wkt-geomcollfromtext/','','https://mariadb.com/kb/en/library/wkt-geomcollfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (16,3,'GeometryCollectionFromText','A synonym for ST_GeomCollFromText.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/geometrycollectionfromtext/','','https://mariadb.com/kb/en/library/geometrycollectionfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (17,3,'GeometryFromText','A synonym for ST_GeomFromText.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/geometryfromtext/','','https://mariadb.com/kb/en/library/geometryfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (18,3,'GeomFromText','A synonym for ST_GeomFromText.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/wkt-geomfromtext/','','https://mariadb.com/kb/en/library/wkt-geomfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (19,3,'LineFromText','A synonym for ST_LineFromText.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/wkt-linefromtext/','','https://mariadb.com/kb/en/library/wkt-linefromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (20,3,'LineStringFromText','A synonym for ST_LineFromText.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/linestringfromtext/','','https://mariadb.com/kb/en/library/linestringfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (21,3,'MLineFromText','Syntax\n------ \nMLineFromText(wkt[,srid])\nMultiLineStringFromText(wkt[,srid])\n \nDescription\n----------- \nConstructs a MULTILINESTRING value using its WKT\nrepresentation and SRID.\n \nMLineFromText() and MultiLineStringFromText() are synonyms.\n \nExamples\n-------- \nCREATE TABLE gis_multi_line (g MULTILINESTRING);\nSHOW FIELDS FROM gis_multi_line;\n \nINSERT INTO gis_multi_line VALUES\n (MultiLineStringFromText(\'MULTILINESTRING((10 48,10 21,10\n0),(16 0,16 23,16 48))\')),\n (MLineFromText(\'MULTILINESTRING((10 48,10 21,10 0))\')),\n (MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2),\nPoint(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21,\n7))))));\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mlinefromtext/','','https://mariadb.com/kb/en/library/mlinefromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (22,3,'MPointFromText','Syntax\n------ \nMPointFromText(wkt[,srid])\nMultiPointFromText(wkt[,srid])\n \nDescription\n----------- \nConstructs a MULTIPOINT value using its WKT representation\nand SRID.\n \nMPointFromText() and MultiPointFromText() are synonyms.\n \nExamples\n-------- \nCREATE TABLE gis_multi_point (g MULTIPOINT);\nSHOW FIELDS FROM gis_multi_point;\n \nINSERT INTO gis_multi_point VALUES\n (MultiPointFromText(\'MULTIPOINT(0 0,10 10,10 20,20\n20)\')),\n (MPointFromText(\'MULTIPOINT(1 1,11 11,11 21,21 21)\')),\n (MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4,\n10)))));\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mpointfromtext/','','https://mariadb.com/kb/en/library/mpointfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (23,3,'MPolyFromText','Syntax\n------ \nMPolyFromText(wkt[,srid])\nMultiPolygonFromText(wkt[,srid])\n \nDescription\n----------- \nConstructs a MULTIPOLYGON value using its WKT representation\nand SRID.\n \nMPolyFromText() and MultiPolygonFromText() are synonyms.\n \nExamples\n-------- \nCREATE TABLE gis_multi_polygon (g MULTIPOLYGON);\nSHOW FIELDS FROM gis_multi_polygon;\n \nINSERT INTO gis_multi_polygon VALUES\n (MultiPolygonFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84\n42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67\n13,59 13,59 18)))\')),\n (MPolyFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28\n26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59\n13,59 18)))\')),\n (MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0,\n3), Point(3, 3), Point(3, 0), Point(0, 3)))))));\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mpolyfromtext/','','https://mariadb.com/kb/en/library/mpolyfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (24,3,'MultiLineStringFromText','A synonym for MLineFromText.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/multilinestringfromtext/','','https://mariadb.com/kb/en/library/multilinestringfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (25,3,'MultiPointFromText','A synonym for MPointFromText.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/multipointfromtext/','','https://mariadb.com/kb/en/library/multipointfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (26,3,'MultiPolygonFromText','A synonym for MPolyFromText.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/multipolygonfromtext/','','https://mariadb.com/kb/en/library/multipolygonfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (27,3,'PointFromText','A synonym for ST_PointFromText.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/wkt-pointfromtext/','','https://mariadb.com/kb/en/library/wkt-pointfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (28,3,'PolyFromText','A synonym for ST_PolyFromText.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/wkt-polyfromtext/','','https://mariadb.com/kb/en/library/wkt-polyfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (29,3,'PolygonFromText','A synonym for ST_PolyFromText.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/polygonfromtext/','','https://mariadb.com/kb/en/library/polygonfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (30,3,'ST_AsText','Syntax\n------ \nST_AsText(g)\nAsText(g)\nST_AsWKT(g)\nAsWKT(g)\n \nDescription\n----------- \nConverts a value in internal geometry format to its WKT\nrepresentation and returns the string result.\n \nST_AsText(), AsText(), ST_AsWKT() and AsWKT() are all\nsynonyms.\n \nExamples\n-------- \nSET @g = \'LineString(1 1,4 4,6 6)\';\n \nSELECT ST_AsText(ST_GeomFromText(@g));\n+--------------------------------+\n| ST_AsText(ST_GeomFromText(@g)) |\n+--------------------------------+\n| LINESTRING(1 1,4 4,6 6) |\n+--------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_astext/','','https://mariadb.com/kb/en/library/st_astext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (31,3,'ST_ASWKT','A synonym for ST_ASTEXT().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_aswkt/','','https://mariadb.com/kb/en/library/st_aswkt/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (32,3,'ST_GeomCollFromText','Syntax\n------ \nST_GeomCollFromText(wkt[,srid])\nST_GeometryCollectionFromText(wkt[,srid])\nGeomCollFromText(wkt[,srid])\nGeometryCollectionFromText(wkt[,srid])\n \nDescription\n----------- \nConstructs a GEOMETRYCOLLECTION value using its WKT \nrepresentation and SRID.\n \nST_GeomCollFromText(), ST_GeometryCollectionFromText(),\nGeomCollFromText() and GeometryCollectionFromText() are all\nsynonyms.\n \nExample\n \nCREATE TABLE gis_geometrycollection (g GEOMETRYCOLLECTION);\nSHOW FIELDS FROM gis_geometrycollection;\n \nINSERT INTO gis_geometrycollection VALUES\n (GeomCollFromText(\'GEOMETRYCOLLECTION(POINT(0 0),\nLINESTRING(0 0,10 10))\')),\n (GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6),\nLineString(Point(3, 6), Point(7, 9)))))),\n (GeomFromText(\'GeometryCollection()\')),\n (GeomFromText(\'GeometryCollection EMPTY\'));\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_geomcollfromtext/','','https://mariadb.com/kb/en/library/st_geomcollfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (33,3,'ST_GeometryCollectionFromText','A synonym for ST_GeomCollFromText.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/st_geometrycollectionfromtext/','','https://mariadb.com/kb/en/library/st_geometrycollectionfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (34,3,'ST_GeometryFromText','A synonym for ST_GeomFromText.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_geometryfromtext/','','https://mariadb.com/kb/en/library/st_geometryfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (35,3,'ST_GeomFromText','Syntax\n------ \nST_GeomFromText(wkt[,srid])\nST_GeometryFromText(wkt[,srid])\nGeomFromText(wkt[,srid])\nGeometryFromText(wkt[,srid])\n \nDescription\n----------- \nConstructs a geometry value of any type using its WKT\nrepresentation and SRID.\n \nGeomFromText(), GeometryFromText(), ST_GeomFromText() and\nST_GeometryFromText() are all synonyms.\n \nExample\n \nSET @g = ST_GEOMFROMTEXT(\'POLYGON((1 1,1 5,4 9,6 9,9 3,7\n2,1 1))\');\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_geomfromtext/','','https://mariadb.com/kb/en/library/st_geomfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (36,3,'ST_LineFromText','Syntax\n------ \nST_LineFromText(wkt[,srid])\nST_LineStringFromText(wkt[,srid])\nLineFromText(wkt[,srid])\nLineStringFromText(wkt[,srid])\n \nDescription\n----------- \nConstructs a LINESTRING value using its WKT representation\nand SRID.\n \nST_LineFromText(), ST_LineStringFromText(),\nST_LineFromText() and ST_LineStringFromText() are all\nsynonyms.\n \nExamples\n-------- \nCREATE TABLE gis_line (g LINESTRING);\nSHOW FIELDS FROM gis_line;\n \nINSERT INTO gis_line VALUES\n (LineFromText(\'LINESTRING(0 0,0 10,10 0)\')),\n (LineStringFromText(\'LINESTRING(10 10,20 10,20 20,10 20,10\n10)\')),\n (LineStringFromWKB(AsWKB(LineString(Point(10, 10),\nPoint(40, 10)))));\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_linefromtext/','','https://mariadb.com/kb/en/library/st_linefromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (37,3,'ST_LineStringFromText','A synonym for ST_LineFromText.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/st_linestringfromtext/','','https://mariadb.com/kb/en/library/st_linestringfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (38,3,'ST_PointFromText','Syntax\n------ \nST_PointFromText(wkt[,srid])\nPointFromText(wkt[,srid])\n \nDescription\n----------- \nConstructs a POINT value using its WKT representation and\nSRID.\n \nST_PointFromText() and PointFromText() are synonyms.\n \nExamples\n-------- \nCREATE TABLE gis_point (g POINT);\nSHOW FIELDS FROM gis_point;\n \nINSERT INTO gis_point VALUES\n (PointFromText(\'POINT(10 10)\')),\n (PointFromText(\'POINT(20 10)\')),\n (PointFromText(\'POINT(20 20)\')),\n (PointFromWKB(AsWKB(PointFromText(\'POINT(10 20)\'))));\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_pointfromtext/','','https://mariadb.com/kb/en/library/st_pointfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (39,3,'ST_PolyFromText','Syntax\n------ \nST_PolyFromText(wkt[,srid])\nST_PolygonFromText(wkt[,srid])\nPolyFromText(wkt[,srid])\nPolygonFromText(wkt[,srid])\n \nDescription\n----------- \nConstructs a POLYGON value using its WKT representation and\nSRID.\n \nST_PolyFromText(), ST_PolygonFromText(), PolyFromText() and\nST_PolygonFromText() are all synonyms.\n \nExamples\n-------- \nCREATE TABLE gis_polygon (g POLYGON);\nINSERT INTO gis_polygon VALUES\n (PolygonFromText(\'POLYGON((10 10,20 10,20 20,10 20,10\n10))\')),\n (PolyFromText(\'POLYGON((0 0,50 0,50 50,0 50,0 0), (10\n10,20 10,20 20,10 20,10 10))\'));\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_polyfromtext/','','https://mariadb.com/kb/en/library/st_polyfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (40,3,'ST_PolygonFromText','A synonym for ST_PolyFromText.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_polygonfromtext/','','https://mariadb.com/kb/en/library/st_polygonfromtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (41,4,'Addition Operator (+)','Syntax\n------ \n+\n \nDescription\n----------- \nAddition.\n \nIf both operands are integers, the result is calculated with\nBIGINT precision. If either integer is unsigned, the result\nis also an unsigned integer.\n \nFor real or string operands, the operand with the highest\nprecision determines the result precision.\n \nExamples\n-------- \nSELECT 3+5;\n \n+-----+\n| 3+5 |\n+-----+\n| 8 |\n+-----+\n \n\n\nURL: https://mariadb.com/kb/en/library/addition-operator/','','https://mariadb.com/kb/en/library/addition-operator/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (42,4,'Subtraction Operator (-)','Syntax\n------ \n-\n \nDescription\n----------- \nSubtraction. The operator is also used as the unary minus\nfor changing sign.\n \nIf both operands are integers, the result is calculated with\nBIGINT precision. If either integer is unsigned, the result\nis also an unsigned integer, unless the\nNO_UNSIGNED_SUBTRACTION SQL_MODE is enabled, in which case\nthe result is always signed.\n \nFor real or string operands, the operand with the highest\nprecision determines the result precision.\n \nExamples\n-------- \nSELECT 96-9;\n \n+------+\n| 96-9 |\n+------+\n| 87 |\n+------+\n \nSELECT 15-17;\n \n+-------+\n| 15-17 |\n+-------+\n| -2 |\n+-------+\n \nSELECT 3.66 + 1.333;\n \n+--------------+\n| 3.66 + 1.333 |\n+--------------+\n| 4.993 |\n+--------------+\n \nUnary minus:\n \n SELECT - (3+5);\n+---------+\n| - (3+5) |\n+---------+\n| -8 |\n+---------+\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/subtraction-operator-/','','https://mariadb.com/kb/en/library/subtraction-operator-/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (43,4,'Division Operator (/)','Syntax\n------ \n/\n \nDescription\n----------- \nDivision operator. Dividing by zero will return NULL. By\ndefault, returns four digits after the decimal. This is\ndetermined by the server system variable\ndiv_precision_increment which by default is four. It can be\nset from 0 to 30.\n \nDividing by zero returns NULL. If the\nERROR_ON_DIVISION_BY_ZERO SQL_MODE is used (the default\nsince MariaDB 10.2.4), a division by zero also produces a\nwarning.\n \nExamples\n-------- \nSELECT 4/5;\n \n+--------+\n| 4/5 |\n+--------+\n| 0.8000 |\n+--------+\n \nSELECT 300/(2-2);\n+-----------+\n| 300/(2-2) |\n+-----------+\n| NULL |\n+-----------+\n \nSELECT 300/7;\n \n+---------+\n| 300/7 |\n+---------+\n| 42.8571 |\n+---------+\n \nChanging div_precision_increment for the session from the\ndefault of four to six:\n \nSET div_precision_increment = 6;\n \nSELECT 300/7;\n \n+-----------+\n| 300/7 |\n+-----------+\n| 42.857143 |\n+-----------+\n \nSELECT 300/7;\n \n+-----------+\n| 300/7 |\n+-----------+\n| 42.857143 |\n+-----------+\n \n\n\nURL: https://mariadb.com/kb/en/library/division-operator/','','https://mariadb.com/kb/en/library/division-operator/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (44,4,'Multiplication Operator (*)','Syntax\n------ \n*\n \nDescription\n----------- \nMultiplication operator.\n \nExamples\n-------- \nSELECT 7*6;\n \n+-----+\n| 7*6 |\n+-----+\n| 42 |\n+-----+\n \nSELECT 1234567890*9876543210;\n \n+-----------------------+\n| 1234567890*9876543210 |\n+-----------------------+\n| -6253480962446024716 |\n+-----------------------+\n \nSELECT 18014398509481984*18014398509481984.0;\n \n+---------------------------------------+\n| 18014398509481984*18014398509481984.0 |\n+---------------------------------------+\n| 324518553658426726783156020576256.0 |\n+---------------------------------------+\n \nSELECT 18014398509481984*18014398509481984;\n \n+-------------------------------------+\n| 18014398509481984*18014398509481984 |\n+-------------------------------------+\n| 0 |\n+-------------------------------------+\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/multiplication-operator/','','https://mariadb.com/kb/en/library/multiplication-operator/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (45,4,'Modulo Operator (%)','Syntax\n------ \nN % M\n \nDescription\n----------- \nModulo operator. Returns the remainder of N divided by M.\nSee also MOD.\n \nExamples\n-------- \nSELECT 1042 % 50;\n \n+-----------+\n| 1042 % 50 |\n+-----------+\n| 42 |\n+-----------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/modulo-operator/','','https://mariadb.com/kb/en/library/modulo-operator/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (46,4,'DIV','Syntax\n------ \nDIV\n \nDescription\n----------- \nInteger division. Similar to FLOOR(), but is safe with\nBIGINT values.\nIncorrect results may occur for non-integer operands that\nexceed BIGINT range.\n \nIf the ERROR_ON_DIVISION_BY_ZERO SQL_MODE is used, a\ndivision by zero produces an error. Otherwise, it returns\nNULL.\n \nThe remainder of a division can be obtained using the MOD\noperator.\n \nExamples\n-------- \nSELECT 300 DIV 7;\n \n+-----------+\n| 300 DIV 7 |\n+-----------+\n| 42 |\n+-----------+\n \nSELECT 300 DIV 0;\n \n+-----------+\n| 300 DIV 0 |\n+-----------+\n| NULL |\n+-----------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/div/','','https://mariadb.com/kb/en/library/div/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (47,4,'ABS','Syntax\n------ \nABS(X)\n \nDescription\n----------- \nReturns the absolute (non-negative) value of X. If X is not\na number, it is converted to a numeric type.\n \nExamples\n-------- \nSELECT ABS(42);\n+---------+\n| ABS(42) |\n+---------+\n| 42 |\n+---------+\n \nSELECT ABS(-42);\n+----------+\n| ABS(-42) |\n+----------+\n| 42 |\n+----------+\n \nSELECT ABS(DATE \'1994-01-01\');\n+------------------------+\n| ABS(DATE \'1994-01-01\') |\n+------------------------+\n| 19940101 |\n+------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/abs/','','https://mariadb.com/kb/en/library/abs/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (48,4,'ACOS','Syntax\n------ \nACOS(X)\n \nDescription\n----------- \nReturns the arc cosine of X, that is, the value whose cosine\nis X.\nReturns NULL if X is not in the range -1 to 1.\n \nExamples\n-------- \nSELECT ACOS(1);\n+---------+\n| ACOS(1) |\n+---------+\n| 0 |\n+---------+\n \nSELECT ACOS(1.0001);\n+--------------+\n| ACOS(1.0001) |\n+--------------+\n| NULL |\n+--------------+\n \nSELECT ACOS(0);\n+-----------------+\n| ACOS(0) |\n+-----------------+\n| 1.5707963267949 |\n+-----------------+\n \nSELECT ACOS(0.234);\n+------------------+\n| ACOS(0.234) |\n+------------------+\n| 1.33460644244679 |\n+------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/acos/','','https://mariadb.com/kb/en/library/acos/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (49,4,'ASIN','Syntax\n------ \nASIN(X)\n \nDescription\n----------- \nReturns the arc sine of X, that is, the value whose sine is\nX. Returns\nNULL if X is not in the range -1 to 1.\n \nExamples\n-------- \nSELECT ASIN(0.2);\n+--------------------+\n| ASIN(0.2) |\n+--------------------+\n| 0.2013579207903308 |\n+--------------------+\n \nSELECT ASIN(\'foo\');\n+-------------+\n| ASIN(\'foo\') |\n+-------------+\n| 0 |\n+-------------+\n \nSHOW WARNINGS;\n \n+---------+------+-----------------------------------------+\n| Level | Code | Message |\n+---------+------+-----------------------------------------+\n| Warning | 1292 | Truncated incorrect DOUBLE value: \'foo\'\n|\n+---------+------+-----------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/asin/','','https://mariadb.com/kb/en/library/asin/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (50,4,'ATAN','Syntax\n------ \nATAN(X)\n \nDescription\n----------- \nReturns the arc tangent of X, that is, the value whose\ntangent is X.\n \nExamples\n-------- \nSELECT ATAN(2);\n+--------------------+\n| ATAN(2) |\n+--------------------+\n| 1.1071487177940904 |\n+--------------------+\n \nSELECT ATAN(-2);\n+---------------------+\n| ATAN(-2) |\n+---------------------+\n| -1.1071487177940904 |\n+---------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/atan/','','https://mariadb.com/kb/en/library/atan/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (51,4,'ATAN2','Syntax\n------ \nATAN(Y,X), ATAN2(Y,X)\n \nDescription\n----------- \nReturns the arc tangent of the two variables X and Y. It is\nsimilar to\ncalculating the arc tangent of Y / X, except that the signs\nof both\narguments are used to determine the quadrant of the result.\n \nExamples\n-------- \nSELECT ATAN(-2,2);\n+---------------------+\n| ATAN(-2,2) |\n+---------------------+\n| -0.7853981633974483 |\n+---------------------+\n \nSELECT ATAN2(PI(),0);\n+--------------------+\n| ATAN2(PI(),0) |\n+--------------------+\n| 1.5707963267948966 |\n+--------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/atan2/','','https://mariadb.com/kb/en/library/atan2/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (52,4,'CEIL','Syntax\n------ \nCEIL(X)\n \nDescription\n----------- \nCEIL() is a synonym for CEILING().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/ceil/','','https://mariadb.com/kb/en/library/ceil/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (53,4,'CEILING','Syntax\n------ \nCEILING(X)\n \nDescription\n----------- \nReturns the smallest integer value not less than X.\n \nExamples\n-------- \nSELECT CEILING(1.23);\n+---------------+\n| CEILING(1.23) |\n+---------------+\n| 2 |\n+---------------+\n \nSELECT CEILING(-1.23);\n+----------------+\n| CEILING(-1.23) |\n+----------------+\n| -1 |\n+----------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/ceiling/','','https://mariadb.com/kb/en/library/ceiling/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (54,4,'CONV','Syntax\n------ \nCONV(N,from_base,to_base)\n \nDescription\n----------- \nConverts numbers between different number bases. Returns a\nstring\nrepresentation of the number N, converted from base\nfrom_base\nto base to_base.\n \nReturns NULL if any argument is NULL, or if the second or\nthird argument are not in the allowed range.\n \nThe argument N is interpreted as an integer, but may be\nspecified as an\ninteger or a string. The minimum base is 2 and the maximum\nbase is 36. If\nto_base is a negative number, N is regarded as a signed\nnumber.\nOtherwise, N is treated as unsigned. CONV() works with\n64-bit\nprecision.\n \nSome shortcuts for this function are also available: BIN(),\nOCT(), HEX(), UNHEX(). Also, MariaDB allows binary literal\nvalues and hexadecimal literal values.\n \nExamples\n-------- \nSELECT CONV(\'a\',16,2);\n+----------------+\n| CONV(\'a\',16,2) |\n+----------------+\n| 1010 |\n+----------------+\n \nSELECT CONV(\'6E\',18,8);\n+-----------------+\n| CONV(\'6E\',18,8) |\n+-----------------+\n| 172 |\n+-----------------+\n \nSELECT CONV(-17,10,-18);\n+------------------+\n| CONV(-17,10,-18) |\n+------------------+\n| -H |\n+------------------+\n \nSELECT CONV(12+\'10\'+\'10\'+0xa,10,10);\n+------------------------------+\n| CONV(12+\'10\'+\'10\'+0xa,10,10) |\n+------------------------------+\n| 42 |\n+------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/conv/','','https://mariadb.com/kb/en/library/conv/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (55,4,'COS','Syntax\n------ \nCOS(X)\n \nDescription\n----------- \nReturns the cosine of X, where X is given in radians.\n \nExamples\n-------- \nSELECT COS(PI());\n+-----------+\n| COS(PI()) |\n+-----------+\n| -1 |\n+-----------\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/cos/','','https://mariadb.com/kb/en/library/cos/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (56,4,'COT','Syntax\n------ \nCOT(X)\n \nDescription\n----------- \nReturns the cotangent of X.\n \nExamples\n-------- \nSELECT COT(42);\n+--------------------+\n| COT(42) |\n+--------------------+\n| 0.4364167060752729 |\n+--------------------+\n \nSELECT COT(12);\n+---------------------+\n| COT(12) |\n+---------------------+\n| -1.5726734063976893 |\n+---------------------+\n \nSELECT COT(0);\nERROR 1690 (22003): DOUBLE value is out of range in\n\'cot(0)\'\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/cot/','','https://mariadb.com/kb/en/library/cot/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (57,4,'CRC32','Syntax\n------ \nCRC32(expr)\n \nDescription\n----------- \nComputes a cyclic redundancy check value and returns a\n32-bit unsigned\nvalue. The result is NULL if the argument is NULL. The\nargument is\nexpected to be a string and (if possible) is treated as one\nif it is\nnot.\n \nExamples\n-------- \nSELECT CRC32(\'MariaDB\');\n+------------------+\n| CRC32(\'MariaDB\') |\n+------------------+\n| 4227209140 |\n+------------------+\n \nSELECT CRC32(\'mariadb\');\n+------------------+\n| CRC32(\'mariadb\') |\n+------------------+\n| 2594253378 |\n+------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/crc32/','','https://mariadb.com/kb/en/library/crc32/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (58,4,'DEGREES','Syntax\n------ \nDEGREES(X)\n \nDescription\n----------- \nReturns the argument X, converted from radians to degrees.\n \nThis is the converse of the RADIANS() function.\n \nExamples\n-------- \nSELECT DEGREES(PI());\n+---------------+\n| DEGREES(PI()) |\n+---------------+\n| 180 |\n+---------------+\n \nSELECT DEGREES(PI() / 2);\n+-------------------+\n| DEGREES(PI() / 2) |\n+-------------------+\n| 90 |\n+-------------------+\n \nSELECT DEGREES(45);\n+-----------------+\n| DEGREES(45) |\n+-----------------+\n| 2578.3100780887 |\n+-----------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/degrees/','','https://mariadb.com/kb/en/library/degrees/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (59,4,'EXP','Syntax\n------ \nEXP(X)\n \nDescription\n----------- \nReturns the value of e (the base of natural logarithms)\nraised to the\npower of X. The inverse of this function is LOG() (using a\nsingle\nargument only) or LN().\n \nIf X is NULL, this function returns NULL.\n \nExamples\n-------- \nSELECT EXP(2);\n+------------------+\n| EXP(2) |\n+------------------+\n| 7.38905609893065 |\n+------------------+\n \nSELECT EXP(-2);\n+--------------------+\n| EXP(-2) |\n+--------------------+\n| 0.1353352832366127 |\n+--------------------+\n \nSELECT EXP(0);\n+--------+\n| EXP(0) |\n+--------+\n| 1 |\n+--------+\n \nSELECT EXP(NULL);\n+-----------+\n| EXP(NULL) |\n+-----------+\n| NULL |\n+-----------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/exp/','','https://mariadb.com/kb/en/library/exp/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (60,4,'FLOOR','Syntax\n------ \nFLOOR(X)\n \nDescription\n----------- \nReturns the largest integer value not greater than X.\n \nExamples\n-------- \nSELECT FLOOR(1.23);\n+-------------+\n| FLOOR(1.23) |\n+-------------+\n| 1 |\n+-------------+\n \nSELECT FLOOR(-1.23);\n+--------------+\n| FLOOR(-1.23) |\n+--------------+\n| -2 |\n+--------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/floor/','','https://mariadb.com/kb/en/library/floor/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (61,4,'LN','Syntax\n------ \nLN(X)\n \nDescription\n----------- \nReturns the natural logarithm of X; that is, the base-e\nlogarithm of X.\nIf X is less than or equal to 0, or NULL, then NULL is\nreturned.\n \nThe inverse of this function is EXP().\n \nExamples\n-------- \nSELECT LN(2);\n+-------------------+\n| LN(2) |\n+-------------------+\n| 0.693147180559945 |\n+-------------------+\n \nSELECT LN(-2);\n+--------+\n| LN(-2) |\n+--------+\n| NULL |\n+--------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/ln/','','https://mariadb.com/kb/en/library/ln/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (62,4,'LOG','Syntax\n------ \nLOG(X), LOG(B,X)\n \nDescription\n----------- \nIf called with one parameter, this function returns the\nnatural\nlogarithm of X. If X is less than or equal to 0, then NULL\nis\nreturned.\n \nIf called with two parameters, it returns the logarithm of X\nto the base B. If B is \n\nURL: https://mariadb.com/kb/en/library/log/','','https://mariadb.com/kb/en/library/log/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (63,4,'LOG10','Syntax\n------ \nLOG10(X)\n \nDescription\n----------- \nReturns the base-10 logarithm of X.\n \nExamples\n-------- \nSELECT LOG10(2);\n+-------------------+\n| LOG10(2) |\n+-------------------+\n| 0.301029995663981 |\n+-------------------+\n \nSELECT LOG10(100);\n+------------+\n| LOG10(100) |\n+------------+\n| 2 |\n+------------+\n \nSELECT LOG10(-100);\n+-------------+\n| LOG10(-100) |\n+-------------+\n| NULL |\n+-------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/log10/','','https://mariadb.com/kb/en/library/log10/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (64,4,'LOG2','Syntax\n------ \nLOG2(X)\n \nDescription\n----------- \nReturns the base-2 logarithm of X.\n \nExamples\n-------- \nSELECT LOG2(4398046511104);\n+---------------------+\n| LOG2(4398046511104) |\n+---------------------+\n| 42 |\n+---------------------+\n \nSELECT LOG2(65536);\n+-------------+\n| LOG2(65536) |\n+-------------+\n| 16 |\n+-------------+\n \nSELECT LOG2(-100);\n+------------+\n| LOG2(-100) |\n+------------+\n| NULL |\n+------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/log2/','','https://mariadb.com/kb/en/library/log2/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (65,4,'MOD','Syntax\n------ \nMOD(N,M), N % M, N MOD M\n \nDescription\n----------- \nModulo operation. Returns the remainder of N divided by M.\nSee also Modulo Operator.\n \nIf the ERROR_ON_DIVISION_BY_ZERO SQL_MODE is used, any\nnumber modulus zero produces an error. Otherwise, it returns\nNULL.\n \nThe integer part of a division can be obtained using DIV.\n \nExamples\n-------- \nSELECT 1042 % 50;\n \n+-----------+\n| 1042 % 50 |\n+-----------+\n| 42 |\n+-----------+\n \nSELECT MOD(234, 10);\n+--------------+\n| MOD(234, 10) |\n+--------------+\n| 4 |\n+--------------+\n \nSELECT 253 % 7;\n \n+---------+\n| 253 % 7 |\n+---------+\n| 1 |\n+---------+\n \nSELECT MOD(29,9);\n+-----------+\n| MOD(29,9) |\n+-----------+\n| 2 |\n+-----------+\n \nSELECT 29 MOD 9;\n \n+----------+\n| 29 MOD 9 |\n+----------+\n| 2 |\n+----------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mod/','','https://mariadb.com/kb/en/library/mod/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (66,4,'OCT','Syntax\n------ \nOCT(N)\n \nDescription\n----------- \nReturns a string representation of the octal value of N,\nwhere N is a longlong (BIGINT) number. This is equivalent to\nCONV(N,10,8). Returns NULL if N is NULL.\n \nExamples\n-------- \nSELECT OCT(34);\n+---------+\n| OCT(34) |\n+---------+\n| 42 |\n+---------+\n \nSELECT OCT(12);\n+---------+\n| OCT(12) |\n+---------+\n| 14 |\n+---------+\n \n\n\nURL: https://mariadb.com/kb/en/library/oct/','','https://mariadb.com/kb/en/library/oct/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (67,4,'PI','Syntax\n------ \nPI()\n \nDescription\n----------- \nReturns the value of π (pi). The default number of decimal\nplaces\ndisplayed is six, but MariaDB uses the full double-precision\nvalue\ninternally.\n \nExamples\n-------- \nSELECT PI();\n+----------+\n| PI() |\n+----------+\n| 3.141593 |\n+----------+\n \nSELECT PI()+0.0000000000000000000000;\n \n+-------------------------------+\n| PI()+0.0000000000000000000000 |\n+-------------------------------+\n| 3.1415926535897931159980 |\n+-------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/pi/','','https://mariadb.com/kb/en/library/pi/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (68,4,'POW','Syntax\n------ \nPOW(X,Y)\n \nDescription\n----------- \nReturns the value of X raised to the power of Y.\n \nPOWER() is a synonym.\n \nExamples\n-------- \nSELECT POW(2,3);\n+----------+\n| POW(2,3) |\n+----------+\n| 8 |\n+----------+\n \nSELECT POW(2,-2);\n+-----------+\n| POW(2,-2) |\n+-----------+\n| 0.25 |\n+-----------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/pow/','','https://mariadb.com/kb/en/library/pow/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (69,4,'POWER','Syntax\n------ \nPOWER(X,Y)\n \nDescription\n----------- \nThis is a synonym for POW(), which returns the value of X\nraised to the power of Y.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/power/','','https://mariadb.com/kb/en/library/power/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (70,4,'RADIANS','Syntax\n------ \nRADIANS(X)\n \nDescription\n----------- \nReturns the argument X, converted from degrees to radians.\nNote that\nπ radians equals 180 degrees. \n \nThis is the converse of the DEGREES() function.\n \nExamples\n-------- \nSELECT RADIANS(45);\n+-------------------+\n| RADIANS(45) |\n+-------------------+\n| 0.785398163397448 |\n+-------------------+\n \nSELECT RADIANS(90);\n+-----------------+\n| RADIANS(90) |\n+-----------------+\n| 1.5707963267949 |\n+-----------------+\n \nSELECT RADIANS(PI());\n+--------------------+\n| RADIANS(PI()) |\n+--------------------+\n| 0.0548311355616075 |\n+--------------------+\n \nSELECT RADIANS(180);\n+------------------+\n| RADIANS(180) |\n+------------------+\n| 3.14159265358979 |\n+------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/radians/','','https://mariadb.com/kb/en/library/radians/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (71,4,'RAND','Syntax\n------ \nRAND(), RAND(N)\n \nDescription\n----------- \nReturns a random DOUBLE precision floating point value v in\nthe range 0 \n\nURL: https://mariadb.com/kb/en/library/rand/','','https://mariadb.com/kb/en/library/rand/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (72,4,'ROUND','Syntax\n------ \nROUND(X), ROUND(X,D)\n \nDescription\n----------- \nRounds the argument X to D decimal places. The rounding\nalgorithm\ndepends on the data type of X. D defaults to 0 if not\nspecified.\nD can be negative to cause D digits left of the decimal\npoint of the\nvalue X to become zero.\n \nExamples\n-------- \nSELECT ROUND(-1.23);\n+--------------+\n| ROUND(-1.23) |\n+--------------+\n| -1 |\n+--------------+\n \nSELECT ROUND(-1.58);\n+--------------+\n| ROUND(-1.58) |\n+--------------+\n| -2 |\n+--------------+\n \nSELECT ROUND(1.58); \n+-------------+\n| ROUND(1.58) |\n+-------------+\n| 2 |\n+-------------+\n \nSELECT ROUND(1.298, 1);\n+-----------------+\n| ROUND(1.298, 1) |\n+-----------------+\n| 1.3 |\n+-----------------+\n \nSELECT ROUND(1.298, 0);\n+-----------------+\n| ROUND(1.298, 0) |\n+-----------------+\n| 1 |\n+-----------------+\n \nSELECT ROUND(23.298, -1);\n+-------------------+\n| ROUND(23.298, -1) |\n+-------------------+\n| 20 |\n+-------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/round/','','https://mariadb.com/kb/en/library/round/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (73,4,'SIGN','Syntax\n------ \nSIGN(X)\n \nDescription\n----------- \nReturns the sign of the argument as -1, 0, or 1, depending\non whether\nX is negative, zero, or positive.\n \nExamples\n-------- \nSELECT SIGN(-32);\n+-----------+\n| SIGN(-32) |\n+-----------+\n| -1 |\n+-----------+\n \nSELECT SIGN(0);\n+---------+\n| SIGN(0) |\n+---------+\n| 0 |\n+---------+\n \nSELECT SIGN(234);\n+-----------+\n| SIGN(234) |\n+-----------+\n| 1 |\n+-----------+\n \n\n\nURL: https://mariadb.com/kb/en/library/sign/','','https://mariadb.com/kb/en/library/sign/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (74,4,'SIN','Syntax\n------ \nSIN(X)\n \nDescription\n----------- \nReturns the sine of X, where X is given in radians.\n \nExamples\n-------- \nSELECT SIN(1.5707963267948966);\n+-------------------------+\n| SIN(1.5707963267948966) |\n+-------------------------+\n| 1 |\n+-------------------------+\n \nSELECT SIN(PI());\n+----------------------+\n| SIN(PI()) |\n+----------------------+\n| 1.22460635382238e-16 |\n+----------------------+\n \nSELECT ROUND(SIN(PI()));\n+------------------+\n| ROUND(SIN(PI())) |\n+------------------+\n| 0 |\n+------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/sin/','','https://mariadb.com/kb/en/library/sin/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (75,4,'SQRT','Syntax\n------ \nSQRT(X)\n \nDescription\n----------- \nReturns the square root of X. If X is negative, NULL is\nreturned.\n \nExamples\n-------- \nSELECT SQRT(4);\n+---------+\n| SQRT(4) |\n+---------+\n| 2 |\n+---------+\n \nSELECT SQRT(20);\n+------------------+\n| SQRT(20) |\n+------------------+\n| 4.47213595499958 |\n+------------------+\n \nSELECT SQRT(-16);\n+-----------+\n| SQRT(-16) |\n+-----------+\n| NULL |\n+-----------+\n \nSELECT SQRT(1764);\n+------------+\n| SQRT(1764) |\n+------------+\n| 42 |\n+------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/sqrt/','','https://mariadb.com/kb/en/library/sqrt/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (76,4,'TAN','Syntax\n------ \nTAN(X)\n \nDescription\n----------- \nReturns the tangent of X, where X is given in radians.\n \nExamples\n-------- \nSELECT TAN(0.7853981633974483);\n+-------------------------+\n| TAN(0.7853981633974483) |\n+-------------------------+\n| 0.9999999999999999 |\n+-------------------------+\n \nSELECT TAN(PI());\n+-----------------------+\n| TAN(PI()) |\n+-----------------------+\n| -1.22460635382238e-16 |\n+-----------------------+\n \nSELECT TAN(PI()+1);\n+-----------------+\n| TAN(PI()+1) |\n+-----------------+\n| 1.5574077246549 |\n+-----------------+\n \nSELECT TAN(RADIANS(PI()));\n+--------------------+\n| TAN(RADIANS(PI())) |\n+--------------------+\n| 0.0548861508080033 |\n+--------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/tan/','','https://mariadb.com/kb/en/library/tan/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (77,4,'TRUNCATE','This page documents the TRUNCATE function. See TRUNCATE\nTABLE for the DDL statement.\n \nSyntax\n------ \nTRUNCATE(X,D)\n \nDescription\n----------- \nReturns the number X, truncated to D decimal places. If D is\n0, the\nresult has no decimal point or fractional part. D can be\nnegative to\ncause D digits left of the decimal point of the value X to\nbecome\nzero.\n \nExamples\n-------- \nSELECT TRUNCATE(1.223,1);\n+-------------------+\n| TRUNCATE(1.223,1) |\n+-------------------+\n| 1.2 |\n+-------------------+\n \nSELECT TRUNCATE(1.999,1);\n+-------------------+\n| TRUNCATE(1.999,1) |\n+-------------------+\n| 1.9 |\n+-------------------+\n \nSELECT TRUNCATE(1.999,0); \n+-------------------+\n| TRUNCATE(1.999,0) |\n+-------------------+\n| 1 |\n+-------------------+\n \nSELECT TRUNCATE(-1.999,1);\n+--------------------+\n| TRUNCATE(-1.999,1) |\n+--------------------+\n| -1.9 |\n+--------------------+\n \nSELECT TRUNCATE(122,-2);\n+------------------+\n| TRUNCATE(122,-2) |\n+------------------+\n| 100 |\n+------------------+\n \nSELECT TRUNCATE(10.28*100,0);\n+-----------------------+\n| TRUNCATE(10.28*100,0) |\n+-----------------------+\n| 1028 |\n+-----------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/truncate/','','https://mariadb.com/kb/en/library/truncate/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (78,5,'Plugin Overview','Plugins are server components that enhance MariaDB in some\nway. These can be anything from new storage engines, plugins\nfor enhancing full-text parsing, or even small enhancements,\nsuch as a plugin to get a timestamp as an integer.\n \nQuerying Plugin Information\n \nThere are a number of ways to see which plugins are\ncurrently active.\n \nA server almost always has a large number of active plugins,\nbecause the server contains a large number of built-in\nplugins, which are active by default and cannot be\nuninstalled.\n \nQuerying Plugin Information with SHOW PLUGINS\n \nThe SHOW PLUGINS statement can be used to query information\nabout all active plugins.\n \nFor example:\n \nSHOW PLUGINS;\n \n+----------------------------+----------+--------------------+---------+---------+\n| Name | Status | Type | Library | License |\n+----------------------------+----------+--------------------+---------+---------+\n...\n| mysql_native_password | ACTIVE | AUTHENTICATION | NULL |\nGPL |\n| mysql_old_password | ACTIVE | AUTHENTICATION | NULL | GPL\n|\n| MRG_MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |\n...\n+----------------------------+----------+--------------------+---------+---------+\n \nIf a plugin\'s Library column has the NULL value, then the\nplugin is built-in, and it cannot be uninstalled.\n \nQuerying Plugin Information with information_schema.PLUGINS\n \nThe information_schema.PLUGINS table can be queried to get\nmore detailed information about plugins.\n \nFor example:\n \nSELECT * FROM information_schema.PLUGINS\\G\n...\n*************************** 6. row\n***************************\n PLUGIN_NAME: CSV\n PLUGIN_VERSION: 1.0\n PLUGIN_STATUS: ACTIVE\n PLUGIN_TYPE: STORAGE ENGINE\n PLUGIN_TYPE_VERSION: 100003.0\n PLUGIN_LIBRARY: NULL\nPLUGIN_LIBRARY_VERSION: NULL\n PLUGIN_AUTHOR: Brian Aker, MySQL AB\n PLUGIN_DESCRIPTION: CSV storage engine\n PLUGIN_LICENSE: GPL\n LOAD_OPTION: FORCE\n PLUGIN_MATURITY: Stable\n PLUGIN_AUTH_VERSION: 1.0\n*************************** 7. row\n***************************\n PLUGIN_NAME: MEMORY\n PLUGIN_VERSION: 1.0\n PLUGIN_STATUS: ACTIVE\n PLUGIN_TYPE: STORAGE ENGINE\n PLUGIN_TYPE_VERSION: 100003.0\n PLUGIN_LIBRARY: NULL\nPLUGIN_LIBRARY_VERSION: NULL\n PLUGIN_AUTHOR: MySQL AB\n PLUGIN_DESCRIPTION: Hash based, stored in memory, useful\nfor temporary tables\n PLUGIN_LICENSE: GPL\n LOAD_OPTION: FORCE\n PLUGIN_MATURITY: Stable\n PLUGIN_AUTH_VERSION: 1.0\n...\n \nIf a plugin\'s PLUGIN_LIBRARY column has the NULL value,\nthen the plugin is built-in, and it cannot be uninstalled.\n \nQuerying Plugin Information with mysql.plugin\n \nThe mysql.plugin table can be queried to get information\nabout installed plugins.\n \nThis table only contains information about plugins that have\nbeen installed via the following methods:\nThe INSTALL SONAME statement.\nThe INSTALL PLUGIN statement.\nThe mysql_plugin utility.\n \nThis table does not contain information about:\nBuilt-in plugins.\nPlugins loaded with the --plugin-load-add option.\nPlugins loaded with the --plugin-load option.\n \nThis table only contains enough information to reload the\nplugin when the server is restarted, which means it only\ncontains the plugin name and the plugin library.\n \nFor example:\n \nSELECT * FROM mysql.plugin;\n \n+------+------------+\n| name | dl |\n+------+------------+\n| PBXT | libpbxt.so |\n+------+------------+\n \nInstalling a Plugin\n \nThere are three primary ways to install a plugin:\nA plugin can be installed dynamically with an SQL statement.\nA plugin can be installed with a mysqld option, but it\nrequires a server restart.\nA plugin can be installed with the mysql_plugin utility,\nwhile the server is completely offline.\n \nWhen you are installing a plugin, you also have to ensure\nthat:\nThe server\'s plugin directory is properly configured, and\nthe plugin\'s library is in the plugin directory.\nThe server\'s minimum plugin maturity is properly\nconfigured, and the plugin is mature enough to be installed.\n \nInstalling a Plugin Dynamically\n \nA plugin can be installed dynamically by executing either\nthe INSTALL SONAME or the INSTALL PLUGIN statement.\n \nIf a plugin is installed with one of these statements, then\na record will be added to the mysql.plugins table for the\nplugin. This means that the plugin will automatically be\nloaded every time the server restarts, unless specifically\nuninstalled or deactivated.\n \nInstalling a Plugin with INSTALL SONAME\n \nYou can install a plugin dynamically by executing the\nINSTALL SONAME statement. INSTALL SONAME installs all\nplugins from the given plugin library. This could be\nrequired for some plugin libraries.\n \nFor example, to install all plugins in the server_audit\nplugin library (which is currently only the server_audit\naudit plugin), you could execute the following:\n \nINSTALL SONAME \'server_audit\';\n \nInstalling a Plugin with INSTALL PLUGIN\n \nYou can install a plugin dynamically by executing the\nINSTALL PLUGIN statement. INSTALL PLUGIN installs a single\nplugin from the given plugin library.\n \nFor example, to install the server_audit audit plugin from\nthe server_audit plugin library, you could execute the\nfollowing:\n \nINSTALL PLUGIN server_audit SONAME \'server_audit\';\n \nInstalling a Plugin with Plugin Load Options\n \nA plugin can be installed with a mysqld option by providing\neither the --plugin-load-add or the --plugin-load option.\n \nIf a plugin is installed with one of these options, then a\nrecord will not be added to the mysql.plugins table for the\nplugin. This means that if the server is restarted without\nthe same option set, then the plugin will not automatically\nbe loaded.\n \nInstalling a Plugin with --plugin-load-add\n \nYou can install a plugin with the --plugin-load-add option\nby specifying the option as a command-line argument to\nmysqld or by specifying the option in a relevant server\noption group in an option file.\n \nThe --plugin-load-add option uses the following format:\nPlugins can be specified in the format name=library, where\nname is the plugin name and library is the plugin library.\nThis format installs a single plugin from the given plugin\nlibrary.\nPlugins can also be specified in the format library, where\nlibrary is the plugin library. This format installs all\nplugins from the given plugin library.\nMultiple plugins can be specified by separating them with\nsemicolons.\n \nFor example, to install all plugins in the server_audit\nplugin library (which is currently only the server_audit\naudit plugin) and also the ed25519 authentication plugin\nfrom the auth_ed25519 plugin library, you could set the\noption to the following values on the command-line:\n \n$ mysqld --user=mysql --plugin-load-add=\'server_audit\'\n--plugin-load-add=\'ed25519=auth_ed25519\'\n \nYou could also set the option to the same values in an\noption file:\n \n[mariadb]\n...\nplugin_load_add = server_audit\nplugin_load_add = ed25519=auth_ed25519\n \nSpecial care must be taken when specifying both the\n--plugin-load option and the --plugin-load-add option\ntogether. The --plugin-load option resets the plugin load\nlist, and this can cause unexpected problems if you are not\naware. The --plugin-load-add option does not reset the\nplugin load list, so it is much safer to use. See Specifying\nMultiple Plugin Load Options for more information.\n \nInstalling a Plugin with --plugin-load\n \nYou can install a plugin with the --plugin-load option by\nspecifying the option as a command-line argument to mysqld\nor by specifying the option in a relevant server option\ngroup in an option file.\n \nThe --plugin-load option uses the following format:\nPlugins can be specified in the format name=library, where\nname is the plugin name and library is the plugin library.\nThis format installs a single plugin from the given plugin\nlibrary.\nPlugins can also be specified in the format library, where\nlibrary is the plugin library. This format installs all\nplugins from the given plugin library.\nMultiple plugins can be specified by separating them with\nsemicolons.\n \nFor example, to install all plugins in the server_audit\nplugin library (which is currently only the server_audit\naudit plugin) and also the ed25519 authentication plugin\nfrom the auth_ed25519 plugin library, you could set the\noption to the following values on the command-line:\n \n$ mysqld --user=mysql\n--plugin-load=\'server_audit;ed25519=auth_ed25519\'\n \nYou could also set the option to the same values in an\noption file:\n \n[mariadb]\n...\nplugin_load = server_audit;ed25519=auth_ed25519\n \nSpecial care must be taken when specifying the --plugin-load\noption multiple times, or when specifying both the\n--plugin-load option and the --plugin-load-add option\ntogether. The --plugin-load option resets the plugin load\nlist, and this can cause unexpected problems if you are not\naware. The --plugin-load-add option does not reset the\nplugin load list, so it is much safer to use. See Specifying\nMultiple Plugin Load Options for more information.\n \nSpecifying Multiple Plugin Load Options\n \nSpecial care must be taken when specifying the --plugin-load\noption multiple times, or when specifying both the\n--plugin-load option and the --plugin-load-add option. The\n--plugin-load option resets the plugin load list, and this\ncan cause unexpected problems if you are not aware. The\n--plugin-load-add option does not reset the plugin load\nlist, so it is much safer to use.\n \nThis can have the following consequences:\nIf the --plugin-load option is specified multiple times,\nthen only the last instance will have any effect. For\nexample, in the following case, the first instance of the\noption is reset:\n \n[mariadb]\n...\nplugin_load = server_audit\nplugin_load = ed25519=auth_ed25519\nIf the --plugin-load option is specified after the\n--plugin-load-add option, then it will also reset the\nchanges made by that option. For example, in the following\ncase, the --plugin-load-add option does not do anything,\nbecause the subsequent --plugin-load option resets the\nplugin load list:\n \n[mariadb]\n...\nplugin_load_add = server_audit\nplugin_load = ed25519=auth_ed25519\nIn contrast, if the --plugin-load option is specified before\nthe --plugin-load-add option, then it will work fine,\nbecause the --plugin-load-add option does not reset the\nplugin load list. For example, in the following case, both\nplugins are properly loaded:\n \n[mariadb]\n...\nplugin_load = server_audit\nplugin_load_add = ed25519=auth_ed25519\n \nInstalling a Plugin with mysql_plugin\n \nA plugin can be installed with the mysql_plugin utility if\nthe server is completely offline. \n \nThe syntax is:\n \nmysql_plugin [options] \n ENABLE|DISABLE\n \nFor example, to install the server_audit audit plugin, you\ncould execute the following:\n \nmysql_plugin server_audit ENABLE\n \nIf a plugin is installed with this utility, then a record\nwill be added to the mysql.plugins table for the plugin.\nThis means that the plugin will automatically be loaded\nevery time the server restarts, unless specifically\nuninstalled or deactivated.\n \nConfiguring the Plugin Directory\n \nWhen a plugin is being installed, the server looks for the\nplugin\'s library in the server\'s plugin directory. This\ndirectory is configured by the plugin_dir system variable.\nThis can be specified as a command-line argument to mysqld\nor it can be specified in a relevant server option group in\nan option file. For example:\n \n[mariadb]\n...\nplugin_dir = /usr/lib64/mysql/plugin\n \nConfiguring the Minimum Plugin Maturity\n \nWhen a plugin is being installed, the server compares the\nplugin\'s maturity level against the server\'s minimum\nallowed plugin maturity. This can help prevent users from\nusing unstable plugins on production servers. This minimum\nplugin maturity is configured by the plugin_maturity system\nvariable. This can be specified as a command-line argument\nto mysqld or it can be specified in a relevant server option\ngroup in an option file. For example:\n \n[mariadb]\n...\nplugin_maturity = stable\n \nConfiguring Plugin Activation at Server Startup\n \nA plugin will be loaded by default when the server starts\nif:\nThe plugin was installed with the INSTALL SONAME statement.\nThe plugin was installed with the INSTALL PLUGIN statement.\nThe plugin was installed with the mysql_plugin utility.\nThe server is configured to load the plugin with the\n--plugin-load-add option.\nThe server is configured to load the plugin with the\n--plugin-load option.\n \nThis behavior can be changed with special options that take\nthe form --plugin-name. For example, for the server_audit\naudit plugin, the special option is called --server-audit.\n \nThe possible values for these special options are:\n \nOption Value | Description | \n \nOFF | Disables the plugin without removing it from the\nmysql.plugins table. | \n \nON | Enables the plugin. If the plugin cannot be\ninitialized, then the server will still continue starting\nup, but the plugin will be disabled. | \n \nFORCE | Enables the plugin. If the plugin cannot be\ninitialized, then the server will fail to start with an\nerror. | \n \nFORCE_PLUS_PERMANENT | Enables the plugin. If the plugin\ncannot be initialized, then the server will fail to start\nwith an error. In addition, the plugin cannot be uninstalled\nwith UNINSTALL SONAME or UNINSTALL PLUGIN while the server\nis running. | \n \nA plugin\'s status can be found by looking at the\nPLUGIN_STATUS column of the information_schema.PLUGINS\ntable.\n \nUninstalling Plugins\n \nPlugins that are found in the mysql.plugin table, that is\nthose that were installed with INSTALL SONAME, INSTALL\nPLUGIN or mysql_plugin can be uninstalled in one of two\nways:\nThe UNINSTALL SONAME or the UNINSTALL PLUGIN statement while\nthe server is running\nWith mysql_plugin while the server is offline.\n \nPlugins that were enabled as a --plugin-load option do not\nneed to be uninstalled. If --plugin-load is omitted the next\ntime the server starts, or the plugin is not listed as one\nof the --plugin-load entries, the plugin will not be loaded.\n \nUNINSTALL PLUGIN uninstalls a single installed plugin, while\nUNINSTALL SONAME uninstalls all plugins belonging to a given\nlibrary.\n \n\n\nURL: https://mariadb.com/kb/en/library/plugin-overview/','','https://mariadb.com/kb/en/library/plugin-overview/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (79,5,'INSTALL PLUGIN','Syntax\n------ \nINSTALL PLUGIN [IF NOT EXISTS] plugin_name SONAME\n\'plugin_library\'\n \nDescription\n----------- \nThis statement installs an individual plugin from the\nspecified library. To install the whole library (which could\nbe required), use INSTALL SONAME.\n \nplugin_name is the name of the plugin as defined in the\nplugin declaration structure contained in the library file.\nPlugin names are\nnot case sensitive. For maximal compatibility, plugin names\nshould be limited\nto ASCII letters, digits, and underscore, because they are\nused in C source\nfiles, shell command lines, M4 and Bourne shell scripts, and\nSQL environments.\n \nplugin_library is the name of the shared library that\ncontains the plugin code. Before MariaDB 5.5.21, the name\nshould include the file name extension (for\nexample, libmyplugin.so or libmyplugin.dll). Starting from\nMariaDB 5.5.21, the file name extension can be omitted\n(which makes the statement look the same on all\narchitectures).\n \nThe shared library must be located in the plugin directory\n(that is,\nthe directory named by the plugin_dir system variable). The\nlibrary must be in the plugin directory itself, not in a\nsubdirectory. By\ndefault, plugin_dir is plugin directory under the directory\nnamed by\nthe pkglibdir configuration variable, but it can be changed\nby setting\nthe value of plugin_dir at server startup. For example, set\nits value in a my.cnf file:\n \n[mysqld]\nplugin_dir=/path/to/plugin/directory\nIf the value of plugin_dir is a relative path name, it is\ntaken to be relative to the MySQL base directory (the value\nof the basedir\nsystem variable).\n \nINSTALL PLUGIN adds a line to the mysql.plugin table that\ndescribes the plugin. This table contains the plugin name\nand library file\nname.\n \nINSTALL PLUGIN causes the server to read\noption (my.cnf) files just as during server startup. This\nenables the plugin to\npick up any relevant options from those files. It is\npossible to add plugin\noptions to an option file even before loading a plugin (if\nthe loose prefix is\nused). It is also possible to uninstall a plugin, edit\nmy.cnf, and install the\nplugin again. Restarting the plugin this way enables it to\nthe new option\nvalues without a server restart.\n \nBefore MySQL 5.1.33, a plugin was started with each option\nset to its\ndefault value.\n \nINSTALL PLUGIN also loads and initializes the plugin code to\nmake the plugin available for use. A plugin is initialized\nby executing its\ninitialization function, which handles any setup that the\nplugin must perform\nbefore it can be used.\n \nTo use INSTALL PLUGIN, you must have the\nINSERT privilege for the mysql.plugin table.\n \nAt server startup, the server loads and initializes any\nplugin that is\nlisted in the mysql.plugin table. This means that a plugin\nis installed\nwith INSTALL PLUGIN only once, not every time the server\nstarts. Plugin loading at startup does not occur if the\nserver is started with\nthe --skip-grant-tables option.\n \nWhen the server shuts down, it executes the deinitialization\nfunction\nfor each plugin that is loaded so that the plugin has a\nchance to\nperform any final cleanup.\n \nIf you need to load plugins for a single server startup when\nthe\n--skip-grant-tables option is given (which tells the server\nnot to read system tables), use the \n--plugin-load mysqld option.\n \nIF NOT EXISTS\n \nWhen the IF NOT EXISTS clause is used, MariaDB will return a\nnote instead of an error if the specified plugin already\nexists. See SHOW WARNINGS.\n \nExamples\n-------- \nINSTALL PLUGIN sphinx SONAME \'ha_sphinx.so\';\n \nStarting from MariaDB 5.5.21, the extension can be omitted:\n \nINSTALL PLUGIN innodb SONAME \'ha_xtradb\';\n \nFrom MariaDB 10.4.0:\n \nINSTALL PLUGIN IF NOT EXISTS example SONAME \'ha_example\';\n \nQuery OK, 0 rows affected (0.104 sec)\n \nINSTALL PLUGIN IF NOT EXISTS example SONAME \'ha_example\';\n \nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n \nSHOW WARNINGS;\n \n+-------+------+------------------------------------+\n| Level | Code | Message |\n+-------+------+------------------------------------+\n| Note | 1968 | Plugin \'example\' already installed |\n+-------+------+------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/install-plugin/','','https://mariadb.com/kb/en/library/install-plugin/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (80,5,'UNINSTALL PLUGIN','Syntax\n------ \nUNINSTALL PLUGIN [IF EXISTS] plugin_name\n \nDescription\n----------- \nThis statement removes a single installed plugin. To\nuninstall the whole library which contains the plugin, use\nUNINSTALL SONAME. You cannot uninstall a plugin if any table\nthat uses it is open.\n \nplugin_name must be the name of some plugin that is listed\nin the mysql.plugin table. The server executes the plugin\'s\ndeinitialization\nfunction and removes the row for the plugin from the\nmysql.plugin\ntable, so that subsequent server restarts will not load and\ninitialize\nthe plugin. UNINSTALL PLUGIN does not remove the plugin\'s\nshared library file.\n \nTo use UNINSTALL PLUGIN, you must have the\nDELETE privilege for the mysql.plugin table.\n \nIF EXISTS\n \nIf the IF EXISTS clause is used, MariaDB will return a note\ninstead of an error if the plugin does not exist. See SHOW\nWARNINGS.\n \nExamples\n-------- \nUNINSTALL PLUGIN example;\n \nFrom MariaDB 10.4.0:\n \nUNINSTALL PLUGIN IF EXISTS example;\n \nQuery OK, 0 rows affected (0.099 sec)\n \nUNINSTALL PLUGIN IF EXISTS example;\n \nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n \nSHOW WARNINGS;\n \n+-------+------+-------------------------------+\n| Level | Code | Message |\n+-------+------+-------------------------------+\n| Note | 1305 | PLUGIN example does not exist |\n+-------+------+-------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/uninstall-plugin/','','https://mariadb.com/kb/en/library/uninstall-plugin/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (81,5,'INSTALL SONAME','INSTALL SONAME has been supported since MariaDB 5.5.21.\n \nSyntax\n------ \nINSTALL SONAME \'plugin_library\'\n \nDescription\n----------- \nThis statement is a variant of INSTALL PLUGIN. It installs\nall plugins from a given plugin_library. See INSTALL PLUGIN\nfor details.\n \nplugin_library is the name of the shared library that\ncontains the plugin code. The file name extension (for\nexample, libmyplugin.so or libmyplugin.dll) can be omitted\n(which makes the statement look the same on all\narchitectures).\n \nThe shared library must be located in the plugin directory\n(that is,\nthe directory named by the plugin_dir system variable). The\nlibrary must be in the plugin directory itself, not in a\nsubdirectory. By\ndefault, plugin_dir is plugin directory under the directory\nnamed by\nthe pkglibdir configuration variable, but it can be changed\nby setting\nthe value of plugin_dir at server startup. For example, set\nits value in a my.cnf file:\n \n[mysqld]\nplugin_dir=/path/to/plugin/directory\nIf the value of plugin_dir is a relative path name, it is\ntaken to be relative to the MySQL base directory (the value\nof the basedir\nsystem variable).\n \nINSTALL SONAME adds one or more lines to the mysql.plugin\ntable that\ndescribes the plugin. This table contains the plugin name\nand library file\nname.\n \nINSTALL SONAME causes the server to read\noption (my.cnf) files just as during server startup. This\nenables the plugin to\npick up any relevant options from those files. It is\npossible to add plugin\noptions to an option file even before loading a plugin (if\nthe loose prefix is\nused). It is also possible to uninstall a plugin, edit\nmy.cnf, and install the\nplugin again. Restarting the plugin this way enables it to\nthe new option\nvalues without a server restart.\n \nINSTALL SONAME also loads and initializes the plugin code to\nmake the plugin available for use. A plugin is initialized\nby executing its\ninitialization function, which handles any setup that the\nplugin must perform\nbefore it can be used.\n \nTo use INSTALL SONAME, you must have the\nINSERT privilege for the mysql.plugin table.\n \nAt server startup, the server loads and initializes any\nplugin that is\nlisted in the mysql.plugin table. This means that a plugin\nis installed\nwith INSTALL SONAME only once, not every time the server\nstarts. Plugin loading at startup does not occur if the\nserver is started with\nthe --skip-grant-tables option.\n \nWhen the server shuts down, it executes the deinitialization\nfunction\nfor each plugin that is loaded so that the plugin has a\nchance to\nperform any final cleanup.\n \nIf you need to load plugins for a single server startup when\nthe\n--skip-grant-tables option is given (which tells the server\nnot to read system tables), use the \n--plugin-load mysqld option.\n \nIf you need to install only one plugin from a library, use\nthe INSTALL PLUGIN statement.\n \nExamples\n-------- \nTo load the XtraDB storage engine and all of its\ninformation_schema tables with one statement, use\n \nINSTALL SONAME \'ha_xtradb\';\n \nThis statement can be used instead of INSTALL PLUGIN even\nwhen the library contains only one plugin:\n \nINSTALL SONAME \'ha_sequence\';\n \n\n\nURL: https://mariadb.com/kb/en/library/install-soname/','','https://mariadb.com/kb/en/library/install-soname/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (82,5,'UNINSTALL SONAME','UNINSTALL SONAMEhas been supported since MariaDB 5.5.21.\n \nSyntax\n------ \nUNINSTALL SONAME [IF EXISTS] \'plugin_library\'\n \nDescription\n----------- \nThis statement is a variant of UNINSTALL PLUGIN statement,\nthat removes all plugins belonging to a specified\nplugin_library. See UNINSTALL PLUGIN for details.\n \nplugin_library is the name of the shared library that\ncontains the plugin code. The file name extension (for\nexample, libmyplugin.so or libmyplugin.dll) can be omitted\n(which makes the statement look the same on all\narchitectures).\n \nTo use UNINSTALL SONAME, you must have the\nDELETE privilege for the mysql.plugin table.\n \nIF EXISTS\n \nIf the IF EXISTS clause is used, MariaDB will return a note\ninstead of an error if the plugin library does not exist.\nSee SHOW WARNINGS.\n \nExamples\n-------- \nTo uninstall the XtraDB plugin and all of its\ninformation_schema tables with one statement, use\n \nUNINSTALL SONAME \'ha_xtradb\';\n \nFrom MariaDB 10.4.0:\n \nUNINSTALL SONAME IF EXISTS \'ha_example\';\n \nQuery OK, 0 rows affected (0.099 sec)\n \nUNINSTALL SONAME IF EXISTS \'ha_example\';\n \nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n \nSHOW WARNINGS;\n \n+-------+------+-------------------------------------+\n| Level | Code | Message |\n+-------+------+-------------------------------------+\n| Note | 1305 | SONAME ha_example.so does not exist |\n+-------+------+-------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/uninstall-soname/','','https://mariadb.com/kb/en/library/uninstall-soname/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (83,6,'MBR Definition','Description\n----------- \nThe MBR (Minimum Bounding Rectangle), or Envelope is the\nbounding\ngeometry, formed by the minimum and maximum (X,Y)\ncoordinates:\n \nExamples\n-------- \n((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mbr-definition/','','https://mariadb.com/kb/en/library/mbr-definition/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (84,6,'MBRContains','Syntax\n------ \nMBRContains(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether the Minimum Bounding\nRectangle of\ng1 contains the Minimum Bounding Rectangle of g2. This tests\nthe\nopposite relationship as MBRWithin().\n \nExamples\n-------- \nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\n \nSET @g2 = GeomFromText(\'Point(1 1)\');\n \nSELECT MBRContains(@g1,@g2), MBRContains(@g2,@g1);\n+----------------------+----------------------+\n| MBRContains(@g1,@g2) | MBRContains(@g2,@g1) |\n+----------------------+----------------------+\n| 1 | 0 |\n+----------------------+----------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mbrcontains/','','https://mariadb.com/kb/en/library/mbrcontains/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (85,6,'MBRDisjoint','Syntax\n------ \nMBRDisjoint(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether the Minimum Bounding\nRectangles of the two geometries g1 and g2 are disjoint. Two\ngeometries are disjoint if they do not intersect, that is\ntouch or overlap.\n \nExamples\n-------- \nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECTmbrdisjoint(@g1,@g2);\n+----------------------+\n| mbrdisjoint(@g1,@g2) |\n+----------------------+\n| 1 |\n+----------------------+\n \nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrdisjoint(@g1,@g2);\n+----------------------+\n| mbrdisjoint(@g1,@g2) |\n+----------------------+\n| 0 |\n+----------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mbrdisjoint/','','https://mariadb.com/kb/en/library/mbrdisjoint/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (86,6,'MBREqual','Syntax\n------ \nMBREqual(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether the Minimum Bounding\nRectangles of\nthe two geometries g1 and g2 are the same.\n \nExamples\n-------- \nSET @g1=GEOMFROMTEXT(\'LINESTRING(0 0, 1 2)\');\nSET @g2=GEOMFROMTEXT(\'POLYGON((0 0, 0 2, 1 2, 1 0, 0\n0))\');\nSELECT MbrEqual(@g1,@g2);\n+-------------------+\n| MbrEqual(@g1,@g2) |\n+-------------------+\n| 1 |\n+-------------------+\n \nSET @g1=GEOMFROMTEXT(\'LINESTRING(0 0, 1 3)\');\nSET @g2=GEOMFROMTEXT(\'POLYGON((0 0, 0 2, 1 4, 1 0, 0\n0))\');\nSELECT MbrEqual(@g1,@g2);\n+-------------------+\n| MbrEqual(@g1,@g2) |\n+-------------------+\n| 0 |\n+-------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mbrequal/','','https://mariadb.com/kb/en/library/mbrequal/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (87,6,'MBRIntersects','Syntax\n------ \nMBRIntersects(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether the Minimum Bounding\nRectangles of the two geometries g1 and g2 intersect.\n \nExamples\n-------- \nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrintersects(@g1,@g2);\n+------------------------+\n| mbrintersects(@g1,@g2) |\n+------------------------+\n| 1 |\n+------------------------+\n \nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECT mbrintersects(@g1,@g2);\n+------------------------+\n| mbrintersects(@g1,@g2) |\n+------------------------+\n| 0 |\n+------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mbrintersects/','','https://mariadb.com/kb/en/library/mbrintersects/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (88,6,'MBROverlaps','Syntax\n------ \nMBROverlaps(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether the Minimum Bounding\nRectangles of\nthe two geometries g1 and g2 overlap. The term spatially\noverlaps is\nused if two geometries intersect and their intersection\nresults in a\ngeometry of the same dimension but not equal to either of\nthe given\ngeometries.\n \nExamples\n-------- \nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECT mbroverlaps(@g1,@g2);\n+----------------------+\n| mbroverlaps(@g1,@g2) |\n+----------------------+\n| 0 |\n+----------------------+\n \nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbroverlaps(@g1,@g2);\n+----------------------+\n| mbroverlaps(@g1,@g2) |\n+----------------------+\n| 0 |\n+----------------------+\n \nSET @g1 = GeomFromText(\'Polygon((0 0,0 4,4 4,4 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbroverlaps(@g1,@g2);\n+----------------------+\n| mbroverlaps(@g1,@g2) |\n+----------------------+\n| 1 |\n+----------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mbroverlaps/','','https://mariadb.com/kb/en/library/mbroverlaps/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (89,6,'MBRTouches','Syntax\n------ \nMBRTouches(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether the Minimum Bounding\nRectangles of\nthe two geometries g1 and g2 touch. Two geometries spatially\ntouch if\nthe interiors of the geometries do not intersect, but the\nboundary of\none of the geometries intersects either the boundary or the\ninterior\nof the other.\n \nExamples\n-------- \nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECT mbrtouches(@g1,@g2);\n+---------------------+\n| mbrtouches(@g1,@g2) |\n+---------------------+\n| 0 |\n+---------------------+\n \nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrtouches(@g1,@g2);\n+---------------------+\n| mbrtouches(@g1,@g2) |\n+---------------------+\n| 1 |\n+---------------------+\n \nSET @g1 = GeomFromText(\'Polygon((0 0,0 4,4 4,4 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrtouches(@g1,@g2);\n+---------------------+\n| mbrtouches(@g1,@g2) |\n+---------------------+\n| 0 |\n+---------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mbrtouches/','','https://mariadb.com/kb/en/library/mbrtouches/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (90,6,'MBRWithin','Syntax\n------ \nMBRWithin(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether the Minimum Bounding\nRectangle of\ng1 is within the Minimum Bounding Rectangle of g2. This\ntests the\nopposite relationship as MBRContains().\n \nExamples\n-------- \nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((0 0,0 5,5 5,5 0,0 0))\');\nSELECT MBRWithin(@g1,@g2), MBRWithin(@g2,@g1);\n+--------------------+--------------------+\n| MBRWithin(@g1,@g2) | MBRWithin(@g2,@g1) |\n+--------------------+--------------------+\n| 1 | 0 |\n+--------------------+--------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mbrwithin/','','https://mariadb.com/kb/en/library/mbrwithin/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (91,7,'CASE OPERATOR','Syntax\n------ \nCASE value WHEN [compare_value] THEN result [WHEN\n[compare_value] THEN\nresult ...] [ELSE result] END\n \nCASE WHEN [condition] THEN result [WHEN [condition] THEN\nresult ...]\n[ELSE result] END\n \nDescription\n----------- \nThe first version returns the result where\nvalue=compare_value. The\nsecond version returns the result for the first condition\nthat is\ntrue. If there was no matching result value, the result\nafter ELSE is\nreturned, or NULL if there is no ELSE part.\n \nThere is also a CASE statement, which differs from the CASE\noperator described here.\n \nExamples\n-------- \nSELECT CASE 1 WHEN 1 THEN \'one\' WHEN 2 THEN \'two\' ELSE\n\'more\' END;\n \n+------------------------------------------------------------+\n| CASE 1 WHEN 1 THEN \'one\' WHEN 2 THEN \'two\' ELSE\n\'more\' END |\n+------------------------------------------------------------+\n| one |\n+------------------------------------------------------------+\n \nSELECT CASE WHEN 1>0 THEN \'true\' ELSE \'false\' END;\n \n+--------------------------------------------+\n| CASE WHEN 1>0 THEN \'true\' ELSE \'false\' END |\n+--------------------------------------------+\n| true |\n+--------------------------------------------+\n \nSELECT CASE BINARY \'B\' WHEN \'a\' THEN 1 WHEN \'b\' THEN 2\nEND;\n \n+-----------------------------------------------------+\n| CASE BINARY \'B\' WHEN \'a\' THEN 1 WHEN \'b\' THEN 2 END\n|\n+-----------------------------------------------------+\n| NULL |\n+-----------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/case-operator/','','https://mariadb.com/kb/en/library/case-operator/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (92,7,'IF Function','Syntax\n------ \nIF(expr1,expr2,expr3)\n \nDescription\n----------- \nIf expr1 is TRUE (expr1 0 and expr1 NULL) then IF()\nreturns expr2; otherwise it returns expr3. IF() returns a\nnumeric\nor string value, depending on the context in which it is\nused.\n \nNote: There is also an IF statement which differs from the\nIF() function described here.\n \nExamples\n-------- \nSELECT IF(1>2,2,3);\n+-------------+\n| IF(1>2,2,3) |\n+-------------+\n| 3 |\n+-------------+\n \nSELECT IF(1\n\nURL: https://mariadb.com/kb/en/library/if-function/','','https://mariadb.com/kb/en/library/if-function/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (93,7,'IFNULL','Syntax\n------ \nIFNULL(expr1,expr2)\n \nDescription\n----------- \nIf expr1 is not NULL, IFNULL() returns expr1; otherwise it\nreturns\nexpr2. IFNULL() returns a numeric or string value, depending\non the\ncontext in which it is used.\n \nExamples\n-------- \nSELECT IFNULL(1,0); \n+-------------+\n| IFNULL(1,0) |\n+-------------+\n| 1 |\n+-------------+\n \nSELECT IFNULL(NULL,10);\n+-----------------+\n| IFNULL(NULL,10) |\n+-----------------+\n| 10 |\n+-----------------+\n \nSELECT IFNULL(1/0,10);\n+----------------+\n| IFNULL(1/0,10) |\n+----------------+\n| 10.0000 |\n+----------------+\n \nSELECT IFNULL(1/0,\'yes\');\n+-------------------+\n| IFNULL(1/0,\'yes\') |\n+-------------------+\n| yes |\n+-------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/ifnull/','','https://mariadb.com/kb/en/library/ifnull/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (94,7,'NULLIF','Syntax\n------ \nNULLIF(expr1,expr2)\n \nDescription\n----------- \nReturns NULL if expr1 = expr2 is true, otherwise returns\nexpr1. This is\nthe same as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1\nEND.\n \nExamples\n-------- \nSELECT NULLIF(1,1);\n+-------------+\n| NULLIF(1,1) |\n+-------------+\n| NULL |\n+-------------+\n \nSELECT NULLIF(1,2);\n+-------------+\n| NULLIF(1,2) |\n+-------------+\n| 1 |\n+-------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/nullif/','','https://mariadb.com/kb/en/library/nullif/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (95,8,'CHANGE MASTER TO','Syntax\n------ \nCHANGE MASTER [\'connection_name\'] TO master_def [,\nmaster_def] ...\n \nmaster_def:\n MASTER_BIND = \'interface_name\'\n | MASTER_HOST = \'host_name\'[\n | MASTER_USER = \'user_name\'\n | MASTER_PASSWORD = \'password\'\n | MASTER_PORT = port_num\n | MASTER_CONNECT_RETRY = interval\n | MASTER_HEARTBEAT_PERIOD = interval\n | MASTER_LOG_FILE = \'master_log_name\'\n | MASTER_LOG_POS = master_log_pos\n | RELAY_LOG_FILE = \'relay_log_name\'\n | RELAY_LOG_POS = relay_log_pos\n | MASTER_DELAY = interval\n | MASTER_SSL = {0|1}\n | MASTER_SSL_CA = \'ca_file_name\'\n | MASTER_SSL_CAPATH = \'ca_directory_name\'\n | MASTER_SSL_CERT = \'cert_file_name\'\n | MASTER_SSL_CRL = \'crl_file_name\'\n | MASTER_SSL_CRLPATH = \'crl_directory_name\'\n | MASTER_SSL_KEY = \'key_file_name\'\n | MASTER_SSL_CIPHER = \'cipher_list\'\n | MASTER_SSL_VERIFY_SERVER_CERT = {0|1}\n | MASTER_USE_GTID = {current_pos|slave_pos|no}\n | IGNORE_SERVER_IDS = (server_id_list)\n | DO_DOMAIN_IDS = ([N,..])\n | IGNORE_DOMAIN_IDS = ([N,..])\n \nDescription\n----------- \nThe CHANGE MASTER statement sets the options that a\nreplication slave uses to connect to and replicate from a\nreplication master. \n \nMariaDB until 10.0.7\n \nIn MariaDB 10.0.7 and before, the relay_log_purge system\nvariable was silently set to 0 when CHANGE MASTER was\nexecuted.\n \nMulti-Source Replication\n \nMulti-source replication was added in MariaDB 10.0.1.\n \nIf you are using multi-source replication, then you need to\nspecify a connection name when you execute CHANGE MASTER.\nThere are two ways to do this:\nSetting the default_master_connection system variable prior\nto executing CHANGE MASTER.\nSetting the connection_name parameter when executing CHANGE\nMASTER.\n \ndefault_master_connection\n \nSET default_master_connection = \'gandalf\';\n \nSTOP SLAVE;\n \nCHANGE MASTER TO \n MASTER_PASSWORD=\'new3cret\';\n \nSTART SLAVE;\n \nconnection_name\n \nSTOP SLAVE \'gandalf\';\n \nCHANGE MASTER \'gandalf\' TO \n MASTER_PASSWORD=\'new3cret\';\n \nSTART SLAVE \'gandalf\';\n \nOptions\n \nConnection Options\n \nMASTER_USER\n \nThe MASTER_USER option for CHANGE MASTER defines the user\naccount that the replication slave will use to connect to\nthe replication master.\n \nThis user account will need the REPLICATION SLAVE privilege\non the master.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO\n MASTER_USER=\'repl\',\n MASTER_PASSWORD=\'new3cret\';\n \nSTART SLAVE;\n \nMASTER_PASSWORD\n \nThe MASTER_USER option for CHANGE MASTER defines the\npassword that the replication slave will use to connect to\nthe replication master as the user account defined by the\nMASTER_USER option.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO \n MASTER_PASSWORD=\'new3cret\';\n \nSTART SLAVE;\n \nMASTER_HOST\n \nThe MASTER_HOST option for CHANGE MASTER defines the\nhostname or IP address of the replication master.\n \nIf you set the value of the MASTER_HOST option to the empty\nstring, then that is not the same as not setting the\noption\'s value at all. In MariaDB 5.5 and later, if you set\nthe value of the MASTER_HOST option to the empty string,\nthen the CHANGE MASTER command will fail with an error. In\nMariaDB 5.3 and before, if you set the value of the\nMASTER_HOST option to the empty string, then the CHANGE\nMASTER command would succeed, but the subsequent START SLAVE\ncommand would fail.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO\n MASTER_HOST=\'dbserver1.example.com\',\n MASTER_USER=\'repl\',\n MASTER_PASSWORD=\'new3cret\',\n MASTER_USE_GTID=slave_pos;\n \nSTART SLAVE;\n \nIf you set the value of the MASTER_HOST option in a CHANGE\nMASTER command, then the slave assumes that the master is\ndifferent from before, even if you set the value of this\noption to the same value it had previously. In this\nscenario, the slave will consider the old values for the\nmaster\'s binary\nlog file name and position to be invalid for the new master.\nAs a side effect, if you do not explicitly set the values of\nthe MASTER_LOG_FILE and MASTER_LOG_POS options in the\nstatement, then the statement will be implicitly appended\nwith MASTER_LOG_FILE=\'\' and MASTER_LOG_POS=4. However, if\nyou enable GTID mode for replication by setting the\nMASTER_USE_GTID option to some value other than no in the\nstatement, then these values will effectively be ignored\nanyway.\n \nReplication slaves cannot connect to replication masters\nusing Unix socket files or Windows named pipes. The\nreplication slave must connect to the replication master\nusing TCP/IP.\n \nMASTER_PORT\n \nThe MASTER_PORT option for CHANGE MASTER defines the TCP/IP\nport of the replication master.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO\n MASTER_HOST=\'dbserver1.example.com\',\n MASTER_PORT=3307,\n MASTER_USER=\'repl\',\n MASTER_PASSWORD=\'new3cret\',\n MASTER_USE_GTID=slave_pos;\n \nSTART SLAVE;\n \nIf you set the value of the MASTER_PORT option in a CHANGE\nMASTER command, then the slave assumes that the master is\ndifferent from before, even if you set the value of this\noption to the same value it had previously. In this\nscenario, the slave will consider the old values for the\nmaster\'s binary\nlog file name and position to be invalid for the new master.\nAs a side effect, if you do not explicitly set the values of\nthe MASTER_LOG_FILE and MASTER_LOG_POS options in the\nstatement, then the statement will be implicitly appended\nwith MASTER_LOG_FILE=\'\' and MASTER_LOG_POS=4. However, if\nyou enable GTID mode for replication by setting the\nMASTER_USE_GTID option to some value other than no in the\nstatement, then these values will effectively be ignored\nanyway.\n \nReplication slaves cannot connect to replication masters\nusing Unix socket files or Windows named pipes. The\nreplication slave must connect to the replication master\nusing TCP/IP.\n \nMASTER_CONNECT_RETRY\n \nThe MASTER_CONNECT_RETRY option for CHANGE MASTER defines\nhow many seconds that the slave will wait between connection\nretries. The default is 60.\n \nSTOP SLAVE;\n \nCHANGE MASTER TO \n MASTER_CONNECT_RETRY=20;\n \nSTART SLAVE;\n \nThe number of connection attempts is limited by the\nmaster_retry_count option. It can be set either on the\ncommand-line or in a server option group in an option file\nprior to starting up the server. For example:\n \n[mariadb]\n...\nmaster_retry_count=4294967295\n \nMASTER_BIND\n \nThe MASTER_BIND option for CHANGE MASTER is only supported\nby MySQL 5.6.2 and later and by MySQL NDB Cluster 7.3.1 and\nlater. This option is not yet supported by MariaDB. See\nMDEV-19248 for more information.\n \nThe MASTER_BIND option for CHANGE MASTER can be used on\nreplication slaves that have multiple network interfaces to\nchoose which network interface the slave will use to connect\nto the master.\n \nMASTER_HEARTBEAT_PERIOD\n \nThe MASTER_HEARTBEAT_PERIOD option for CHANGE MASTER can be\nused to set the interval in seconds between replication\nheartbeats. Whenever the master\'s binary log is updated\nwith an event, the waiting period for the next heartbeat is\nreset.\n \nThis option\'s interval argument has the following\ncharacteristics:\nIt is a decimal value with a range of 0 to 4294967 seconds.\nIt has a resolution of hundredths of a second.\nIts smallest valid non-zero value is 0.001.\nIts default value is the value of the slave_net_timeout\nsystem variable divided by 2.\nIf it\'s set to 0, then heartbeats are disabled.\n \nHeartbeats are sent by the master only if there are no\nunsent events in the binary log file for a period longer\nthan the interval.\n \nIf the RESET SLAVE statement is executed, then the heartbeat\ninterval is reset to the default.\n \nIf the slave_net_timeout system variable is set to a value\nthat is lower than the current heartbeat interval, then a\nwarning will be issued.\n \nTLS Options\n \nThe TLS options are used for providing information about\nTLS. The options can be set even on slaves that are compiled\nwithout TLS support. The TLS options are saved to either the\ndefault master.info file or the file that is configured by\nthe master_info_file option, but these TLS options are\nignored unless the slave supports TLS.\n \nSee Replication with Secure Connections for more\ninformation.\n \nMASTER_SSL\n \nThe MASTER_SSL option for CHANGE MASTER tells the slave\nwhether to force TLS for the connection. The valid values\nare 0 or 1.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO\n MASTER_SSL=1;\n \nSTART SLAVE;\n \nMASTER_SSL_CA\n \nThe MASTER_SSL_CA option for CHANGE MASTER defines a path to\na PEM file that should contain one or more X509 certificates\nfor trusted Certificate Authorities (CAs) to use for TLS.\nThis option requires that you use the absolute path, not a\nrelative path. This option implies the MASTER_SSL option.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\n \nSTART SLAVE;\n \nSee Secure Connections Overview: Certificate Authorities\n(CAs) for more information.\n \nMASTER_SSL_CAPATH\n \nThe MASTER_SSL_CAPATH option for CHANGE MASTER defines a\npath to a directory that contains one or more PEM files that\nshould each contain one X509 certificate for a trusted\nCertificate Authority (CA) to use for TLS. This option\nrequires that you use the absolute path, not a relative\npath. The directory specified by this option needs to be run\nthrough the openssl rehash command. This option implies the\nMASTER_SSL option.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CAPATH=\'/etc/my.cnf.d/certificates/ca/\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\n \nSTART SLAVE;\n \nSee Secure Connections Overview: Certificate Authorities\n(CAs) for more information.\n \nMASTER_SSL_CERT\n \nThe MASTER_SSL_CERT option for CHANGE MASTER defines a path\nto the X509 certificate file to use for TLS. This option\nrequires that you use the absolute path, not a relative\npath. This option implies the MASTER_SSL option.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\n \nSTART SLAVE;\n \nMASTER_SSL_CRL\n \nThe MASTER_SSL_CRL option for CHANGE MASTER defines a path\nto a PEM file that should contain one or more revoked X509\ncertificates to use for TLS. This option requires that you\nuse the absolute path, not a relative path.\n \nThis option is only supported if the server was built with\nOpenSSL. If the server was built with yaSSL, then this\noption is not supported. See TLS and Cryptography Libraries\nUsed by MariaDB for more information about which libraries\nare used on which platforms.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1,\n MASTER_SSL_CRL=\'/etc/my.cnf.d/certificates/crl.pem\';\n \nSTART SLAVE;\n \nSee Secure Connections Overview: Certificate Revocation\nLists (CRLs) for more information.\n \nMASTER_SSL_CRLPATH\n \nThe MASTER_SSL_CRLPATH option for CHANGE MASTER defines a\npath to a directory that contains one or more PEM files that\nshould each contain one revoked X509 certificate to use for\nTLS. This option requires that you use the absolute path,\nnot a relative path. The directory specified by this\nvariable needs to be run through the openssl rehash command.\n \nThis option is only supported if the server was built with\nOpenSSL. If the server was built with yaSSL, then this\noption is not supported. See TLS and Cryptography Libraries\nUsed by MariaDB for more information about which libraries\nare used on which platforms.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1,\n MASTER_SSL_CRLPATH=\'/etc/my.cnf.d/certificates/crl/\';\n \nSTART SLAVE;\n \nSee Secure Connections Overview: Certificate Revocation\nLists (CRLs) for more information.\n \nMASTER_SSL_KEY\n \nThe MASTER_SSL_KEY option for CHANGE MASTER defines a path\nto a private key file to use for TLS. This option requires\nthat you use the absolute path, not a relative path. This\noption implies the MASTER_SSL option.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\n \nSTART SLAVE;\n \nMASTER_SSL_CIPHER\n \nThe MASTER_SSL_CIPHER option for CHANGE MASTER defines the\nlist of permitted ciphers or cipher suites to use for TLS.\nBesides cipher names, if MariaDB was compiled with OpenSSL,\nthis option could be set to \"SSLv3\" or \"TLSv1.2\" to\nallow all SSLv3 or all TLSv1.2 ciphers. Note that the\nTLSv1.3 ciphers cannot be excluded when using OpenSSL, even\nby using this option. See Using TLSv1.3 for details. This\noption implies the MASTER_SSL option.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1,\n MASTER_SSL_CIPHER=\'TLSv1.2\';\n \nSTART SLAVE;\n \nMASTER_SSL_VERIFY_SERVER_CERT\n \nThe MASTER_SSL_VERIFY_SERVER_CERT option for CHANGE MASTER\nenables server certificate verification. This option is\ndisabled by default.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\n \nSTART SLAVE;\n \nSee Secure Connections Overview: Server Certificate\nVerification for more information.\n \nBinary Log Options\n \nThese options are related to the binary log position on the\nmaster.\n \nMASTER_LOG_FILE\n \nThe MASTER_LOG_FILE option for CHANGE MASTER can be used\nalong with MASTER_LOG_POS to specify the coordinates at\nwhich the slave\'s I/O thread should begin reading from the\nmaster\'s binary logs the next time the thread starts.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4;\n \nSTART SLAVE;\n \nThe MASTER_LOG_FILE and MASTER_LOG_POS options cannot be\nspecified if the RELAY_LOG_FILE and RELAY_LOG_POS options\nwere also specified.\n \nThe MASTER_LOG_FILE and MASTER_LOG_POS options are\neffectively ignored if you enable GTID mode for replication\nby setting the MASTER_USE_GTID option to some value other\nthan no in the statement.\n \nMASTER_LOG_POS\n \nThe MASTER_LOG_POS option for CHANGE MASTER can be used\nalong with MASTER_LOG_FILE to specify the coordinates at\nwhich the slave\'s I/O thread should begin reading from the\nmaster\'s binary logs the next time the thread starts.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4;\n \nSTART SLAVE;\n \nThe MASTER_LOG_FILE and MASTER_LOG_POS options cannot be\nspecified if the RELAY_LOG_FILE and RELAY_LOG_POS options\nwere also specified.\n \nThe MASTER_LOG_FILE and MASTER_LOG_POS options are\neffectively ignored if you enable GTID mode for replication\nby setting the MASTER_USE_GTID option to some value other\nthan no in the statement.\n \nRelay Log Options\n \nThese options are related to the relay log position on the\nslave.\n \nRELAY_LOG_FILE\n \nThe RELAY_LOG_FILE option for CHANGE MASTER can be used\nalong with the RELAY_LOG_POS option to specify the\ncoordinates at which the slave\'s SQL thread should begin\nreading from the relay log the next time the thread starts.\n \nThe CHANGE MASTER statement usually deletes all relay log\nfiles. However, if the RELAY_LOG_FILE and/or RELAY_LOG_POS\noptions are specified, then existing relay log files are\nkept.\n \nWhen you want to change the relay log position, you only\nneed to stop the slave\'s SQL thread. The slave\'s I/O\nthread can continue running. The STOP SLAVE and START SLAVE\nstatements support the SQL_THREAD option for this scenario.\nFor example:\n \nSTOP SLAVE SQL_THREAD;\n \nCHANGE MASTER TO\n RELAY_LOG_FILE=\'slave-relay-bin.006\',\n RELAY_LOG_POS=4025;\n \nSTART SLAVE SQL_THREAD;\n \nWhen the value of this option is changed, the metadata about\nthe slave\'s SQL thread\'s position in the relay logs will\nalso be changed in the relay-log.info file or the file that\nis configured by the relay_log_info_file system variable.\n \nThe RELAY_LOG_FILE and RELAY_LOG_POS options cannot be\nspecified if the MASTER_LOG_FILE and MASTER_LOG_POS options\nwere also specified.\n \nRELAY_LOG_POS\n \nThe RELAY_LOG_POS option for CHANGE MASTER can be used along\nwith the RELAY_LOG_FILE option to specify the coordinates at\nwhich the slave\'s SQL thread should begin reading from the\nrelay log the next time the thread starts.\n \nThe CHANGE MASTER statement usually deletes all relay log\nfiles. However, if the RELAY_LOG_FILE and/or RELAY_LOG_POS\noptions are specified, then existing relay log files are\nkept.\n \nWhen you want to change the relay log position, you only\nneed to stop the slave\'s SQL thread. The slave\'s I/O\nthread can continue running. The STOP SLAVE and START SLAVE\nstatements support the SQL_THREAD option for this scenario.\nFor example:\n \nSTOP SLAVE SQL_THREAD;\n \nCHANGE MASTER TO\n RELAY_LOG_FILE=\'slave-relay-bin.006\',\n RELAY_LOG_POS=4025;\n \nSTART SLAVE SQL_THREAD;\n \nWhen the value of this option is changed, the metadata about\nthe slave\'s SQL thread\'s position in the relay logs will\nalso be changed in the relay-log.info file or the file that\nis configured by the relay_log_info_file system variable.\n \nThe RELAY_LOG_FILE and RELAY_LOG_POS options cannot be\nspecified if the MASTER_LOG_FILE and MASTER_LOG_POS options\nwere also specified.\n \nGTID Options\n \nMASTER_USE_GTID\n \nThe MASTER_USE_GTID option for CHANGE MASTER was first added\nin MariaDB 10.0.2 to enable replication with Global\nTransaction IDs (GTIDs).\n \nThe MASTER_USE_GTID option for CHANGE MASTER can be used to\nconfigure the slave to use the global transaction ID (GTID)\nwhen connecting to a master. The possible values are:\ncurrent_pos - Replicate in GTID mode and use\ngtid_current_pos as the position to start downloading\ntransactions from the master.\nslave_pos - Replicate in GTID mode and use gtid_slave_pos as\nthe position to start downloading transactions from the\nmaster.\nno - Don\'t replicate in GTID mode.\n \nFor example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO\n MASTER_USE_GTID = current_pos;\n \nSTART SLAVE;\n \nOr:\n \nSTOP SLAVE;\n \nSET GLOBAL gtid_slave_pos=\'0-1-153\';\n \nCHANGE MASTER TO\n MASTER_USE_GTID = slave','','https://mariadb.com/kb/en/library/change-master-to/');
-update help_topic set description = CONCAT(description, '_pos;\n \nSTART SLAVE;\n \nReplication Filter Options\n \nIGNORE_SERVER_IDS\n \nThe IGNORE_SERVER_IDS option for CHANGE MASTER can be used\nto configure a replication slave to ignore binary log events\nthat originated from certain servers. Filtered binary log\nevents will not get logged to the slave’s relay log, and\nthey will not be applied by the slave.\n \nThe option\'s value can be specified by providing a\ncomma-separated list of server_id values. For example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO \n IGNORE_SERVER_IDS = (3,5);\nSTART SLAVE;\n \nIf you would like to clear a previously set list, then you\ncan set the value to an empty list. For example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO \n IGNORE_SERVER_IDS = ();\nSTART SLAVE;\n \nDO_DOMAIN_IDS\n \nThe DO_DOMAIN_IDS option for CHANGE MASTER was first added\nin MariaDB 10.1.2.\n \nThe DO_DOMAIN_IDS option for CHANGE MASTER can be used to\nconfigure a replication slave to only apply binary log\nevents if the transaction\'s GTID is in a specific\ngtid_domain_id value. Filtered binary log events will not\nget logged to the slave’s relay log, and they will not be\napplied by the slave.\n \nThe option\'s value can be specified by providing a\ncomma-separated list of gtid_domain_id values. Duplicate\nvalues are automatically ignored. For example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO \n DO_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n \nIf you would like to clear a previously set list, then you\ncan set the value to an empty list. For example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO \n DO_DOMAIN_IDS = ();\nSTART SLAVE;\n \nThe DO_DOMAIN_IDS option and the IGNORE_DOMAIN_IDS option\ncannot both be set to non-empty values at the same time. If\nyou want to set the DO_DOMAIN_IDS option, and the\nIGNORE_DOMAIN_IDS option was previously set, then you need\nto clear the value of the IGNORE_DOMAIN_IDS option. For\nexample:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO \n IGNORE_DOMAIN_IDS = (), \n DO_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n \nThe DO_DOMAIN_IDS option can only be specified if the slave\nis replicating in GTID mode. Therefore, the MASTER_USE_GTID\noption must also be set to some value other than no in order\nto use this option.\n \nIGNORE_DOMAIN_IDS\n \nThe IGNORE_DOMAIN_IDS option for CHANGE MASTER was first\nadded in MariaDB 10.1.2.\n \nThe IGNORE_DOMAIN_IDS option for CHANGE MASTER can be used\nto configure a replication slave to ignore binary log events\nif the transaction\'s GTID is in a specific gtid_domain_id\nvalue. Filtered binary log events will not get logged to the\nslave’s relay log, and they will not be applied by the\nslave.\n \nThe option\'s value can be specified by providing a\ncomma-separated list of gtid_domain_id values. Duplicate\nvalues are automatically ignored. For example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO \n IGNORE_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n \nIf you would like to clear a previously set list, then you\ncan set the value to an empty list. For example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO \n IGNORE_DOMAIN_IDS = ();\nSTART SLAVE;\n \nThe DO_DOMAIN_IDS option and the IGNORE_DOMAIN_IDS option\ncannot both be set to non-empty values at the same time. If\nyou want to set the IGNORE_DOMAIN_IDS option, and the\nDO_DOMAIN_IDS option was previously set, then you need to\nclear the value of the DO_DOMAIN_IDS option. For example:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO \n DO_DOMAIN_IDS = (), \n IGNORE_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n \nThe IGNORE_DOMAIN_IDS option can only be specified if the\nslave is replicating in GTID mode. Therefore, the\nMASTER_USE_GTID option must also be set to some value other\nthan no in order to use this option.\n \nDelayed Replication Options\n \nMASTER_DELAY\n \nThe MASTER_DELAY option for CHANGE MASTER was first added in\nMariaDB 10.2.3 to enable delayed replication.\n \nThe MASTER_DELAY option for CHANGE MASTER can be used to\nenable delayed replication. This option specifies the time\nin seconds (at least) that a replication slave should lag\nbehind the master. Before executing an event, the slave will\nfirst wait, if necessary, until the given time has passed\nsince the event was created on the master. The result is\nthat the slave will reflect the state of the master some\ntime back in the past. The default is zero, no delay.\n \nSTOP SLAVE;\n \nCHANGE MASTER TO \n MASTER_DELAY=3600;\n \nSTART SLAVE;\n \nChanging Option Values\n \nIf you don\'t specify a given option when executing the\nCHANGE MASTER statement, then the option keeps its old value\nin most cases. Most of the time, there is no need to specify\nthe options that do not need to change. For example, if the\npassword for the user account that the slave uses to connect\nto its master has changed, but no other options need to\nchange, then you can just change the MASTER_PASSWORD option\nby executing the following commands:\n \nSTOP SLAVE;\n \nCHANGE MASTER TO \n MASTER_PASSWORD=\'new3cret\';\n \nSTART SLAVE;\n \nThere are some cases where options are implicitly reset,\nsuch as when the MASTER_HOST and MASTER_PORT options are\nchanged.\n \nOption Persistence\n \nThe values of the MASTER_LOG_FILE and MASTER_LOG_POS options\n(i.e. the binary log position on the master) and most other\noptions are written to either the default master.info file\nor the file that is configured by the master_info_file\noption. The slave\'s I/O thread keeps this binary log\nposition updated as it downloads events only when\nMASTER_USE_GTID option\n is set to NO. Otherwise the file is not updated on a per\nevent basis.\n \nThe master_info_file option can be set either on the\ncommand-line or in a server option group in an option file\nprior to starting up the server. For example:\n \n[mariadb]\n...\nmaster_info_file=/mariadb/myserver1-master.info\n \nThe values of the RELAY_LOG_FILE and RELAY_LOG_POS options\n(i.e. the relay log position) are written to either the\ndefault relay-log.info file or the file that is configured\nby the relay_log_info_file system variable. The slave\'s SQL\nthread keeps this relay log position updated as it applies\nevents.\n \nThe relay_log_info_file system variable can be set either on\nthe command-line or in a server option group in an option\nfile prior to starting up the server. For example:\n \n[mariadb]\n...\nrelay_log_info_file=/mariadb/myserver1-relay-log.info\n \nGTID Persistence\n \nIf the slave is replicating binary log events that contain\nGTIDs, then the slave\'s SQL thread will write every GTID\nthat it applies to the mysql.gtid_slave_pos table. This GTID\ncan be inspected and modified through the gtid_slave_pos\nsystem variable.\n \nIf the slave has the log_slave_updates system variable\nenabled and if the slave has the binary log enabled, then\nevery write by the slave\'s SQL thread will also go into the\nslave\'s binary log. This means that GTIDs of replicated\ntransactions would be reflected in the value of the\ngtid_binlog_pos system variable.\n \nCreating a Slave from a Backup\n \nThe CHANGE MASTER statement is useful for setting up a slave\nwhen you have a backup of the master and you also have the\nbinary log position or GTID position corresponding to the\nbackup.\n \nAfter restoring the backup on the slave, you could execute\nsomething like this to use the binary log position:\n \nCHANGE MASTER TO\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4;\n \nSTART SLAVE;\n \nOr you could execute something like this to use the GTID\nposition:\n \nSET GLOBAL gtid_slave_pos=\'0-1-153\';\n \nCHANGE MASTER TO\n MASTER_USE_GTID=slave_pos;\n \nSTART SLAVE;\n \nSee Setting up a Replication Slave with Mariabackup for more\ninformation on how to do this with Mariabackup.\n \nExample\n \nThe following example changes the master and master\'s\nbinary log coordinates.\nThis is used when you want to set up the slave to replicate\nthe master:\n \nCHANGE MASTER TO\n MASTER_HOST=\'master2.mycompany.com\',\n MASTER_USER=\'replication\',\n MASTER_PASSWORD=\'bigs3cret\',\n MASTER_PORT=3306,\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4,\n MASTER_CONNECT_RETRY=10;\n \nSTART SLAVE;\n \n\n\nURL: https://mariadb.com/kb/en/library/change-master-to/') WHERE help_topic_id = 95;
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (96,8,'COMMIT','The COMMIT statement ends a transaction, saving any changes\nto the data so that they become visible to subsequent\ntransactions. Also, unlocks metadata changed by current\ntransaction. If autocommit is set to 1, an implicit commit\nis performed after each statement. Otherwise, all\ntransactions which don\'t end with an explicit COMMIT are\nimplicitly rollbacked and the changes are lost. The ROLLBACK\nstatement can be used to do this explicitly.\n \nThe required syntax for the COMMIT statement is as follows:\n \nCOMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\n \nCOMMIT is the more important transaction terminator, as well\nas the more interesting one. The basic form of the COMMIT\nstatement is simply the keyword COMMIT (the keyword WORK is\nsimply noise and can be omitted without changing the\neffect).\n \nThe optional AND CHAIN clause is a convenience for\ninitiating a new transaction as soon as the old transaction\nterminates. If AND CHAIN is specified, then there is\neffectively nothing between the old and new transactions,\nalthough they remain separate. The characteristics of the\nnew transaction will be the same as the characteristics of\nthe old one — that is, the new transaction will have the\nsame access mode, isolation level and diagnostics area size\n(we\'ll discuss all of these shortly) as the transaction\njust terminated. \n \nRELEASE tells the server to disconnect the client\nimmediately after the current transaction.\n \nThere are NO RELEASE and AND NO CHAIN options. By default,\ncommits do not RELEASE or CHAIN, but it\'s possible to\nchange this default behavior with the completion_type server\nsystem variable. In this case, the AND NO CHAIN and NO\nRELEASE options override the server default.\n \n\n\nURL: https://mariadb.com/kb/en/library/commit/','','https://mariadb.com/kb/en/library/commit/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (97,8,'DEALLOCATE / DROP PREPARE','Syntax\n------ \n{DEALLOCATE | DROP} PREPARE stmt_name\n \nDescription\n----------- \nTo deallocate a prepared statement produced with PREPARE,\nuse a\nDEALLOCATE PREPARE statement that refers to the prepared\nstatement\nname.\n \nA prepared statement is implicitly deallocated when a new\nPREPARE command is issued. In that case, there is no need to\nuse DEALLOCATE.\n \nAttempting to execute a prepared statement after\ndeallocating it\nresults in an error, as if it was not prepared at all:\n \nERROR 1243 (HY000): Unknown prepared statement handler\n(stmt_name) given to EXECUTE\n \nIf the specified statement has not been PREPAREd, an error\nsimilar to the following will be produced:\n \nERROR 1243 (HY000): Unknown prepared statement handler\n(stmt_name) given to DEALLOCATE PREPARE\n \nExample\n \nSee example in PREPARE.\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/deallocate-drop-prepared-statement/','','https://mariadb.com/kb/en/library/deallocate-drop-prepared-statement/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (98,8,'EXECUTE Statement','Syntax\n------ \nEXECUTE stmt_name\n [USING expression[, expression] ...]\n \nEXECUTE with expression as parameters was introduced in\nMariaDB 10.2.3. Before that one could only use variables\n(@var_name) as parameters.\n \nDescription\n----------- \nAfter preparing a statement with PREPARE, you execute it\nwith an\nEXECUTE statement that refers to the prepared statement\nname. If the\nprepared statement contains any parameter markers, you must\nsupply a\nUSING clause that lists user variables containing the values\nto be\nbound to the parameters. Parameter values can be supplied\nonly by user\nvariables, and the USING clause must name exactly as many\nvariables as\nthe number of parameter markers in the statement.\n \nYou can execute a given prepared statement multiple times,\npassing\ndifferent variables to it or setting the variables to\ndifferent values\nbefore each execution.\n \nIf the specified statement has not been PREPAREd, an error\nsimilar to the following is produced:\n \nERROR 1243 (HY000): Unknown prepared statement handler\n(stmt_name) given to EXECUTE\n \nExample\n \nSee example in PREPARE.\n \n\n\nURL: https://mariadb.com/kb/en/library/execute-statement/','','https://mariadb.com/kb/en/library/execute-statement/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (99,8,'EXECUTE IMMEDIATE','EXECUTE IMMEDIATE was introduced in MariaDB 10.2.3.\n \nSyntax\n------ \nEXECUTE IMMEDIATE statement\n \nDescription\n----------- \nEXECUTE IMMEDIATE executes a dynamic SQL statement created\non the fly, which can reduce performance overhead.\n \nFor example:\n \nEXECUTE IMMEDIATE \'SELECT 1\' \n \nwhich is shorthand for:\n \nprepare stmt from \"select 1\";\n \nexecute stmt;\n \ndeallocate prepare stmt;\n \nEXECUTE IMMEDIATE supports complex expressions as prepare\nsource and parameters:\n \nEXECUTE IMMEDIATE CONCAT(\'SELECT COUNT(*) FROM \', \'t1\',\n\' WHERE a=?\') USING 5+5;\n \nLimitations: subselects and stored function calls are not\nsupported as a prepare source.\n \nThe following examples return an error:\n \nCREATE OR REPLACE FUNCTION f1() RETURNS VARCHAR(64) RETURN\n\'SELECT * FROM t1\';\nEXECUTE IMMEDIATE f1();\nERROR 1970 (42000): EXECUTE IMMEDIATE does not support\nsubqueries or stored functions\n \nEXECUTE IMMEDIATE (SELECT \'SELECT * FROM t1\');\nERROR 1064 (42000): You have an error in your SQL syntax;\ncheck the manual that \n corresponds to your MariaDB server version for the right\nsyntax to use near \n \'SELECT \'SELECT * FROM t1\')\' at line 1\n \nCREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN 10;\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING f1();\nERROR 1970 (42000): EXECUTE..USING does not support\nsubqueries or stored functions\n \nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING\n(SELECT 10);\nERROR 1064 (42000): You have an error in your SQL syntax;\ncheck the manual that \n corresponds to your MariaDB server version for the right\nsyntax to use near \n \'SELECT 10)\' at line 1\n \nOne can use a user or an SP variable as a workaround:\n \nCREATE OR REPLACE FUNCTION f1() RETURNS VARCHAR(64) RETURN\n\'SELECT * FROM t1\';\nSET @stmt=f1();\nEXECUTE IMMEDIATE @stmt;\n \nSET @stmt=(SELECT \'SELECT 1\');\nEXECUTE IMMEDIATE @stmt;\n \nCREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN 10;\nSET @param=f1();\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING\n@param;\n \nSET @param=(SELECT 10);\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING\n@param;\n \nEXECUTE IMMEDIATE supports user variables and SP variables\nas OUT parameters\n \nDELIMITER $$\nCREATE OR REPLACE PROCEDURE p1(OUT a INT)\nBEGIN\n SET a:= 10;\nEND;\n$$\nDELIMITER ;\nSET @a=2;\nEXECUTE IMMEDIATE \'CALL p1(?)\' USING @a;\nSELECT @a;\n+------+\n| @a |\n+------+\n| 10 |\n+------+\n \nSimilar to PREPARE, EXECUTE IMMEDIATE is allowed in stored\nprocedures but is not allowed in stored functions.\n \nThis example uses EXECUTE IMMEDIATE inside a stored\nprocedure:\n \nDELIMITER $$\nCREATE OR REPLACE PROCEDURE p1()\nBEGIN\n EXECUTE IMMEDIATE \'SELECT 1\';\nEND;\n$$\nDELIMITER ;\nCALL p1;\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n \nThis script returns an error:\n \nDELIMITER $$\nCREATE FUNCTION f1() RETURNS INT\nBEGIN\n EXECUTE IMMEDIATE \'DO 1\';\n RETURN 1;\nEND;\n$$\nERROR 1336 (0A000): Dynamic SQL is not allowed in stored\nfunction or trigger\n \nEXECUTE IMMEDIATE can use DEFAULT and IGNORE indicators as\nbind parameters:\n \nCREATE OR REPLACE TABLE t1 (a INT DEFAULT 10);\nEXECUTE IMMEDIATE \'INSERT INTO t1 VALUES (?)\' USING\nDEFAULT;\nSELECT * FROM t1;\n+------+\n| a |\n+------+\n| 10 |\n+------+\n \nEXECUTE IMMEDIATE increments the Com_execute_immediate\nstatus variable, as well as the Com_stmt_prepare,\nCom_stmt_execute and Com_stmt_close status variables.\n \nNote, EXECUTE IMMEDIATE does not increment the\nCom_execute_sql status variable. Com_execute_sql is used\nonly for PREPARE..EXECUTE.\n \nThis session screenshot demonstrates how EXECUTE IMMEDIATE\naffects status variables:\n \nSELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE\nVARIABLE_NAME RLIKE \n (\'COM_(EXECUTE|STMT_PREPARE|STMT_EXECUTE|STMT_CLOSE)\');\n \n+-----------------------+----------------+\n| VARIABLE_NAME | VARIABLE_VALUE |\n+-----------------------+----------------+\n| COM_EXECUTE_IMMEDIATE | 0 |\n| COM_EXECUTE_SQL | 0 |\n| COM_STMT_CLOSE | 0 |\n| COM_STMT_EXECUTE | 0 |\n| COM_STMT_PREPARE | 0 |\n+-----------------------+----------------+\n \nEXECUTE IMMEDIATE \'SELECT 1\';\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n \nSELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE\nVARIABLE_NAME RLIKE \n (\'COM_(EXECUTE|STMT_PREPARE|STMT_EXECUTE|STMT_CLOSE)\');\n+-----------------------+----------------+\n| VARIABLE_NAME | VARIABLE_VALUE |\n+-----------------------+----------------+\n| COM_EXECUTE_IMMEDIATE | 1 |\n| COM_EXECUTE_SQL | 0 |\n| COM_STMT_CLOSE | 1 |\n| COM_STMT_EXECUTE | 1 |\n| COM_STMT_PREPARE | 1 |\n+-----------------------+----------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/execute-immediate/','','https://mariadb.com/kb/en/library/execute-immediate/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (100,8,'LOCK TABLES','Syntax\n------ \nLOCK TABLE[S]\n tbl_name [[AS] alias] lock_type\n [, tbl_name [[AS] alias] lock_type] ...\n [WAIT n|NOWAIT]\n \nlock_type:\n READ [LOCAL]\n | [LOW_PRIORITY] WRITE\n | WRITE CONCURRENT\n \nUNLOCK TABLES\n \nDescription\n----------- \nThe lock_type can be one of:\n \nOption | Description | \n \nREAD | Read lock, no writes allowed | \n \nREAD LOCAL | Read lock, but allow concurrent inserts | \n \nWRITE | Exclusive write lock. No other connections can read\nor write to this table | \n \nLOW_PRIORITY WRITE | Exclusive write lock, but allow new\nread locks on the table until we get the write lock. | \n \nWRITE CONCURRENT | Exclusive write lock, but allow READ\nLOCAL locks to the table. | \n \nMariaDB enables client sessions to acquire table locks\nexplicitly for the\npurpose of cooperating with other sessions for access to\ntables, or to\nprevent other sessions from modifying tables during periods\nwhen a\nsession requires exclusive access to them. A session can\nacquire or\nrelease locks only for itself. One session cannot acquire\nlocks for\nanother session or release locks held by another session.\n \nLocks may be used to emulate transactions or to get more\nspeed when\nupdating tables.\n \nLOCK TABLES explicitly acquires table locks for the current\nclient session.\nTable locks can be acquired for base tables or views. To use\nLOCK TABLES,\nyou must have the LOCK TABLES privilege, and the SELECT\nprivilege for\neach object to be locked. See GRANT\n \nFor view locking, LOCK TABLES adds all base tables used in\nthe view to the\nset of tables to be locked and locks them automatically. If\nyou lock a table\nexplicitly with LOCK TABLES, any tables used in triggers are\nalso locked\nimplicitly, as described in Triggers and Implicit Locks.\n \nUNLOCK TABLES explicitly releases any table locks held by\nthe\ncurrent session.\n \nWAIT/NOWAIT\n \nSet the lock wait timeout. See WAIT and NOWAIT.\n \nLimitations\n \nLOCK TABLES doesn\'t work when using Galera cluster. You may\nexperience crashes or locks when used with Galera.\n \nLOCK TABLES works on XtraDB/InnoDB tables only if the\ninnodb_table_locks system variable is set to 1 (the default)\nand autocommit is set to 0 (1 is default). Please note that\nno error message will be returned on LOCK TABLES with\ninnodb_table_locks = 0.\n \nLOCK TABLES implicitly commits the active transaction, if\nany. Also, starting a transaction always releases all table\nlocks acquired with LOCK TABLES. This means that there is no\nway to have table locks and an active transaction at the\nsame time. The only exceptions are the transactions in\nautocommit mode. To preserve the data integrity between\ntransactional and non-transactional tables, the GET_LOCK()\nfunction can be used.\n \nWhile a connection holds an explicit read lock on a table,\nit cannot modify it. If you try, the following error will be\nproduced:\n \nERROR 1099 (HY000): Table \'tab_name\' was locked with a\nREAD lock and can\'t be updated\n \nWhile a connection holds an explicit lock on a table, it\ncannot access a non-locked table. If you try, the following\nerror will be produced:\n \nERROR 1100 (HY000): Table \'tab_name\' was not locked with\nLOCK TABLES\n \nWhile a connection holds an explicit lock on a table, it\ncannot issue the following: INSERT DELAYED, CREATE TABLE,\nCREATE TABLE ... LIKE, and DDL statements involving stored\nprograms and views (except for triggers). If you try, the\nfollowing error will be produced:\n \nERROR 1192 (HY000): Can\'t execute the given command because\nyou have active locked tables or an active transaction\n \nLOCK TABLES can not be used in stored routines - if you try,\nthe following error will be produced on creation:\n \nERROR 1314 (0A000): LOCK is not allowed in stored procedures\n \n\n\nURL: https://mariadb.com/kb/en/library/lock-tables/','','https://mariadb.com/kb/en/library/lock-tables/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (101,8,'ROLLBACK','The ROLLBACK statement rolls back (ends) a transaction,\ndestroying any changes to SQL-data so that they never become\nvisible to subsequent transactions. The required syntax for\nthe ROLLBACK statement is as follows. \n \nROLLBACK [ WORK ] [ AND [ NO ] CHAIN ] \n[ TO [ SAVEPOINT ] { | } ]\n \nThe ROLLBACK statement will either end a transaction,\ndestroying all data changes that happened during any of the\ntransaction, or it will just destroy any data changes that\nhappened since you established a savepoint. The basic form\nof the ROLLBACK statement is just the keyword ROLLBACK (the\nkeyword WORK is simply noise and can be omitted without\nchanging the effect). \n \nThe optional AND CHAIN clause is a convenience for\ninitiating a new transaction as soon as the old transaction\nterminates. If AND CHAIN is specified, then there is\neffectively nothing between the old and new transactions,\nalthough they remain separate. The characteristics of the\nnew transaction will be the same as the characteristics of\nthe old one — that is, the new transaction will have the\nsame access mode, isolation level and diagnostics area size\n(we\'ll discuss all of these shortly) as the transaction\njust terminated. The AND NO CHAIN option just tells your\nDBMS to end the transaction — that is, these four SQL\nstatements are equivalent: \n \nROLLBACK;\n \nROLLBACK WORK;\n \nROLLBACK AND NO CHAIN;\n \nROLLBACK WORK AND NO CHAIN;\n \nAll of them end a transaction without saving any transaction\ncharacteristics. The only other options, the equivalent\nstatements: \n \nROLLBACK AND CHAIN;\n \nROLLBACK WORK AND CHAIN;\n \nboth tell your DBMS to end a transaction, but to save that\ntransaction\'s characteristics for the next transaction. \n \nROLLBACK is much simpler than COMMIT: it may involve no more\nthan a few deletions (of Cursors, locks, prepared SQL\nstatements and log-file entries). It\'s usually assumed that\nROLLBACK can\'t fail, although such a thing is conceivable\n(for example, an encompassing transaction might reject an\nattempt to ROLLBACK because it\'s lining up for a COMMIT). \n \nROLLBACK cancels all effects of a transaction. It does not\ncancel effects on objects outside the DBMS\'s control (for\nexample the values in host program variables or the settings\nmade by some SQL/CLI function calls). But in general, it is\na convenient statement for those situations when you say\n\"oops, this isn\'t working\" or when you simply don\'t care\nwhether your temporary work becomes permanent or not.\n \nHere is a moot question. If all you\'ve been doing is\nSELECTs, so that there have been no data changes, should you\nend the transaction with ROLLBACK or COMMIT? It shouldn\'t\nreally matter because both ROLLBACK and COMMIT do the same\ntransaction-terminating job. However, the popular conception\nis that ROLLBACK implies failure, so after a successful\nseries of SELECT statements the convention is to end the\ntransaction with COMMIT rather than ROLLBACK.\n \nMariaDB (and most other DBMSs) supports rollback of SQL-data\nchange statements, but not of SQL-Schema statements. This\nmeans that if you use any of CREATE, ALTER, DROP, GRANT,\nREVOKE, you are implicitly committing at execution time.\n \nINSERT INTO Table_2 VALUES(5); \nDROP TABLE Table_3 CASCADE;\n \nROLLBACK;\n \nThe result will be that both the INSERT and the DROP will go\nthrough as separate transactions so the ROLLBACK will have\nno effect. \n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/rollback/','','https://mariadb.com/kb/en/library/rollback/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (102,8,'SAVEPOINT','Syntax\n------ \nSAVEPOINT identifier\nROLLBACK [WORK] TO [SAVEPOINT] identifier\nRELEASE SAVEPOINT identifier\n \nDescription\n----------- \nInnoDB supports the SQL statements SAVEPOINT,\nROLLBACK TO SAVEPOINT, RELEASE SAVEPOINT\nand the optional WORK keyword for\nROLLBACK.\n \nEach savepoint must have a legal MariaDB identifier. A\nsavepoint is a named sub-transaction.\n \nNormally ROLLBACK undoes the changes performed by the whole\ntransaction. When used with the TO clause, it undoes the\nchanges performed after the specified savepoint, and erases\nall subsequent savepoints. However, all locks that have been\nacquired after the save point will survive. RELEASE\nSAVEPOINT does not rollback or commit any changes, but\nremoves the specified savepoint.\n \nWhen the execution of a trigger or a stored function begins,\nit is not possible to use statements which reference a\nsavepoint which was defined from out of that stored program.\n \nWhen a COMMIT (including implicit commits) or a ROLLBACK\nstatement (with no TO clause) is performed, they act on the\nwhole transaction, and all savepoints are removed.\n \nErrors\n \nIf COMMIT or ROLLBACK is issued and no transaction was\nstarted, no error is reported.\n \nIf SAVEPOINT is issued and no transaction was started, no\nerror is reported but no savepoint is created. When ROLLBACK\nTO SAVEPOINT or RELEASE SAVEPOINT is called for a savepoint\nthat does not exist, an error like this is issued:\n \nERROR 1305 (42000): SAVEPOINT svp_name does not exist\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/savepoint/','','https://mariadb.com/kb/en/library/savepoint/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (103,8,'Metadata Locking','Metadata locking has been supported since MariaDB 5.5. This\nmeans that when a transaction (including XA transactions)\nuses a table, it locks its metadata until the end of\ntransaction. Non-transactional tables are also locked, as\nwell as views and objects which are related to locked\ntables/views (stored functions, triggers, etc). When a\nconnection tries to use a DDL statement (like an ALTER\nTABLE) which modifies a table that is locked, that\nconnection is queued, and has to wait until it\'s unlocked.\nUsing savepoints and performing a partial rollback does not\nrelease metadata locks.\n \nLOCK TABLES ... WRITE are also queued. Some wrong statements\nwhich produce an error may not need to wait for the lock to\nbe freed.\n \nMetadata lock\'s timeout is determined by the value of the\nlock_wait_timeout server system variable (in seconds).\nHowever, note that its default value is 31536000 (1 year).\nIf this timeout exceeds, the following error is returned:\n \nERROR 1205 (HY000): Lock wait timeout exceeded;\n try restarting transaction\n \nIf the metadata_lock_info plugin is installed, the\nInformation Schema metadata_lock_info table stores\ninformation about existing metadata locks.\n \nExample\n \nLet\'s use the following MEMORY (non-transactional) table:\n \nCREATE TABLE t (a INT) ENGINE = MEMORY;\n \nConnection 1 starts a transaction, and INSERTs a row into t:\n \nSTART TRANSACTION;\n \nINSERT INTO t SET a=1;\n \nt\'s metadata is now locked by connection 1. Connection 2\ntries to alter t, but has to wait:\n \nALTER TABLE t ADD COLUMN b INT;\n \nConnection 2\'s prompt is blocked now.\n \nNow connection 1 ends the transaction:\n \nCOMMIT;\n \n...and connection 2 finally gets the output of its command:\n \nQuery OK, 1 row affected (35.23 sec)\nRecords: 1 Duplicates: 0 Warnings: 0\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/metadata-locking/','','https://mariadb.com/kb/en/library/metadata-locking/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (104,8,'PREPARE Statement','Syntax\n------ \nPREPARE stmt_name FROM preparable_stmt\n \nDescription\n----------- \nThe PREPARE statement prepares a statement and assigns it a\nname,\nstmt_name, by which to refer to the statement later.\nStatement names\nare not case sensitive. preparable_stmt is either a string\nliteral or a user variable (not a local variable, an SQL\nexpression or a subquery) that contains the text of the\nstatement. The text must \nrepresent a single SQL statement, not multiple statements.\nWithin the\nstatement, \"?\" characters can be used as parameter markers\nto indicate\nwhere data values are to be bound to the query later when\nyou execute\nit. The \"?\" characters should not be enclosed within\nquotes, even if\nyou intend to bind them to string values. Parameter markers\ncan be used\nonly where data values should appear, not for SQL keywords,\nidentifiers, and so forth.\n \nThe scope of a prepared statement is the session within\nwhich it is\ncreated. Other sessions cannot see it.\n \nIf a prepared statement with the given name already exists,\nit is\ndeallocated implicitly before the new statement is prepared.\nThis means\nthat if the new statement contains an error and cannot be\nprepared, an\nerror is returned and no statement with the given name\nexists.\n \nPrepared statements can be PREPAREd and EXECUTEd in a stored\nprocedure, but not in a stored function or trigger. Also,\neven if the statement is PREPAREd in a procedure, it will\nnot be deallocated when the procedure execution ends.\n \nA prepared statement can access user-defined variables, but\nnot local variables or procedure\'s parameters.\n \nIf the prepared statement contains a syntax error, PREPARE\nwill fail. As a side effect, stored procedures can use it to\ncheck if a statement is valid. For example:\n \nCREATE PROCEDURE `test_stmt`(IN sql_text TEXT)\nBEGIN\n DECLARE EXIT HANDLER FOR SQLEXCEPTION\n BEGIN\n SELECT CONCAT(sql_text, \' is not valid\');\n END;\n SET @SQL := sql_text;\n PREPARE stmt FROM @SQL;\n DEALLOCATE PREPARE stmt;\nEND;\n \nThe FOUND_ROWS() and ROW_COUNT() functions, if called\nimmediatly after EXECUTE, return the number of rows read or\naffected by the prepared statements; however, if they are\ncalled after DEALLOCATE PREPARE, they provide information\nabout this statement. If the prepared statement produces\nerrors or warnings, GET DIAGNOSTICS return information about\nthem. DEALLOCATE PREPARE shouldn\'t clear the diagnostics\narea, unless it produces an error.\n \nA prepared statement is executed with EXECUTE and released \nwith DEALLOCATE PREPARE.\n \nThe max_prepared_stmt_count server system variable\ndetermines the number of allowed prepared statements that\ncan be prepared on the server. If it is set to 0, prepared\nstatements are not allowed. If the limit is reached, an\nerror similar to the following will be produced:\n \nERROR 1461 (42000): Can\'t create more than\nmax_prepared_stmt_count statements \n (current value: 0)\n \nOracle Mode\n \nIn Oracle mode from MariaDB 10.3, PREPARE stmt FROM \'SELECT\n:1, :2\' is used, instead of ?.\n \nPermitted Statements\n \nNot all statements can be prepared. Only the following SQL\ncommands are permitted:\nALTER TABLE\nANALYZE TABLE\nBINLOG\nCACHE INDEX\nCALL\nCHANGE MASTER\nCHECKSUM {TABLE | TABLES}\nCOMMIT\n{CREATE | DROP} DATABASE\n{CREATE | DROP} INDEX\n{CREATE | RENAME | DROP} TABLE\n{CREATE | RENAME | DROP} USER\n{CREATE | DROP} VIEW\nDELETE\nDESCRIBE\nDO\nEXPLAIN\nFLUSH {TABLE | TABLES | TABLES WITH READ LOCK | HOSTS |\nPRIVILEGES | LOGS | STATUS | \n MASTER | SLAVE | DES_KEY_FILE | USER_RESOURCES | QUERY\nCACHE | TABLE_STATISTICS | \n INDEX_STATISTICS | USER_STATISTICS | CLIENT_STATISTICS}\nGRANT\nINSERT\nINSTALL {PLUGIN | SONAME}\nHANDLER READ\nKILL\nLOAD INDEX INTO CACHE\nOPTIMIZE TABLE\nREPAIR TABLE\nREPLACE\nRESET {MASTER | SLAVE | QUERY CACHE}\nREVOKE\nROLLBACK\nSELECT\nSET\nSET GLOBAL SQL_SLAVE_SKIP_COUNTER\nSET ROLE\nSET SQL_LOG_BIN\nSET TRANSACTION ISOLATION LEVEL\nSHOW EXPLAIN\nSHOW {DATABASES | TABLES | OPEN TABLES | TABLE STATUS |\nCOLUMNS | INDEX | TRIGGERS | \n EVENTS | GRANTS | CHARACTER SET | COLLATION | ENGINES |\nPLUGINS [SONAME] | PRIVILEGES | \n PROCESSLIST | PROFILE | PROFILES | VARIABLES | STATUS |\nWARNINGS | ERRORS | \n TABLE_STATISTICS | INDEX_STATISTICS | USER_STATISTICS |\nCLIENT_STATISTICS | AUTHORS | \n CONTRIBUTORS}\nSHOW CREATE {DATABASE | TABLE | VIEW | PROCEDURE | FUNCTION\n| TRIGGER | EVENT}\nSHOW {FUNCTION | PROCEDURE} CODE\nSHOW BINLOG EVENTS\nSHOW SLAVE HOSTS\nSHOW {MASTER | BINARY} LOGS\nSHOW {MASTER | SLAVE | TABLES | INNODB | FUNCTION |\nPROCEDURE} STATUS\nSLAVE {START | STOP}\nTRUNCATE TABLE\nSHUTDOWN\nUNINSTALL {PLUGIN | SONAME}\nUPDATE\n \nSynonyms are not listed here, but can be used. For example,\nDESC can be used instead of DESCRIBE.\n \nCompound statements can be prepared too.\n \nNote that if a statement can be run in a stored routine, it\nwill work even if it is called by a prepared statement. For\nexample, SIGNAL can\'t be directly prepared. However, it is\nallowed in stored routines. If the x() procedure contains\nSIGNAL, you can still prepare and execute the \'CALL x();\'\nprepared statement.\n \nPREPARE now supports most kinds of expressions as well, for\nexample:\n \nPREPARE stmt FROM CONCAT(\'SELECT * FROM \', table_name);\n \nWhen PREPARE is used with a statement which is not\nsupported, the following error is produced:\n \nERROR 1295 (HY000): This command is not supported in the\nprepared statement protocol yet\n \nExample\n \ncreate table t1 (a int,b char(10));\ninsert into t1 values (1,\"one\"),(2,\n\"two\"),(3,\"three\");\nprepare test from \"select * from t1 where a=?\";\nset @param=2;\nexecute test using @param;\n+------+------+\n| a | b |\n+------+------+\n| 2 | two |\n+------+------+\nset @param=3;\nexecute test using @param;\n+------+-------+\n| a | b |\n+------+-------+\n| 3 | three |\n+------+-------+\ndeallocate prepare test;\n \nSince identifiers are not permitted as prepared statements\nparameters, sometimes it is necessary to dynamically compose\nan SQL statement. This technique is called dynamic SQL). The\nfollowing example shows how to use dynamic SQL:\n \nCREATE PROCEDURE test.stmt_test(IN tab_name VARCHAR(64))\nBEGIN\n SET @sql = CONCAT(\'SELECT COUNT(*) FROM \', tab_name);\n PREPARE stmt FROM @sql;\n EXECUTE stmt;\n DEALLOCATE PREPARE stmt;\nEND;\n \nCALL test.stmt_test(\'mysql.user\');\n+----------+\n| COUNT(*) |\n+----------+\n| 4 |\n+----------+\n \nUse of variables in prepared statements:\n \nPREPARE stmt FROM \'SELECT @x;\';\n \nSET @x = 1;\n \nEXECUTE stmt;\n+------+\n| @x |\n+------+\n| 1 |\n+------+\n \nSET @x = 0;\n \nEXECUTE stmt;\n+------+\n| @x |\n+------+\n| 0 |\n+------+\n \nDEALLOCATE PREPARE stmt;\n \n\n\nURL: https://mariadb.com/kb/en/library/prepare-statement/','','https://mariadb.com/kb/en/library/prepare-statement/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (105,8,'PURGE BINARY LOGS','Syntax\n------ \nPURGE { BINARY | MASTER } LOGS\n { TO \'log_name\' | BEFORE datetime_expr }\n \nDescription\n----------- \nThe PURGE BINARY LOGS statement deletes all the binary log\nfiles listed in the log index file prior to the specified\nlog file name or\ndate. BINARY and MASTER are synonyms.\nDeleted log files also are removed from the list recorded in\nthe index file, so\nthat the given log file becomes the first in the list.\n \nThe datetime expression is in the format \'YYYY-MM-DD\nhh:mm:ss\'. \n \nIf a slave is active but has yet to read from a binary log\nfile you attempt to delete, the statement will fail with an\nerror. However, if the slave is not connected and has yet to\nread from a log file you delete, the file will be deleted,\nbut the slave will be unable to continue replicating once it\nconnects again.\n \nThis statement has no effect if the server was not started\nwith the\n--log-bin option to enable binary logging.\n \nTo list the binary log files on the server, use SHOW BINARY\nLOGS. To see which files they are reading, use SHOW SLAVE\nSTATUS. You can only delete the files that are older than\nthe oldest file that is used by the slaves.\n \nTo delete all binary log files, use RESET MASTER.\nTo move to a new log file (for example if you want to remove\nthe current log file), use FLUSH LOGS before you execute\nPURGE LOGS.\n \nIf the expire_logs_days server system variable is not set to\n0, the server automatically deletes binary log files after\nthe given number of days.\n \nExamples\n-------- \nPURGE BINARY LOGS TO \'mariadb-bin.000063\';\n \nPURGE BINARY LOGS BEFORE \'2013-04-21\';\n \nPURGE BINARY LOGS BEFORE \'2013-04-22 09:55:22\';\n \n\n\nURL: https://mariadb.com/kb/en/library/purge-binary-logs/','','https://mariadb.com/kb/en/library/purge-binary-logs/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (106,8,'RESET MASTER','RESET MASTER [TO #]\n \nDeletes all binary log files listed in the index file,\nresets the\nbinary log index file to be empty, and creates a new binary\nlog file with a suffix of .000001.\n \nIf TO # is given, then the first new binary log file will\nstart from number #.\n \nThis statement is for use only when the master is started\nfor the first time, and should never be used if any slaves\nare actively replicating from the binary log.\n \n\n\nURL: https://mariadb.com/kb/en/library/reset-master/','','https://mariadb.com/kb/en/library/reset-master/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (107,8,'RESET SLAVE','RESET SLAVE [\"connection_name\"] [ALL] \n \nRESET SLAVE makes the slave forget its replication position\nin the\nmaster\'s binary log. This statement is meant to be used for\na clean\nstart. It deletes the master.info and relay-log.info files,\nall the\nrelay log files, and starts a new relay log file. To use\nRESET SLAVE,\nthe slave replication threads must be stopped (use STOP\nSLAVE if\nnecessary).\n \nNote: All relay log files are deleted, even if they have not\nbeen\ncompletely executed by the slave SQL thread. (This is a\ncondition\nlikely to exist on a replication slave if you have issued a\nSTOP SLAVE\nstatement or if the slave is highly loaded.)\n \nConnection information stored in the master.info file is\nimmediately\nreset using any values specified in the corresponding\nstartup options.\nThis information includes values such as master host, master\nport,\nmaster user, and master password. If the slave SQL thread\nwas in the\nmiddle of replicating temporary tables when it was stopped,\nand RESET\nSLAVE is issued, these replicated temporary tables are\ndeleted on the\nslave.\n \nThe ALL also resets the PORT, HOST, USER and PASSWORD\nparameters for the slave. If you are using a connection\nname, it will permanently delete it and it will not show up\nanymore in SHOW ALL SLAVES STATUS.\n \nconnection_name\n \nThe connection_name option was added as part of multi-source\nreplication added in MariaDB 10.0\n \nIf there is only one nameless master, or the default master\n(as specified by the default_master_connection system\nvariable) is intended, connection_name can be omitted. If\nprovided, the RESET SLAVE statement will apply to the\nspecified master. connection_name is case-insensitive.\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/reset-slave-connection_name/','','https://mariadb.com/kb/en/library/reset-slave-connection_name/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (108,8,'SET TRANSACTION','Syntax\n------ \nSET [GLOBAL | SESSION] TRANSACTION\n transaction_property [, transaction_property] ...\n \ntransaction_property:\n ISOLATION LEVEL level\n | READ WRITE\n | READ ONLY\n \nlevel:\n REPEATABLE READ\n | READ COMMITTED\n | READ UNCOMMITTED\n | SERIALIZABLE\n \nDescription\n----------- \nThis statement sets the transaction isolation level or the\ntransaction access mode globally, for the current session,\nor for the next transaction:\nWith the GLOBAL keyword, the statement sets the default\n transaction level globally for all subsequent sessions.\nExisting sessions are\n unaffected.\nWith the SESSION keyword, the statement sets the default\n transaction level for all subsequent transactions performed\nwithin the\n current session.\nWithout any SESSION or GLOBAL keyword,\n the statement sets the isolation level for the next (not\nstarted) transaction\n performed within the current session.\n \nA change to the global default isolation level requires the \nSUPER privilege. Any session is free to change its\nsession isolation level (even in the middle of a\ntransaction), or the isolation\nlevel for its next transaction.\n \nIsolation Level\n \nTo set the global default isolation level at server startup,\nuse the\n--transaction-isolation=level option on the command line or\nin an option file. Values of level for this option use\ndashes\nrather than spaces, so the allowable values are\nREAD-UNCOMMITTED,\nREAD-COMMITTED, REPEATABLE-READ, or\nSERIALIZABLE. For example, to set the default isolation\nlevel to REPEATABLE READ, use these lines in the [mysqld]\nsection of an option file:\n \n[mysqld]\ntransaction-isolation = REPEATABLE-READ\nTo determine the global and session transaction isolation\nlevels at\nruntime, check the value of the tx_isolation system\nvariable:\n \nSELECT @@GLOBAL.tx_isolation, @@tx_isolation;\n \nInnoDB supports each of the translation isolation levels\ndescribed here\nusing different locking strategies. The default level is \nREPEATABLE READ. For additional information about InnoDB\nrecord-level locks and how it uses them to execute various\ntypes of statements,\nsee XtraDB/InnoDB Lock Modes,\nand\nhttp://dev.mysql.com/doc/refman/en/innodb-locks-set.html.\n \nIsolation Levels\n \nThe following sections describe how MariaDB supports the\ndifferent transaction levels.\n \nREAD UNCOMMITTED\n \nSELECT statements are performed in a non-locking fashion,\nbut a possible earlier version of a row might be used. Thus,\nusing this\nisolation level, such reads are not consistent. This is also\ncalled a \"dirty\nread.\" Otherwise, this isolation level works like \nREAD COMMITTED.\n \nREAD COMMITTED\n \nA somewhat Oracle-like isolation level with respect to\nconsistent\n(non-locking) reads: Each consistent read, even within the\nsame\ntransaction, sets and reads its own fresh snapshot. See\nhttp://dev.mysql.com/doc/refman/en/innodb-consistent-read.html.\n \nFor locking reads (SELECT with FOR UPDATE\nor LOCK IN SHARE MODE), InnoDB locks only index records, not\nthe gaps before them, and thus allows the free insertion of\nnew records next to\nlocked records. For UPDATE and DELETE\nstatements, locking depends on whether the statement uses a\nunique index with a\nunique search condition (such as WHERE id = 100), or a\nrange-type search condition (such as WHERE id > 100). For a\nunique index with a unique search condition, InnoDB locks\nonly the index record\nfound, not the gap before it. For range-type searches,\nInnoDB locks the index\nrange scanned, using gap locks or next-key (gap plus\nindex-record) locks to\nblock insertions by other sessions into the gaps covered by\nthe range. This is\nnecessary because \"phantom rows\" must be blocked for MySQL\nreplication and\nrecovery to work.\n \nNote: Since MariaDB 5.1, if the READ COMMITTED isolation\nlevel is used or the innodb_locks_unsafe_for_binlog system\nvariable is enabled,\nthere is no InnoDB gap locking except for foreign-key\nconstraint checking and\nduplicate-key checking. Also, record locks for non-matching\nrows are released\nafter MariaDB has evaluated the WHERE condition. As of\nMariaDB/MySQL\n5.1, if you use READ COMMITTED or enable\ninnodb_locks_unsafe_for_binlog, you must use row-based\nbinary logging.\n \nREPEATABLE READ\n \nThis is the default isolation level for InnoDB. For\nconsistent reads,\nthere is an important difference from the READ COMMITTED\nisolation level: All consistent reads within the same\ntransaction read the\nsnapshot established by the first read. This convention\nmeans that if you issue\nseveral plain (non-locking) SELECT statements within the\nsame transaction, these SELECT statements are consistent\nalso with respect to each other. See\nhttp://dev.mysql.com/doc/refman/en/innodb-consistent-read.html.\n \nFor locking reads (SELECT with FOR UPDATE or LOCK IN SHARE\nMODE),\nUPDATE, and DELETE statements, locking depends on whether\nthe\nstatement uses a unique index with a unique search\ncondition, or a\nrange-type search condition. For a unique index with a\nunique search\ncondition, InnoDB locks only the index record found, not the\ngap\nbefore it. For other search conditions, InnoDB locks the\nindex range\nscanned, using gap locks or next-key (gap plus index-record)\nlocks to\nblock insertions by other sessions into the gaps covered by\nthe range.\n \nThis is the minimum isolation level for non-distributed XA\ntransactions.\n \nSERIALIZABLE\n \nThis level is like REPEATABLE READ, but InnoDB implicitly\nconverts all\nplain SELECT statements to SELECT ... LOCK IN SHARE MODE if\nautocommit\nis disabled. If autocommit is enabled, the SELECT is its own\ntransaction. It therefore is known to be read only and can\nbe\nserialized if performed as a consistent (non-locking) read\nand need\nnot block for other transactions. (This means that to force\na plain\nSELECT to block if other transactions have modified the\nselected rows,\nyou should disable autocommit.)\n \nDistributed XA transactions should always use this isolation\nlevel.\n \nAccess Mode\n \nThese clauses appeared in MariaDB 10.0.\n \nThe access mode specifies whether the transaction is allowed\nto write data or not. By default, transactions are in READ\nWRITE mode (see the tx_read_only system variable). READ ONLY\nmode allows the storage engine to apply optimizations that\ncannot be used for transactions which write data. The only\nexception to this rule is that read only transactions can\nperform DDL statements on temporary tables.\n \nIt is not permitted to specify both READ WRITE and READ ONLY\nin the same statement.\n \nREAD WRITE and READ ONLY can also be specified in the START\nTRANSACTION statement, in which case the specified mode is\nonly valid for one transaction.\n \nExamples\n-------- \nSET GLOBAL TRANSACTION ISOLATION LEVEL SERIALIZABLE;\n \nAttempting to set the isolation level within an existing\ntransaction without specifying GLOBAL or SESSION.\n \nSTART TRANSACTION;\n \nSET TRANSACTION ISOLATION LEVEL SERIALIZABLE;\nERROR 1568 (25001): Transaction characteristics can\'t be\nchanged while a transaction is in progress\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/set-transaction/','','https://mariadb.com/kb/en/library/set-transaction/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (109,8,'START SLAVE','Syntax\n------ \nSTART SLAVE [\"connection_name\"] [thread_type [,\nthread_type] ... ]\nSTART SLAVE [\"connection_name\"] [SQL_THREAD] UNTIL \n MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos\nSTART SLAVE [\"connection_name\"] [SQL_THREAD] UNTIL\n RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos\nSTART SLAVE [\"connection_name\"] [SQL_THREAD] UNTIL\n MASTER_GTID_POS = \nSTART ALL SLAVES [thread_type [, thread_type]]\nthread_type: IO_THREAD | SQL_THREAD\n \nDescription\n----------- \nSTART SLAVE with no thread_type options starts both of the\nslave\nthreads (see replication). The I/O thread reads events from\nthe master server and stores\nthem in the relay log. The SQL thread reads events from the\nrelay log\nand executes them. START SLAVE requires the SUPER privilege.\n \nIf START SLAVE succeeds in starting the slave threads, it\nreturns\nwithout any error. However, even in that case, it might be\nthat the\nslave threads start and then later stop (for example,\nbecause they do\nnot manage to connect to the master or read its binary log,\nor some\nother problem). START SLAVE does not warn you about this.\nYou must\ncheck the slave\'s error log for error messages generated by\nthe slave\nthreads, or check that they are running satisfactorily with\nSHOW SLAVE\nSTATUS.\n \nSTART SLAVE UNTIL\n \nSTART SLAVE UNTIL refers to the SQL_THREAD slave position at\nwhich the SQL_THREAD replication will halt. If SQL_THREAD\nisn\'t specified both threads are started.\n \nSince version 10.0.2, START SLAVE UNTIL master_gtid_pos=xxx\nhas also been supported. See Global Transaction ID/START\nSLAVE UNTIL master_gtid_pos=xxx for more details.\n \nconnection_name\n \nThe connection_name option was added as part of multi-source\nreplication added in MariaDB 10.0\n \nIf there is only one nameless master, or the default master\n(as specified by the default_master_connection system\nvariable) is intended, connection_name can be omitted. If\nprovided, the START SLAVE statement will apply to the\nspecified master. connection_name is case-insensitive.\n \nSTART ALL SLAVES\n \nSTART ALL SLAVES starts all configured slaves (slaves with\nmaster_host not empty) that were not started before. It will\ngive a note for all started connections. You can check the\nnotes with SHOW WARNINGS.\n \n\n\nURL: https://mariadb.com/kb/en/library/start-slave/','','https://mariadb.com/kb/en/library/start-slave/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (110,8,'START TRANSACTION','Syntax\n------ \nSTART TRANSACTION [transaction_property [,\ntransaction_property] ...] | BEGIN [WORK]\nCOMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nSET autocommit = {0 | 1}\n \ntransaction_property:\n WITH CONSISTENT SNAPSHOT\n | READ WRITE\n | READ ONLY\n \nDescription\n----------- \nThe START TRANSACTION or BEGIN statement\nbegins a new transaction. COMMIT commits the current\ntransaction, making its changes permanent. ROLLBACK rolls\nback the current transaction, canceling its changes. The SET\nautocommit statement disables or enables the default\nautocommit mode for the current session.\n \nSTART TRANSACTION and SET autocommit = 1 implicitly commit\nthe current transaction, if any.\n \nThe optional WORK keyword is supported for\nCOMMIT and ROLLBACK, as are the\nCHAIN and RELEASE clauses.\nCHAIN and RELEASE can be used for\nadditional control over transaction completion. The value of\nthe\ncompletion_type system variable determines the default\ncompletion behavior.\n \nThe AND CHAIN clause causes a new transaction to begin as\nsoon as the current one ends, and the new transaction has\nthe same isolation\nlevel as the just-terminated transaction. The RELEASE clause\ncauses the server to disconnect the current client session\nafter terminating\nthe current transaction. Including the NO keyword suppresses\nCHAIN or RELEASE completion, which can be\nuseful if the completion_type system variable is set to\ncause chaining or release completion by default.\n \nAccess Mode\n \nThese clauses appeared in MariaDB 10.0.\n \nThe access mode specifies whether the transaction is allowed\nto write data or not. By default, transactions are in READ\nWRITE mode (see the tx_read_only system variable). READ ONLY\nmode allows the storage engine to apply optimizations that\ncannot be used for transactions which write data. The only\nexception to this rule is that read only transactions can\nperform DDL statements on temporary tables.\n \nIt is not permitted to specify both READ WRITE and READ ONLY\nin the same statement.\n \nREAD WRITE and READ ONLY can also be specified in the SET\nTRANSACTION statement, in which case the specified mode is\nvalid for all sessions, or for all subsequent transaction\nused by the current session.\n \nautocommit\n \nBy default, MariaDB runs with autocommit mode enabled. This\nmeans that as soon as you execute a statement that updates\n(modifies) a table, MariaDB stores the update on disk to\nmake it permanent. To disable autocommit mode, use the\nfollowing statement:\n \nSET autocommit=0;\n \nAfter disabling autocommit mode by setting the autocommit\nvariable to zero, changes to transaction-safe tables (such\nas those for InnoDB or\nNDBCLUSTER) are not made permanent immediately. You must use\nCOMMIT to store your changes to disk or ROLLBACK to ignore\nthe changes.\n \nTo disable autocommit mode for a single series of\nstatements, use the START TRANSACTION statement.\n \nDDL Statements\n \nDDL statements (CREATE, ALTER, DROP) and administrative\nstatements (FLUSH, RESET, OPTIMIZE, ANALYZE, CHECK, REPAIR,\nCACHE INDEX), and LOAD DATA INFILE, cause an implicit COMMIT\nand start a new transaction. An exception to this rule are\nthe DDL that operate on temporary tables: you can CREATE,\nALTER and DROP them without causing any COMMIT, but those\nactions cannot be rolled back. This means that if you call\nROLLBACK, the temporary tables you created in the\ntransaction will remain, while the rest of the transaction\nwill be rolled back.\n \nTransactions cannot be used in Stored Functions or Triggers.\nIn Stored Procedures and Events BEGIN is not allowed, so you\nshould use START TRANSACTION instead.\n \nA transaction acquires a metadata lock on every table it\naccesses to prevent other connections from altering their\nstructure. The lock is released at the end of the\ntransaction. This happens even with non-transactional\nstorage engines (like MEMORY or CONNECT), so it makes sense\nto use transactions with non-transactional tables.\n \nin_transaction\n \nThe in_transaction system variable appeared in MariaDB 5.3.\n \nIt is a session-only, read-only variable that returns 1\ninside a transaction, and 0 if not in a transaction.\n \nWITH CONSISTENT SNAPSHOT\n \nThe WITH CONSISTENT SNAPSHOT option starts a consistent read\nfor storage engines such as XtraDB and InnoDB that can do\nso, the same as if a START TRANSACTION followed by a SELECT\nfrom any InnoDB table was issued. \n \nMariaDB 5.3 introduced enhancements to this feature. See\nEnhancements for START TRANSACTION WITH CONSISTENT SNAPSHOT.\n \nExamples\n-------- \nSTART TRANSACTION;\n \nSELECT @A:=SUM(salary) FROM table1 WHERE type=1;\n \nUPDATE table2 SET summary=@A WHERE type=1;\n \nCOMMIT;\n \n\n\nURL: https://mariadb.com/kb/en/library/start-transaction/','','https://mariadb.com/kb/en/library/start-transaction/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (111,8,'STOP SLAVE','Syntax\n------ \nSTOP SLAVE [\"connection_name\"] [thread_type [,\nthread_type] ... ]\n \nSTOP ALL SLAVES [thread_type [, thread_type]]\n \nthread_type: IO_THREAD | SQL_THREAD\n \nDescription\n----------- \nStops the slave threads. STOP SLAVE requires the SUPER\nprivilege.\n \nLike START SLAVE, this statement may be used with the\nIO_THREAD and\nSQL_THREAD options to name the thread or threads to be\nstopped. In almost all cases, one never need to use the\nthread_type options.\n \nSTOP SLAVE waits until any current replication event group\naffecting\none or more non-transactional tables has finished executing\n(if there\nis any such replication group), or until the user issues a\nKILL QUERY or KILL CONNECTION statement.\n \nNote that STOP SLAVE doesn\'t delete the connection\npermanently. Next time you execute START SLAVE or the\nMariaDB server restarts, the slave connection is restored\nwith it\'s original arguments. If you want to delete a\nconnection, you should execute RESET SLAVE.\n \nSTOP ALL SLAVES\n \nSTOP ALL SLAVES stops all your running slaves. It will give\nyou a note for every stopped connection. You can check the\nnotes with SHOW WARNINGS.\n \nconnection_name\n \nThe connection_name option was added as part of multi-source\nreplication added in MariaDB 10.0\n \nIf there is only one nameless master, or the default master\n(as specified by the default_master_connection system\nvariable) is intended, connection_name can be omitted. If\nprovided, the STOP SLAVE statement will apply to the\nspecified master. connection_name is case-insensitive.\n \n\n\nURL: https://mariadb.com/kb/en/library/stop-slave/','','https://mariadb.com/kb/en/library/stop-slave/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (112,8,'Transaction Timeouts','MariaDB has always had the wait_timeout and\ninteractive_timeout settings, which close connections after\na certain period of inactivity.\n \nHowever, these are by default set to a long wait period. In\nsituations where transactions may be started, but not\ncommitted or rolled back, more granular control and a\nshorter timeout may be desirable so as to avoid locks being\nheld for too long.\n \nMariaDB 10.3 introduced three new variables to handle this\nsituation.\nidle_transaction_timeout (all transactions)\nidle_write_transaction_timeout (write transactions - called\nidle_readwrite_transaction_timeout until MariaDB 10.3.2)\nidle_readonly_transaction_timeout (read transactions)\n \nThese accept a time in seconds to time out, by closing the\nconnection, transactions that are idle for longer than this\nperiod. By default all are set to zero, or no timeout.\n \nidle_transaction_timeout affects all transactions,\nidle_write_transaction_timeout affects write transactions\nonly and idle_readonly_transaction_timeout affects read\ntransactions only. The latter two variables work\nindependently. However, if either is set along with\nidle_transaction_timeout, the settings for\nidle_write_transaction_timeout or\nidle_readonly_transaction_timeout will take precedence.\n \nExamples\n-------- \nSET SESSION idle_transaction_timeout=2;\n \nBEGIN;\n \nSELECT * FROM t;\n \nEmpty set (0.000 sec)\n## wait 3 seconds\nSELECT * FROM t;\n \nERROR 2006 (HY000): MySQL server has gone away\n \nSET SESSION idle_write_transaction_timeout=2;\n \nBEGIN;\n \nSELECT * FROM t;\n \nEmpty set (0.000 sec)\n## wait 3 seconds\nSELECT * FROM t;\n \nEmpty set (0.000 sec)\nINSERT INTO t VALUES(1);\n## wait 3 seconds\nSELECT * FROM t;\n \nERROR 2006 (HY000): MySQL server has gone away\n \nSET SESSION idle_transaction_timeout=2, SESSION\nidle_readonly_transaction_timeout=10;\n \nBEGIN;\n \nSELECT * FROM t;\n \nEmpty set (0.000 sec)\n ## wait 3 seconds\nSELECT * FROM t;\n \nEmpty set (0.000 sec)\n## wait 11 seconds\nSELECT * FROM t;\n \nERROR 2006 (HY000): MySQL server has gone away\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/transaction-timeouts/','','https://mariadb.com/kb/en/library/transaction-timeouts/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (113,8,'UNLOCK TABLES','Syntax\n------ \nUNLOCK TABLES\n \nDescription\n----------- \nUNLOCK TABLES explicitly releases any table locks held by\nthe\ncurrent session. See LOCK TABLES for more information.\n \nIn addition to releasing table locks acquired by the LOCK\nTABLES statement, the UNLOCK TABLES statement also releases\nthe global read lock acquired by the FLUSH TABLES WITH READ\nLOCK statement. The FLUSH TABLES WITH READ LOCK statement is\nvery useful for performing backups. See FLUSH for more\ninformation about FLUSH TABLES WITH READ LOCK.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/transactions-unlock-tables/','','https://mariadb.com/kb/en/library/transactions-unlock-tables/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (114,8,'WAIT and NOWAIT','MariaDB 10.3.0 introduced extended syntax so that it is\npossible to set innodb_lock_wait_timeout and\nlock_wait_timeout for the following statements:\n \nSyntax\n------ \nALTER TABLE tbl_name [WAIT n|NOWAIT] ...\nCREATE ... INDEX ON tbl_name (index_col_name, ...) [WAIT\nn|NOWAIT] ...\nDROP INDEX ... [WAIT n|NOWAIT]\nDROP TABLE tbl_name [WAIT n|NOWAIT] ...\nLOCK TABLE ... [WAIT n|NOWAIT]\nOPTIMIZE TABLE tbl_name [WAIT n|NOWAIT]\nRENAME TABLE tbl_name [WAIT n|NOWAIT] ...\nSELECT ... FOR UPDATE [WAIT n|NOWAIT]\nSELECT ... LOCK IN SHARE MODE [WAIT n|NOWAIT]\nTRUNCATE TABLE tbl_name [WAIT n|NOWAIT]\n \nDescription\n----------- \nThe lock wait timeout can be explicitly set in the statement\nby using either WAIT n (to set the wait in seconds) or\nNOWAIT, in which case the statement will immediately fail if\nthe lock cannot be obtained. WAIT 0 is equivalent to NOWAIT.\n \n\n\nURL: https://mariadb.com/kb/en/library/wait-and-nowait/','','https://mariadb.com/kb/en/library/wait-and-nowait/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (115,8,'XA Transactions','Overview\n \nThe MariaDB XA implementation is based on the X/Open CAE\ndocument Distributed Transaction Processing: The XA\nSpecification. This document is published by The Open Group\nand available at\nhttp://www.opengroup.org/public/pubs/catalog/c193.htm.\n \nXA transactions are designed to allow distributed\ntransactions, where a transaction manager (the application)\ncontrols a transaction which involves multiple resources.\nSuch resources are usually DBMSs, but could be resources of\nany type. The whole set of required transactional operations\nis called a global transaction. Each subset of operations\nwhich involve a single resource is called a local\ntransaction. XA used a 2-phases commit (2PC). With the first\ncommit, the transaction manager tells each resource to\nprepare an effective commit, and waits for a confirm\nmessage. The changes are not still made effective at this\npoint. If any of the resources encountered an error, the\ntransaction manager will rollback the global transaction. If\nall resources communicate that the first commit is\nsuccessful, the transaction manager can require a second\ncommit, which makes the changes effective.\n \nIn MariaDB, XA transactions can only be used with storage\nengines that support them. At least InnoDB, TokuDB, SPIDER\nand MyRocks support them. For InnoDB, XA transactions can be\ndisabled by setting the innodb_support_xa server system\nvariable to 0. \n \nLike regular transactions, XA transactions create metadata\nlocks on accessed tables.\n \nXA transactions require REPEATABLE READ as a minimum\nisolation level. However, distributed transactions should\nalways use SERIALIZABLE.\n \nTrying to start more than one XA transaction at the same\ntime produces a 1400 error (SQLSTATE \'XAE09\'). The same\nerror is produced when attempting to start an XA transaction\nwhile a regular transaction is in effect. Trying to start a\nregular transaction while an XA transaction is in effect\nproduces a 1399 error (SQLSTATE \'XAE07\').\n \nThe statements that cause an implicit COMMIT for regular\ntransactions produce a 1400 error (SQLSTATE \'XAE09\') if a\nXA transaction is in effect.\n \nInternal XA vs External XA\n \nXA transactions are an overloaded term in MariaDB. If a\nstorage engine is XA-capable, it can mean one or both of\nthese:\nIt supports MariaDB\'s internal two-phase commit API. This\nis transparent to the user. Sometimes this is called\n\"internal XA\", since MariaDB\'s internal transaction\ncoordinator log can handle coordinating these transactions.\n \nIt supports XA transactions, with the XA START, XA PREPARE,\nXA COMMIT, etc. statements. Sometimes this is called\n\"external XA\", since it requires the use of an external\ntransaction coordinator to use this feature properly.\n \nTransaction Coordinator Log\n \nIf you have two or more XA-capable storage engines enabled,\nthen a transaction coordinator log must be available.\n \nThere are currently two implementations of the transaction\ncoordinator log:\nBinary log-based transaction coordinator log\nMemory-mapped file-based transaction coordinator log\n \nIf the binary log is enabled on a server, then the server\nwill use the binary log-based transaction coordinator log.\nOtherwise, it will use the memory-mapped file-based\ntransaction coordinator log.\n \nSee Transaction Coordinator Log for more information.\n \nSyntax\n------ \nXA {START|BEGIN} xid [JOIN|RESUME]\n \nXA END xid [SUSPEND [FOR MIGRATE]]\n \nXA PREPARE xid\n \nXA COMMIT xid [ONE PHASE]\n \nXA ROLLBACK xid\n \nXA RECOVER [FORMAT=[\'RAW\'|\'SQL\']]\n \nxid: gtrid [, bqual [, formatID ]]\n \nThe interface to XA transactions is a set of SQL statements\nstarting with XA. Each statement changes a transaction\'s\nstate, determining which actions it can perform. A\ntransaction which does not exist is in the NON-EXISTING\nstate.\n \nXA START (or BEGIN) starts a transaction and defines its xid\n(a transaction identifier). The JOIN or RESUME keywords have\nno effect. The new transaction will be in ACTIVE state.\n \nThe xid can have 3 components, though only the first one is\nmandatory. gtrid is a quoted string representing a global\ntransaction identifier. bqual is a quoted string\nrepresenting a local transaction identifier. formatID is an\nunsigned integer indicating the format used for the first\ntwo components; if not specified, defaults to 1. MariaDB\ndoes not interpret in any way these components, and only\nuses them to identify a transaction. xids of transactions in\neffect must be unique.\n \nXA END declares that the specified ACTIVE transaction is\nfinished and it changes its state to IDLE. SUSPEND [FOR\nMIGRATE] has no effect.\n \nXA PREPARE prepares an IDLE transaction for commit, changing\nits state to PREPARED. This is the first commit.\n \nXA COMMIT definitely commits and terminates a transaction\nwhich has already been PREPARED. If the ONE PHASE clause is\nspecified, this statements performs a 1-phase commit on an\nIDLE transaction.\n \nXA ROLLBACK rolls back and terminates an IDLE or PREPARED\ntransaction.\n \nXA RECOVER shows information about all PREPARED\ntransactions.\n \nWhen trying to execute an operation which is not allowed for\nthe transaction\'s current state, an error is produced:\n \nXA COMMIT \'test\' ONE PHASE;\n \nERROR 1399 (XAE07): XAER_RMFAIL: The command cannot be\nexecuted when global transaction is in the ACTIVE state\n \nXA COMMIT \'test2\';\n \nERROR 1399 (XAE07): XAER_RMFAIL: The command cannot be\nexecuted when global transaction is in the NON-EXISTING\nstate\n \nXA RECOVER\n \nThe XA RECOVER statement shows information about all\ntransactions which are in the PREPARED state. It does not\nmatter which connection created the transaction: if it has\nbeen PREPARED, it appears. But this does not mean that a\nconnection can commit or rollback a transaction which was\nstarted by another connection. Note that transactions using\na 1-phase commit are never in the PREPARED state, so they\ncannot be shown by XA RECOVER.\n \nXA RECOVER produces four columns:\n \nXA RECOVER;\n \n+----------+--------------+--------------+------+\n| formatID | gtrid_length | bqual_length | data |\n+----------+--------------+--------------+------+\n| 1 | 4 | 0 | test |\n+----------+--------------+--------------+------+\n \nYou can use XA RECOVER FORMAT=\'SQL\' to get the data in a\nhuman readable\nform that can be directly copy-pasted into XA COMMIT or XA\nROLLBACK. This is particularly useful for binary xid\ngenerated by some transaction coordinators.\n \nformatID is the formatID part of xid.\n \ndata are the gtrid and bqual parts of xid, concatenated.\n \ngtrid_length and bqual_length are the lengths of gtrid and\nbqual, respectevely.\n \nExamples\n-------- \n2-phases commit:\n \nXA START \'test\';\n \nINSERT INTO t VALUES (1,2);\n \nXA END \'test\';\n \nXA PREPARE \'test\';\n \nXA COMMIT \'test\';\n \n1-phase commit:\n \nXA START \'test\';\n \nINSERT INTO t VALUES (1,2);\n \nXA END \'test\';\n \nXA COMMIT \'test\' ONE PHASE;\n \nHuman-readable:\n \nxa start \'12\\r34\\t67\\v78\', \'abc\\ndef\', 3;\n \ninsert t1 values (40);\n \nxa end \'12\\r34\\t67\\v78\', \'abc\\ndef\', 3;\n \nxa prepare \'12\\r34\\t67\\v78\', \'abc\\ndef\', 3;\n \nxa recover format=\'RAW\';\n \n+----------+--------------+--------------+--------------------+\n| formatID | gtrid_length | bqual_length | data |\n+----------+--------------+--------------+--------------------+\n34 67v78abc 11 | 7 | 12\ndef |\n+----------+--------------+--------------+--------------------+\n \nxa recover format=\'SQL\';\n \n+----------+--------------+--------------+-----------------------------------------------+\n| formatID | gtrid_length | bqual_length | data |\n+----------+--------------+--------------+-----------------------------------------------+\n| 3 | 11 | 7 |\nX\'31320d3334093637763738\',X\'6162630a646566\',3 |\n+----------+--------------+--------------+-----------------------------------------------+\n \nxa rollback\nX\'31320d3334093637763738\',X\'6162630a646566\',3;\n \nKnown Issues\n \nMariaDB Galera Cluster\n \nMariaDB Galera Cluster does not support XA transactions. See\nMDEV-10532 for more information on that. The request to\nimplement that feature is being tracked at MDEV-17099.\n \nHowever, MariaDB Galera Cluster builds include a built-in\nplugin called wsrep. Prior to MariaDB 10.4.3, this plugin\nwas internally considered an XA-capable storage engine.\nConsequently, these MariaDB Galera Cluster builds have\nmultiple XA-capable storage engines by default, even if the\nonly \"real\" storage engine that supports external XA\ntransactions enabled on these builds by default is InnoDB.\nTherefore, when using one these builds MariaDB would be\nforced to use a transaction coordinator log by default,\nwhich could have performance implications.\n \nSee Transaction Coordinator Log Overview: MariaDB Galera\nCluster for more information.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/xa-transactions/','','https://mariadb.com/kb/en/library/xa-transactions/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (116,10,'Account Locking','Account locking was introduced in MariaDB 10.4.2.\n \nDescription\n----------- \nAccount locking permits privileged administrators to\nlock/unlock user accounts. No new client connections will be\npermitted if an account is locked (existing connections are\nnot affected).\n \nUser accounts can be locked at creation, with the CREATE\nUSER statement, or modified after creation with the ALTER\nUSER statement. For example:\n \nCREATE USER \'lorin\'@\'localhost\' ACCOUNT LOCK;\n \nor\n \nALTER USER \'marijn\'@\'localhost\' ACCOUNT LOCK;\n \nThe server will return an ER_ACCOUNT_HAS_BEEN_LOCKED error\nwhen locked users attempt to connect:\n \nmysql -ulorin\n ERROR 4151 (HY000): Access denied, this account is locked\n \nThe ALTER USER statement is also used to unlock a user:\n \nALTER USER \'lorin\'@\'localhost\' ACCOUNT UNLOCK;\n \nThe SHOW CREATE USER statement will show whether the account\nis locked:\n \nSHOW CREATE USER \'marijn\'@\'localhost\';\n \n+-----------------------------------------------+\n| CREATE USER for marijn@localhost |\n+-----------------------------------------------+\n| CREATE USER \'marijn\'@\'localhost\' ACCOUNT LOCK |\n+-----------------------------------------------+\n \nas well as querying the mysql.global_priv table:\n \nSELECT CONCAT(user, \'@\', host, \' => \',\nJSON_DETAILED(priv)) FROM mysql.global_priv \n WHERE user=\'marijn\';\n+--------------------------------------------------------------------------------------+\n| CONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv)) |\n+--------------------------------------------------------------------------------------+\n| marijn@localhost => {\n \"access\": 0,\n \"plugin\": \"mysql_native_password\",\n \"authentication_string\": \"\",\n \"account_locked\": true,\n \"password_last_changed\": 1558017158\n} |\n+--------------------------------------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/account-locking/','','https://mariadb.com/kb/en/library/account-locking/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (117,10,'Authentication from MariaDB 10.4','MariaDB 10.4 introduces a number of changes to the\nauthentication process, intended to make things easier and\nmore intuitive.\n \nOverview\n \nThere are four main changes relating to authentication:\nIt is possible to use more than one authentication plugin\nfor each user account. For example, this can be useful to\nslowly migrate users to the more secure ed25519\nauthentication plugin over time, while allowing the old\nmysql_native_password authentication plugin as an\nalternative for the transitional period.\nThe root@localhost user account created by mysql_install_db\nis created with the ability to use two authentication\nplugins.\nFirst, it is configured to try to use the unix_socket\nauthentication plugin. This allows the the root@localhost\nuser to login without a password via the local Unix socket\nfile defined by the socket system variable, as long as the\nlogin is attempted from a process owned by the operating\nsystem root user account.\nSecond, if authentication fails with the unix_socket\nauthentication plugin, then it is configured to try to use\nthe mysql_native_password authentication plugin. However, an\ninvalid password is initially set, so in order to\nauthenticate this way, a password must be set with SET\nPASSWORD.\nHowever, just using the unix_socket authentication plugin\nmay be fine for many users, and it is very secure. You may\nwant to try going without password authentication to see how\nwell it works for you. Remember, the best way to keep your\npassword safe is not to have one!\n \nAll user accounts, passwords, and global privileges are now\nstored in the mysql.global_priv table. The mysql.user table\nstill exists and has exactly the same set of columns as\nbefore, but it’s now a view that references the\nmysql.global_priv table. Tools that analyze the mysql.user\ntable should continue to workas before.\nMariaDB 10.4 supports User Password Expiry, which is not\nactive by default.\n \nDescription\n----------- \nAs a result of the above changes, the open-for-everyone\nall-powerful root account is finally gone. And installation\nscripts will no longer demand that you “PLEASE REMEMBER TO\nSET A PASSWORD FOR THE MariaDB root USER !”, because the\nroot account is securely created automatically.\n \nTwo all-powerful accounts are created by default — root\nand the OS user that owns the data directory, typically\nmysql. They are created as:\n \nCREATE USER root@localhost IDENTIFIED VIA unix_socket OR\nmysql_native_password USING \'invalid\'\nCREATE USER mysql@localhost IDENTIFIED VIA unix_socket OR\nmysql_native_password USING \'invalid\'\n \nUsing unix_socket means that if you are the system root\nuser, you can login as root@locahost without a password.\nThis technique was pioneered by Otto Kekäläinen in Debian\nMariaDB packages and has been successfully used in Debian\nsince as early as MariaDB 10.0. \n \nIt is based on a simple fact that asking the system root for\na password adds no extra security — root has full access\nto all the data files and all process memory anyway. But not\nasking for a password means, there is no root password to\nforget (no need for the numerous tutorials on “how to\nreset MariaDB root password”). And if you want to script\nsome tedious database work, there is no need to store the\nroot password in plain text for the scipt to use (no need\nfor debian-sys-maint user).\n \nStill, some users may wish to log in as MariaDB root without\nusing sudo. Hence the old authentication method —\nconventional MariaDB password — is still available. By\ndefault it is disabled (“invalid” is not a valid\npassword hash), but one can set the password with a usual\nSET PASSWORD statement. And still retain the password-less\naccess via sudo.\n \nIf you install MariaDB locally (say from a tarball, you\nwould not want to use sudo to be able to login. This is why\nMariaDB creates a second all-powerful user with the same\nname as a system user that owns the data directory. In local\n(not system-wide) installations, this will be the user who\ninstalled MariaDB — they automatically get convenient\npassword-less root-like access, because they can access all\nthe data files anyway.\n \nEven if MariaDB is installed system-wide, you may not want\nto run your database maintenance scripts as system root —\nnow you can run them as system mysql user. And you will know\nthat they will never destroy your entire system, even if you\nmake a typo in a shell script.\n \nHowever, seasoned MariaDB DBAs who are used to the old ways\ndo need to makes some changes. See the examples below for\ncommon tasks. \n \nCookbook\n \nAfter installing MariaDB system-wide the first thing\nyou’ve got used to doing is logging in into the\nunprotected root account and protecting it, that is, setting\nthe root password:\n \n$ sudo dnf install MariaDB-server\n$ mysql -uroot\n...\nMariaDB> set password = password(\"XH4VmT3_jt\");\n \nThis is not only unnecessary now, it will simply not work\n— there is no unprotected root account. To login as root\nuse\n \n$ sudo dnf install MariaDB-server\n$ sudo mysql\n \nNote that it implies you are connecting via the unix socket,\nnot tcp. If you happen to have protocol=tcp in a system-wide\n/etc/my.cnf file, use sudo mysql --protocol=socket.\n \nAfter installing MariaDB locally you’ve also used to\nconnect to the unprotected root account using mysql -uroot.\nThis will not work either, simply use mysql without\nspecifying a username.\n \nIf you\'ve forgotten your root password, no problem — you\ncan still connect using sudo and change the password. And if\nyou\'ve also removed unix_socket authentication, to restore\naccess do as follows:\nrestart MariaDB with --skip-grant-tables\nlogin into the unprotected server\nrun FLUSH PRIVILEGES (note, before 10.4 this would’ve been\nthe last step, not anymore). This disables\n--skip-grant-tables and allows you to change the stored\nauthentication method.\nrun SET PASSWORD FOR root@localhost to change the root\npassword\n \nTo view inside privilege tables, the old mysql.user table\nstill exists. You can select from it as before, although you\ncannot update it anymore. It doesn’t show alternative\nauthentication plugins and this was one of the reasons for\nswitching to the mysql.global_priv table — complex\nauthentication rules did not fit into rigid structure of a\nrelational table. You can select from the new table, for\nexample: \n \nselect concat(user, \'@\', host, \' => \',\njson_detailed(priv)) from mysql.global_priv;\n \nReverting to the Previous Authentication Method for\nroot@localhost\n \nIf you don\'t want the root@localhost user account created\nby mysql_install_db to use unix_socket authentication by\ndefault, then there are a few ways to revert to the previous\nmysql_native_password authentication method for this user\naccount.\n \nConfiguring mysql_install_db to Revert to the Previous\nAuthentication Method\n \nOne way to revert to the previous mysql_native_password\nauthentication method for the root@localhost user account is\nto execute mysql_install_db with a special option. If\nmysql_install_db is executed while\n--auth-root-authentication-method=normal is specified, then\nit will create the default user accounts using the default\nbehavior of MariaDB 10.3 and before.\n \nThis means that the root@localhost user account will use\nmysql_native_password authentication by default. There are\nsome other differences as well. See mysql_install_db: User\nAccounts Created by Default for more information.\n \nFor example, the option can be set on the command-line while\nrunning mysql_install_db:\n \nmysql_install_db --user=mysql --datadir=/var/lib/mysql\n--auth-root-authentication-method=normal\n \nThe option can also be set in an option file in an option\ngroup supported by mysql_install_db. For example:\n \n[mysql_install_db]\nauth_root_authentication_method=normal\n \nIf the option is set in an option file and if\nmysql_install_db is executed, then mysql_install_db will\nread this option from the option file, and it will\nautomatically set this option.\n \nAltering the User Account to Revert to the Previous\nAuthentication Method\n \nIf you have already installed MariaDB, and if the\nroot@localhost user account is already using unix_socket\nauthentication, then you can revert to the old\nmysql_native_password authentication method for the user\naccount by executing the following:\n \nALTER USER root@localhost IDENTIFIED VIA\nmysql_native_password USING PASSWORD(\"verysecret\")\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/authentication-from-mariadb-104/','','https://mariadb.com/kb/en/library/authentication-from-mariadb-104/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (118,10,'CREATE USER','Syntax\n------ \nCREATE [OR REPLACE] USER [IF NOT EXISTS] \n user_specification [,user_specification ...] \n [REQUIRE {NONE | tls_option [[AND] tls_option ...] }]\n [WITH resource_option [resource_option ...] ]\n [password_option | lock_option] \n \nuser_specification:\n username [authentication_option]\n \nauthentication_option:\n IDENTIFIED BY \'password\' \n | IDENTIFIED BY PASSWORD \'password_hash\'\n | IDENTIFIED {VIA|WITH} authentication_rule [OR\nauthentication_rule ...]\n \nauthentication_rule:\n authentication_plugin\n | authentication_plugin {USING|AS}\n\'authentication_string\'\n | authentication_plugin {USING|AS} PASSWORD(\'password\')\n \ntls_option:\n SSL \n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n \nresource_option:\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n | MAX_STATEMENT_TIME time\n \npassword_option:\n PASSWORD EXPIRE\n | PASSWORD EXPIRE DEFAULT\n | PASSWORD EXPIRE NEVER\n | PASSWORD EXPIRE INTERVAL N DAY\n \nlock_option:\n ACCOUNT LOCK\n | ACCOUNT UNLOCK\n}\n \nDescription\n----------- \nThe CREATE USER statement creates new MariaDB accounts. To\nuse it, you must have the global CREATE USER privilege or\nthe INSERT privilege for the mysql database. For each\naccount, CREATE USER creates a new row in\nthe mysql.user table that has no privileges.\n \nIf any of the specified accounts, or any permissions for the\nspecified accounts, already exist, then the server returns\nERROR 1396 (HY000). If an error occurs, CREATE USER will\nstill create the accounts that do not result in an error.\nOnly one error is produced for all users which have not been\ncreated:\n \nERROR 1396 (HY000): \n Operation CREATE USER failed for \'u1\'@\'%\',\'u2\'@\'%\'\n \nCREATE USER, DROP USER, CREATE ROLE, and DROP ROLE all\nproduce the\nsame error code when they fail.\n \nSee Account Names below for details on how account names are\nspecified. \n \nOR REPLACE\n \nIf the optional OR REPLACE clause is used, it is basically a\nshortcut for:\n \nDROP USER IF EXISTS name;\n \nCREATE USER name ...;\n \nFor example:\n \nCREATE USER foo2@test IDENTIFIED BY \'password\';\n \nERROR 1396 (HY000): Operation CREATE USER failed for\n\'foo2\'@\'test\'\n \nCREATE OR REPLACE USER foo2@test IDENTIFIED BY \'password\';\n \nQuery OK, 0 rows affected (0.00 sec)\n \nIF NOT EXISTS\n \nWhen the IF NOT EXISTS clause is used, MariaDB will return a\nwarning instead of an error if the specified user already\nexists.\n \nFor example:\n \nCREATE USER foo2@test IDENTIFIED BY \'password\';\n \nERROR 1396 (HY000): Operation CREATE USER failed for\n\'foo2\'@\'test\'\n \nCREATE USER IF NOT EXISTS foo2@test IDENTIFIED BY\n\'password\';\n \nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n \nSHOW WARNINGS;\n \n+-------+------+----------------------------------------------------+\n| Level | Code | Message |\n+-------+------+----------------------------------------------------+\n| Note | 1973 | Can\'t create user \'foo2\'@\'test\';\n it already exists |\n+-------+------+----------------------------------------------------+\n1 row in set (0.00 sec\n \nAuthentication Options\n \nIDENTIFIED BY \'password\'\n \nThe optional IDENTIFIED BY clause can be used to provide an\naccount with a password. The password should be specified in\nplain text. It will be hashed by the PASSWORD function prior\nto being stored to the mysql.user table.\n \nFor example, if our password is mariadb, then we can create\nthe user with:\n \nCREATE USER foo2@test IDENTIFIED BY \'mariadb\';\n \nIf you do not specify a password with the IDENTIFIED BY\nclause, the user\nwill be able to connect without a password. A blank password\nis not a wildcard\nto match any password. The user must connect without\nproviding a password if no\npassword is set.\n \nThe only authentication plugins that this clause supports\nare mysql_native_password and mysql_old_password.\n \nIDENTIFIED BY PASSWORD \'password_hash\'\n \nThe optional IDENTIFIED BY PASSWORD clause can be used to\nprovide an account with a password that has already been\nhashed. The password should be specified as a hash that was\nprovided by the PASSWORD function. It will be stored to the\nmysql.user table as-is.\n \nFor example, if our password is mariadb, then we can find\nthe hash with:\n \nSELECT PASSWORD(\'mariadb\');\n+-------------------------------------------+\n| PASSWORD(\'mariadb\') |\n+-------------------------------------------+\n| *54958E764CE10E50764C2EECBB71D01F08549980 |\n+-------------------------------------------+\n1 row in set (0.00 sec)\n \nAnd then we can create a user with the hash:\n \nCREATE USER foo2@test IDENTIFIED BY PASSWORD\n\'*54958E764CE10E50764C2EECBB71D01F08549980\';\n \nIf you do not specify a password with the IDENTIFIED BY\nclause, the user\nwill be able to connect without a password. A blank password\nis not a wildcard\nto match any password. The user must connect without\nproviding a password if no\npassword is set.\n \nThe only authentication plugins that this clause supports\nare mysql_native_password and mysql_old_password.\n \nIDENTIFIED {VIA|WITH} authentication_plugin\n \nThe optional IDENTIFIED VIA authentication_plugin allows you\nto specify that the account should be authenticated by a\nspecific authentication plugin. The plugin name must be an\nactive authentication plugin as per SHOW PLUGINS. If it\ndoesn\'t show up in that output, then you will need to\ninstall it with INSTALL PLUGIN or INSTALL SONAME.\n \nFor example, this could be used with the PAM authentication\nplugin:\n \nCREATE USER foo2@test IDENTIFIED VIA pam;\n \nSome authentication plugins allow additional arguments to be\nspecified after a USING or AS keyword. For example, the PAM\nauthentication plugin accepts a service name:\n \nCREATE USER foo2@test IDENTIFIED VIA pam USING \'mariadb\';\n \nThe exact meaning of the additional argument would depend on\nthe specific authentication plugin.\n \nThe USING or AS keyword can also be used to provide a\nplain-text password to a plugin if it\'s provided as an\nargument to the PASSWORD() function. This is only valid for\nauthentication plugins that have implemented a hook for the\nPASSWORD() function. For example, the ed25519 authentication\nplugin supports this:\n \nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 USING\nPASSWORD(\'secret\');\n \nOne can specify many authentication plugins, they all works\nas alternatives ways of authenticating a user:\n \nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 USING\nPASSWORD(\'secret\') OR unix_socket;\n \nTLS Options\n \nBy default, MariaDB transmits data between the server and\nclients without encrypting it. This is generally acceptable\nwhen the server and client run on the same host or in\nnetworks where security is guaranteed through other means.\nHowever, in cases where the server and client exist on\nseparate networks or they are in a high-risk network, the\nlack of encryption does introduce security concerns as a\nmalicious actor could potentially eavesdrop on the traffic\nas it is sent over the network between them.\n \nTo mitigate this concern, MariaDB allows you to encrypt data\nin transit between the server and clients using the\nTransport Layer Security (TLS) protocol. TLS was formerly\nknown as Secure Socket Layer (SSL), but strictly speaking\nthe SSL protocol is a predecessor to TLS and, that version\nof the protocol is now considered insecure. The\ndocumentation still uses the term SSL often and for\ncompatibility reasons TLS-related server system and status\nvariables still use the prefix ssl_, but internally, MariaDB\nonly supports its secure successors.\n \nSee Secure Connections Overview for more information about\nhow to determine whether your MariaDB server has TLS\nsupport.\n \nYou can set certain TLS-related restrictions for specific\nuser accounts. For instance, you might use this with user\naccounts that require access to sensitive data while sending\nit across networks that you do not control. These\nrestrictions can be enabled for a user account with the\nCREATE USER, ALTER USER, or GRANT statements. The following\noptions are available:\n \nOption | Description | \n \nREQUIRE NONE | TLS is not required for this account, but can\nstill be used. | \n \nREQUIRE SSL | The account must use TLS, but no valid X509\ncertificate is required. This option cannot be combined with\nother TLS options. | \n \nREQUIRE X509 | The account must use TLS and must have a\nvalid X509 certificate. This option implies REQUIRE SSL.\nThis option cannot be combined with other TLS options. | \n \nREQUIRE ISSUER \'issuer\' | The account must use TLS and\nmust have a valid X509 certificate. Also, the Certificate\nAuthority must be the one specified via the string issuer.\nThis option implies REQUIRE X509. This option can be\ncombined with the SUBJECT, and CIPHER options in any order.\n| \n \nREQUIRE SUBJECT \'subject\' | The account must use TLS and\nmust have a valid X509 certificate. Also, the certificate\'s\nSubject must be the one specified via the string subject.\nThis option implies REQUIRE X509. This option can be\ncombined with the ISSUER, and CIPHER options in any order. |\n\n \nREQUIRE CIPHER \'cipher\' | The account must use TLS, but no\nvalid X509 certificate is required. Also, the encryption\nused for the connection must use one of the methods\nspecified in the string cipher. This option implies REQUIRE\nSSL. This option can be combined with the ISSUER, and\nSUBJECT options in any order. | \n \nThe REQUIRE keyword must be used only once for all specified\noptions, and the AND keyword can be used to separate\nindividual options, but it is not required.\n \nFor example, you can create a user account that requires\nthese TLS options with the following:\n \nCREATE USER \'alice\'@\'%\'\n REQUIRE SUBJECT \'/CN=alice/O=My Dom,\nInc./C=US/ST=Oregon/L=Portland\'\n AND ISSUER \'/C=FI/ST=Somewhere/L=City/ O=Some\nCompany/CN=Peter Parker/emailAddress=p.parker@marvel.com\'\n AND CIPHER \'TLSv1.2\';\n \nIf any of these options are set for a specific user account,\nthen any client who tries to connect with that user account\nwill have to be configured to connect with TLS.\n \nSee Securing Connections for Client and Server for\ninformation on how to enable TLS on the client and server.\n \nResource Limit Options\n \nMariaDB 10.2.0 introduced a number of resource limit\noptions.\n \nIt is possible to set per-account limits for certain server\nresources. The following table shows the values that can be\nset per account:\n \nLimit Type | Decription | \n \nMAX_QUERIES_PER_HOUR | Number of statements that the account\ncan issue per hour (including updates) | \n \nMAX_UPDATES_PER_HOUR | Number of updates (not queries) that\nthe account can issue per hour | \n \nMAX_CONNECTIONS_PER_HOUR | Number of connections that the\naccount can start per hour | \n \nMAX_USER_CONNECTIONS | Number of simultaneous connections\nthat can be accepted from the same account; if it is 0,\nmax_connections will be used instead; if max_connections is\n0, there is no limit for this account\'s simultaneous\nconnections. | \n \nMAX_STATEMENT_TIME | Timeout, in seconds, for statements\nexecuted by the user. See also Aborting Statements that\nExceed a Certain Time to Execute. | \n \nIf any of these limits are set to 0, then there is no limit\nfor that resource for that user.\n \nHere is an example showing how to create a user with\nresource limits:\n \nCREATE USER \'someone\'@\'localhost\' WITH\n MAX_USER_CONNECTIONS 10\n MAX_QUERIES_PER_HOUR 200;\n \nThe resources are tracked per account, which means\n\'user\'@\'server\'; not per user name or per connection.\n \nThe count can be reset for all users using FLUSH\nUSER_RESOURCES, FLUSH PRIVILEGES or mysqladmin reload.\n \nPer account resource limits are stored in the user table, in\nthe mysql database. Columns used for resources limits are\nnamed max_questions, max_updates, max_connections (for\nMAX_CONNECTIONS_PER_HOUR), and max_user_connections (for\nMAX_USER_CONNECTIONS).\n \nAccount Names\n \nAccount names have both a user name component and a host\nname component, and are specified as\n\'user_name\'@\'host_name\'.\n \nThe user name and host name may be unquoted, quoted as\nstrings using double quotes (\") or\nsingle quotes (\'), or quoted as identifiers using backticks\n(`). You must use quotes\nwhen using special characters (such as a hyphen) or wildcard\ncharacters. If you quote, you \nmust quote the user name and host name separately (for\nexample \'user_name\'@\'host_name\').\n \nHost Name Component\n \nIf the host name is not provided, it is assumed to be \'%\'.\n \nHost names may contain the wildcard characters % and _. They\nare matched as if by\nthe LIKE clause. If you need to use a wildcard character\nliterally (for example, to\nmatch a domain name with an underscore), prefix the\ncharacter with a backslash. See LIKE\nfor more information on escaping wildcard characters.\n \nHost name matches are case-insensitive. Host names can match\neither domain names or IP\naddresses. Use \'localhost\' as the host name to allow only\nlocal client connections.\n \nYou can use a netmask to match a range of IP addresses using\n\'base_ip/netmask\' as the\nhost name. A user with an IP address ip_addr will be allowed\nto connect if the following\ncondition is true:\n \nip_addr & netmask = base_ip\n \nYou can only use netmasks that specify a multiple of 8 bits\nof the address to match. That is,\nonly the following netmasks are allowed:\n \n255.0.0.0\n255.255.0.0\n255.255.255.0\n255.255.255.255\n \nUsing 255.255.255.255 is equivalent to not using a netmask\nat all.\n \nUser Name Component\n \nUser names must match exactly, including case. A user name\nthat is empty is known as an anonymous account and is\nallowed to match a login attempt with any user name\ncomponent. These are described more in the next section.\n \nFor valid identifiers to use as user names, see Identifier\nNames.\n \nIt is possible for more than one account to match when a\nuser connects. MariaDB selects\nthe first matching account after sorting according to the\nfollowing criteria:\nAccounts with an exact host name are sorted before accounts\nusing a wildcard in the\nhost name. Host names using a netmask are considered to be\nexact for sorting.\nAccounts with a wildcard in the host name are sorted\naccording to the position of\nthe first wildcard character. Those with a wildcard\ncharacter later in the host name\nsort before those with a wildcard character earlier in the\nhost name.\nAccounts with a non-empty user name sort before accounts\nwith an empty user name.\nAccounts with an empty user name are sorted last. As\nmentioned previously, these are known as anonymous accounts.\nThese are described more in the next section.\n \nThe following table shows a list of example account as\nsorted by these criteria:\n \n+---------+-------------+\n| User | Host |\n+---------+-------------+\n| joffrey | 192.168.0.3 |\n| | 192.168.0.% |\n| joffrey | 192.168.% |\n| | 192.168.% |\n+---------+-------------+\n \nOnce connected, you only have the privileges granted to the\naccount that matched,\nnot all accounts that could have matched. For example,\nconsider the following\ncommands:\n \nCREATE USER \'joffrey\'@\'192.168.0.3\';\n \nCREATE USER \'joffrey\'@\'%\';\n \nGRANT SELECT ON test.t1 to \'joffrey\'@\'192.168.0.3\';\n \nGRANT SELECT ON test.t2 to \'joffrey\'@\'%\';\n \nIf you connect as joffrey from 192.168.0.3, you will have\nthe SELECT\nprivilege on the table test.t1, but not on the table\ntest.t2. If you connect as joffrey from any other IP\naddress, you will have the SELECT privilege on the table\ntest.t2, but not\non the table test.t1.\n \nBeginning with MariaDB 5.5.31, usernames can be up to 80\ncharacters long. From MariaDB 10.0 the system tables are all\nby default this length. However, in order to enable this\nfeature in MariaDB 5.5, the following schema changes must be\nmade:\n \nALTER TABLE mysql.user MODIFY User CHAR(80) BINARY NOT NULL\nDEFAULT \'\';\n \nALTER TABLE mysql.db MODIFY User CHAR(80) BINARY NOT NULL\nDEFAULT \'\';\n \nALTER TABLE mysql.tables_priv MODIFY User CHAR(80) BINARY\nNOT NULL DEFAULT \'\';\n \nALTER TABLE mysql.columns_priv MODIFY User CHAR(80) BINARY\nNOT NULL DEFAULT \'\';\n \nALTER TABLE mysql.procs_priv MODIFY User CHAR(80) BINARY NOT\nNULL DEFAULT \'\';\n \nALTER TABLE mysql.proc MODIFY definer CHAR(141) COLLATE\nutf8_bin NOT NULL DEFAULT \'\';\n \nALTER TABLE mysql.event MODIFY definer CHAR(141) COLLATE\nutf8_bin NOT NULL DEFAULT \'\';\n \nALTER TABLE mysql.proxies_priv MODIFY User CHAR(80) COLLATE\nutf8_bin NOT NULL DEFAULT \'\';\n \nALTER TABLE mysql.proxies_priv MODIFY Proxied_user CHAR(80)\nCOLLATE utf8_bin NOT NULL DEFAULT \'\';\n \nALTER TABLE mysql.proxies_priv MODIFY Grantor CHAR(141)\nCOLLATE utf8_bin NOT NULL DEFAULT \'\';\n \nALTER TABLE mysql.servers MODIFY Username CHAR(80) NOT NULL\nDEFAULT \'\';\n \nALTER TABLE mysql.procs_priv MODIFY Grantor CHAR(141)\nCOLLATE utf8_bin NOT NULL DEFAULT \'\';\n \nALTER TABLE mysql.tables_priv MODIFY Grantor CHAR(141)\nCOLLATE utf8_bin NOT NULL DEFAULT \'\';\n \nFLUSH PRIVILEGES;\n \nAnonymous Accounts\n \nAnonymous accounts are accounts where the user name portion\nof the account name is empty. These accounts act as special\ncatch-all accounts. If a user attempts to log into the\nsystem from a host, and an anonymous account exists with a\nhost name portion that matches the user\'s host, then the\nuser will log in as the anonymous account if there is no\nmore specific account match for the user name that the user\nentered.\n \nFor example, here are some anonymous accounts:\n \nCREATE USER \'\'@\'localhost\';\n \nCREATE USER \'\'@\'192.168.0.3\';\n \nFixing a Legacy Default Anonymous Account\n \nOn some systems, the mysql.db table has some entries for the\n\'\'@\'%\' anonymous account by default. Unfortunately,\nthere is no matching entry in the mysql.user table, which\nmeans that this anonymous account doesn\'t exactly exist,\nbut it does have privileges--usually on the default test\ndatabase created by mysql_install_db. These account-less\nprivileges are a legacy that is leftover from a time when\nMySQL\'s privilege system was less advanced.\n \nThis situation means that you will run into errors if you\ntry to create a \'\'@\'%\' account. For example:\n \nCREATE USER \'\'@\'%\';\n \nERROR 1396 (HY000): Operation CREATE USER failed for\n\'\'@\'%\'\n \nThe fix is to DELETE the row in the mysql.db table and then\nexecute FLUSH PRIVILEGES:\n \nDELETE FROM mysql.db WHERE User=\'\' AND Host=\'%\';\n \nFLUSH PRIVILEGES;\n \nAnd then the account can be created:\n \nCREATE USER \'\'@\'%\';\n \nQuery OK, 0 rows affected (0.01 sec)\n \nSee MDEV-13486 for more information.\n \nPassword Expiry\n \nBesides automatic password expiry, as determined by\ndefault_password_lifetime, password expiry times can be set\non an individual user basis, overriding the global setting,\nfor example:\n \nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL\n120 DAY;\n \nSee User Password Expiry for more details.\n \nAccount Locking\n \nAccount locking permits privileged administrators to\nlock/unlock user accounts. No new client connections will be\npermitted if an account is locked (existing connections are\nnot affected). For example:\n \nCREATE USER \'marijn\'@\'localhost\' ACCOUNT LOCK;\n \nSee Account Locking','','https://mariadb.com/kb/en/library/create-user/');
-update help_topic set description = CONCAT(description, ' for more details.\n \n\n\nURL: https://mariadb.com/kb/en/library/create-user/') WHERE help_topic_id = 118;
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (119,10,'ALTER USER','The ALTER USER statement was introduced in MariaDB 10.2.0.\n \nSyntax\n------ \nALTER USER [IF EXISTS] \n user_specification [,user_specification] ...\n [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]\n [WITH resource_option [resource_option] ...]\n [password_option | lock_option] \n \nuser_specification:\n username [authentication_option]\n \nauthentication_option:\n IDENTIFIED BY \'password\' \n | IDENTIFIED BY PASSWORD \'password_hash\'\n | IDENTIFIED {VIA|WITH} authentication_plugin\n | IDENTIFIED {VIA|WITH} authentication_plugin {USING|AS}\n\'authentication_string\'\n | IDENTIFIED {VIA|WITH} authentication_plugin {USING|AS}\nPASSWORD(\'password\')\n \ntls_option\n SSL \n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n \nresource_option\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n | MAX_STATEMENT_TIME time\n \npassword_option:\n PASSWORD EXPIRE\n | PASSWORD EXPIRE DEFAULT\n | PASSWORD EXPIRE NEVER\n | PASSWORD EXPIRE INTERVAL N DAY\n \nlock_option:\n ACCOUNT LOCK\n | ACCOUNT UNLOCK\n}\n \nDescription\n----------- \nThe ALTER USER statement modifies existing MariaDB accounts.\nTo use it, you must have the global CREATE USER privilege or\nthe UPDATE privilege for the mysql database. The global\nSUPER privilege is also required if the read_only system\nvariable is enabled.\n \nIf any of the specified user accounts do not yet exist, an\nerror results. If an error occurs, ALTER USER will still\nmodify the accounts that do not result in an error. Only one\nerror is produced for all users which have not been\nmodified.\n \nIF EXISTS\n \nWhen the IF EXISTS clause is used, MariaDB will return a\nwarning instead of an error for each specified user that\ndoes not exist.\n \nAccount Names\n \nFor ALTER USER statements, account names are specified as\nthe username argument in the same way as they are for CREATE\nUSER statements. See account names from the CREATE USER page\nfor details on how account names are specified.\n \nCURRENT_USER or CURRENT_USER() can also be used to alter the\naccount logged into the current session. For example, to\nchange the current user\'s password to mariadb:\n \nALTER USER CURRENT_USER() IDENTIFIED BY \'mariadb\';\n \nAuthentication Options\n \nIDENTIFIED BY \'password\'\n \nThe optional IDENTIFIED BY clause can be used to provide an\naccount with a password. The password should be specified in\nplain text. It will be hashed by the PASSWORD function prior\nto being stored to the mysql.user table.\n \nFor example, if our password is mariadb, then we can set the\naccount\'s password with:\n \nALTER USER foo2@test IDENTIFIED BY \'mariadb\';\n \nIf you do not specify a password with the IDENTIFIED BY\nclause, the user\nwill be able to connect without a password. A blank password\nis not a wildcard\nto match any password. The user must connect without\nproviding a password if no\npassword is set.\n \nThe only authentication plugins that this clause supports\nare mysql_native_password and mysql_old_password.\n \nIDENTIFIED BY PASSWORD \'password_hash\'\n \nThe optional IDENTIFIED BY PASSWORD clause can be used to\nprovide an account with a password that has already been\nhashed. The password should be specified as a hash that was\nprovided by the PASSWORD function. It will be stored to the\nmysql.user table as-is.\n \nFor example, if our password is mariadb, then we can find\nthe hash with:\n \nSELECT PASSWORD(\'mariadb\');\n+-------------------------------------------+\n| PASSWORD(\'mariadb\') |\n+-------------------------------------------+\n| *54958E764CE10E50764C2EECBB71D01F08549980 |\n+-------------------------------------------+\n1 row in set (0.00 sec)\n \nAnd then we can set an account\'s password with the hash:\n \nALTER USER foo2@test IDENTIFIED BY PASSWORD\n\'*54958E764CE10E50764C2EECBB71D01F08549980\';\n \nIf you do not specify a password with the IDENTIFIED BY\nclause, the user\nwill be able to connect without a password. A blank password\nis not a wildcard\nto match any password. The user must connect without\nproviding a password if no\npassword is set.\n \nThe only authentication plugins that this clause supports\nare mysql_native_password and mysql_old_password.\n \nIDENTIFIED {VIA|WITH} authentication_plugin\n \nThe optional IDENTIFIED VIA authentication_plugin allows you\nto specify that the account should be authenticated by a\nspecific authentication plugin. The plugin name must be an\nactive authentication plugin as per SHOW PLUGINS. If it\ndoesn\'t show up in that output, then you will need to\ninstall it with INSTALL PLUGIN or INSTALL SONAME.\n \nFor example, this could be used with the PAM authentication\nplugin:\n \nALTER USER foo2@test IDENTIFIED VIA pam;\n \nSome authentication plugins allow additional arguments to be\nspecified after a USING or AS keyword. For example, the PAM\nauthentication plugin accepts a service name:\n \nALTER USER foo2@test IDENTIFIED VIA pam USING \'mariadb\';\n \nThe exact meaning of the additional argument would depend on\nthe specific authentication plugin.\n \nIn MariaDB 10.4 and later, the USING or AS keyword can also\nbe used to provide a plain-text password to a plugin if\nit\'s provided as an argument to the PASSWORD() function.\nThis is only valid for authentication plugins that have\nimplemented a hook for the PASSWORD() function. For example,\nthe ed25519 authentication plugin supports this:\n \nALTER USER safe@\'%\' IDENTIFIED VIA ed25519 USING\nPASSWORD(\'secret\');\n \nTLS Options\n \nBy default, MariaDB transmits data between the server and\nclients without encrypting it. This is generally acceptable\nwhen the server and client run on the same host or in\nnetworks where security is guaranteed through other means.\nHowever, in cases where the server and client exist on\nseparate networks or they are in a high-risk network, the\nlack of encryption does introduce security concerns as a\nmalicious actor could potentially eavesdrop on the traffic\nas it is sent over the network between them.\n \nTo mitigate this concern, MariaDB allows you to encrypt data\nin transit between the server and clients using the\nTransport Layer Security (TLS) protocol. TLS was formerly\nknown as Secure Socket Layer (SSL), but strictly speaking\nthe SSL protocol is a predecessor to TLS and, that version\nof the protocol is now considered insecure. The\ndocumentation still uses the term SSL often and for\ncompatibility reasons TLS-related server system and status\nvariables still use the prefix ssl_, but internally, MariaDB\nonly supports its secure successors.\n \nSee Secure Connections Overview for more information about\nhow to determine whether your MariaDB server has TLS\nsupport.\n \nYou can set certain TLS-related restrictions for specific\nuser accounts. For instance, you might use this with user\naccounts that require access to sensitive data while sending\nit across networks that you do not control. These\nrestrictions can be enabled for a user account with the\nCREATE USER, ALTER USER, or GRANT statements. The following\noptions are available:\n \nOption | Description | \n \nREQUIRE NONE | TLS is not required for this account, but can\nstill be used. | \n \nREQUIRE SSL | The account must use TLS, but no valid X509\ncertificate is required. This option cannot be combined with\nother TLS options. | \n \nREQUIRE X509 | The account must use TLS and must have a\nvalid X509 certificate. This option implies REQUIRE SSL.\nThis option cannot be combined with other TLS options. | \n \nREQUIRE ISSUER \'issuer\' | The account must use TLS and\nmust have a valid X509 certificate. Also, the Certificate\nAuthority must be the one specified via the string issuer.\nThis option implies REQUIRE X509. This option can be\ncombined with the SUBJECT, and CIPHER options in any order.\n| \n \nREQUIRE SUBJECT \'subject\' | The account must use TLS and\nmust have a valid X509 certificate. Also, the certificate\'s\nSubject must be the one specified via the string subject.\nThis option implies REQUIRE X509. This option can be\ncombined with the ISSUER, and CIPHER options in any order. |\n\n \nREQUIRE CIPHER \'cipher\' | The account must use TLS, but no\nvalid X509 certificate is required. Also, the encryption\nused for the connection must use one of the methods\nspecified in the string cipher. This option implies REQUIRE\nSSL. This option can be combined with the ISSUER, and\nSUBJECT options in any order. | \n \nThe REQUIRE keyword must be used only once for all specified\noptions, and the AND keyword can be used to separate\nindividual options, but it is not required.\n \nFor example, you can alter a user account to require these\nTLS options with the following:\n \nALTER USER \'alice\'@\'%\'\n REQUIRE SUBJECT \'/CN=alice/O=My Dom,\nInc./C=US/ST=Oregon/L=Portland\'\n AND ISSUER \'/C=FI/ST=Somewhere/L=City/ O=Some\nCompany/CN=Peter Parker/emailAddress=p.parker@marvel.com\'\n AND CIPHER \'TLSv1.2\';\n \nIf any of these options are set for a specific user account,\nthen any client who tries to connect with that user account\nwill have to be configured to connect with TLS.\n \nSee Securing Connections for Client and Server for\ninformation on how to enable TLS on the client and server.\n \nResource Limit Options\n \nMariaDB 10.2.0 introduced a number of resource limit\noptions.\n \nIt is possible to set per-account limits for certain server\nresources. The following table shows the values that can be\nset per account:\n \nLimit Type | Decription | \n \nMAX_QUERIES_PER_HOUR | Number of statements that the account\ncan issue per hour (including updates) | \n \nMAX_UPDATES_PER_HOUR | Number of updates (not queries) that\nthe account can issue per hour | \n \nMAX_CONNECTIONS_PER_HOUR | Number of connections that the\naccount can start per hour | \n \nMAX_USER_CONNECTIONS | Number of simultaneous connections\nthat can be accepted from the same account; if it is 0,\nmax_connections will be used instead; if max_connections is\n0, there is no limit for this account\'s simultaneous\nconnections. | \n \nMAX_STATEMENT_TIME | Timeout, in seconds, for statements\nexecuted by the user. See also Aborting Statements that\nExceed a Certain Time to Execute. | \n \nIf any of these limits are set to 0, then there is no limit\nfor that resource for that user.\n \nHere is an example showing how to set an account\'s resource\nlimits:\n \nALTER USER \'someone\'@\'localhost\' WITH\n MAX_USER_CONNECTIONS 10\n MAX_QUERIES_PER_HOUR 200;\n \nThe resources are tracked per account, which means\n\'user\'@\'server\'; not per user name or per connection.\n \nThe count can be reset for all users using FLUSH\nUSER_RESOURCES, FLUSH PRIVILEGES or mysqladmin reload.\n \nPer account resource limits are stored in the user table, in\nthe mysql database. Columns used for resources limits are\nnamed max_questions, max_updates, max_connections (for\nMAX_CONNECTIONS_PER_HOUR), and max_user_connections (for\nMAX_USER_CONNECTIONS).\n \nPassword Expiry\n \nBesides automatic password expiry, as determined by\ndefault_password_lifetime, password expiry times can be set\non an individual user basis, overriding the global setting,\nfor example:\n \nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL\n120 DAY;\n \nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE NEVER;\n \nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n \nSee User Password Expiry for more details.\n \nAccount Locking\n \nAccount locking permits privileged administrators to\nlock/unlock user accounts. No new client connections will be\npermitted if an account is locked (existing connections are\nnot affected). For example:\n \nALTER USER \'marijn\'@\'localhost\' ACCOUNT LOCK;\n \nSee Account Locking for more details.\n \n\n\nURL: https://mariadb.com/kb/en/library/alter-user/','','https://mariadb.com/kb/en/library/alter-user/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (120,10,'DROP USER','Syntax\n------ \nDROP USER [IF EXISTS] user_name [, user_name] ...\n \nDescription\n----------- \nThe DROP USER statement removes one or more MariaDB\naccounts. It removes\nprivilege rows for the account from all grant tables. To use\nthis statement,\nyou must have the global CREATE USER privilege\nor the DELETE privilege for the mysql database.\nEach account is named using the same format as for the\nCREATE USER\nstatement; for example, \'jeffrey\'@\'localhost\'. If you\nspecify\nonly the user name part of the account name, a host name\npart of \'%\' is\nused. For additional information about specifying account\nnames, see\nCREATE USER.\n \nNote that, if you specify an account that is currently\nconnected, it will not\nbe deleted until the connection is closed. The connection\nwill not be\nautomatically closed.\n \nIf any of the specified user accounts do not exist, ERROR\n1396 (HY000)\nresults. If an error occurs, DROP USER will still drop the\naccounts that do\nnot result in an error. Only one error is produced for all\nusers which have not\nbeen dropped:\n \nERROR 1396 (HY000): Operation DROP USER failed for\n\'u1\'@\'%\',\'u2\'@\'%\'\n \nFailed CREATE or DROP operations, for both users and roles,\nproduce the\nsame error code.\n \nIF EXISTS\n \nThe IF EXISTS clause was added in MariaDB 10.1.3\n \nIf the IF EXISTS clause is used, MariaDB will return a note\ninstead of an error if the user does not exist.\n \nExamples\n-------- \nDROP USER bob;\n \nIF EXISTS:\n \nDROP USER bob;\n \nERROR 1396 (HY000): Operation DROP USER failed for\n\'bob\'@\'%\'\n \nDROP USER IF EXISTS bob;\n \nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n \nSHOW WARNINGS;\n \n+-------+------+---------------------------------------------+\n| Level | Code | Message |\n+-------+------+---------------------------------------------+\n| Note | 1974 | Can\'t drop user \'bob\'@\'%\'; it doesn\'t\nexist |\n+-------+------+---------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/drop-user/','','https://mariadb.com/kb/en/library/drop-user/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (121,10,'GRANT','Syntax\n------ \nGRANT\n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n TO user_specification [ user_options ...]\n \nuser_specification:\n username [authentication_option]\n \nauthentication_option:\n IDENTIFIED BY \'password\' \n | IDENTIFIED BY PASSWORD \'password_hash\'\n | IDENTIFIED {VIA|WITH} authentication_rule [OR\nauthentication_rule ...]\n \nauthentication_rule:\n authentication_plugin\n | authentication_plugin {USING|AS}\n\'authentication_string\'\n | authentication_plugin {USING|AS} PASSWORD(\'password\')\n \nGRANT PROXY ON username\n TO username [, username] ...\n [WITH GRANT OPTION]\n \nuser_options:\n [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]\n [WITH with_option [with_option] ...]\n \nobject_type:\n TABLE\n | FUNCTION\n | PROCEDURE\n \npriv_level:\n *\n | *.*\n | db_name.*\n | db_name.tbl_name\n | tbl_name\n | db_name.routine_name\n \nwith_option:\n GRANT OPTION\n | resource_option\n \nresource_option:\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n | MAX_STATEMENT_TIME time\n \ntls_option:\n SSL \n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n \nDescription\n----------- \nThe GRANT statement allows you to grant privileges or roles\nto accounts. To use GRANT, you must have the GRANT OPTION\nprivilege, and you must have the privileges that you are\ngranting.\n \nUse the REVOKE statement to revoke privileges granted with\nthe GRANT statement.\n \nUse the SHOW GRANTS statement to determine what privileges\nan account has.\n \nAccount Names\n \nFor GRANT statements, account names are specified as the\nusername argument in the same way as they are for CREATE\nUSER statements. See account names from the CREATE USER page\nfor details on how account names are specified.\n \nImplicit Account Creation\n \nThe GRANT statement also allows you to implicitly create\naccounts in some cases.\n \nIf the account does not yet exist, then GRANT can implicitly\ncreate it. To implicitly create an account with GRANT, a\nuser is required to have the same privileges that would be\nrequired to explicitly create the account with the CREATE\nUSER statement.\n \nIf the NO_AUTO_CREATE_USER SQL_MODE is set, then accounts\ncan only be created if authentication information is\nspecified, or with a CREATE USER statement. If no\nauthentication information is provided, GRANT will produce\nan error when the specified account does not exist, for\nexample:\n \nshow variables like \'%sql_mode%\' ;\n+---------------+--------------------------------------------+\n| Variable_name | Value |\n+---------------+--------------------------------------------+\n| sql_mode | NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |\n+---------------+--------------------------------------------+\n \nGRANT USAGE ON *.* TO \'user123\'@\'%\' IDENTIFIED BY \'\';\nERROR 1133 (28000): Can\'t find any matching row in the user\ntable\n \nGRANT USAGE ON *.* TO \'user123\'@\'%\' IDENTIFIED VIA PAM\nusing \'mariadb\' require ssl ;\nQuery OK, 0 rows affected (0.00 sec)\n \nselect host, user from mysql.user where user=\'user123\' ;\n \n+------+----------+\n| host | user |\n+------+----------+\n| % | user123 |\n+------+----------+\n \nPrivilege Levels\n \nPrivileges can be set globally, for an entire database, for\na table or routine,\nor for individual columns in a table. Certain privileges can\nonly be set at\ncertain levels.\nGlobal privileges are granted using *.* for\npriv_level. Global privileges include privileges to\nadminister the database\nand manage user accounts, as well as privileges for all\ntables, functions, and\nprocedures. Global privileges are stored in the mysql.user\ntable.\nDatabase privileges are granted using db_name.*\nfor priv_level, or using just * to use default database.\nDatabase\nprivileges include privileges to create tables and\nfunctions, as well as\nprivileges for all tables, functions, and procedures in the\ndatabase. Database privileges are stored in the mysql.db\ntable.\nTable privileges are granted using db_name.tbl_name\nfor priv_level, or using just tbl_name to specify a table in\nthe default\ndatabase. The TABLE keyword is optional. Table privileges\ninclude the\nability to select and change data in the table. Certain\ntable privileges can\nbe granted for individual columns.\nColumn privileges are granted by specifying a table for\npriv_level and providing a column list after the privilege\ntype. They allow\nyou to control exactly which columns in a table users can\nselect and change.\nFunction privileges are granted using FUNCTION\ndb_name.routine_name\nfor priv_level, or using just FUNCTION routine_name to\nspecify a function\nin the default database.\nProcedure privileges are granted using PROCEDURE\ndb_name.routine_name\nfor priv_level, or using just PROCEDURE routine_name to\nspecify a procedure\nin the default database.\n \nThe USAGE Privilege\n \nThe USAGE privilege grants no real privileges. The SHOW\nGRANTS\nstatement will show a global USAGE privilege for a\nnewly-created user. You\ncan use USAGE with the GRANT statement to change options\nlike GRANT OPTION\nand MAX_USER_CONNECTIONS without changing any account\nprivileges.\n \nThe ALL PRIVILEGES Privilege\n \nThe ALL PRIVILEGES privilege grants all available\nprivileges. Granting all\nprivileges only affects the given privilege level. For\nexample, granting all\nprivileges on a table does not grant any privileges on the\ndatabase or globally.\n \nUsing ALL PRIVILEGES does not grant the special GRANT OPTION\nprivilege.\n \nYou can use ALL instead of ALL PRIVILEGES.\n \nThe GRANT OPTION Privilege\n \nUse the WITH GRANT OPTION clause to give users the ability\nto grant privileges\nto other users at the given privilege level. Users with the\nGRANT OPTION privilege can\nonly grant privileges they have. They cannot grant\nprivileges at a higher privilege level than\nthey have the GRANT OPTION privilege.\n \nThe GRANT OPTION privilege cannot be set for individual\ncolumns.\nIf you use WITH GRANT OPTION when specifying column\nprivileges,\nthe GRANT OPTION privilege will be granted for the entire\ntable.\n \nUsing the WITH GRANT OPTION clause is equivalent to listing\nGRANT OPTION\nas a privilege.\n \nGlobal Privileges\n \nThe following table lists the privileges that can be granted\nglobally. You can\nalso grant all database, table, and function privileges\nglobally. When granted\nglobally, these privileges apply to all databases, tables,\nor functions,\nincluding those created later.\n \nTo set a global privilege, use *.* for priv_level.\n \nPrivilege | Description | \n \nCREATE USER | Create a user using the CREATE USER statement,\nor implicitly create a user with the GRANT statement. | \n \nFILE | Read and write files on the server, using statements\nlike LOAD DATA INFILE or functions like LOAD_FILE(). Also\nneeded to create CONNECT outward tables. MariaDB server must\nhave the permissions to access those files. | \n \nGRANT OPTION | Grant global privileges. You can only grant\nprivileges that you have. | \n \nPROCESS | Show information about the active processes, via\nSHOW PROCESSLIST or mysqladmin processlist. | \n \nRELOAD | Execute FLUSH statements or equivalent mysqladmin\ncommands. | \n \nREPLICATION CLIENT | Execute SHOW MASTER STATUS and SHOW\nSLAVE STATUS informative statements. | \n \nREPLICATION SLAVE | Accounts used by slave servers on the\nmaster need this privilege. This is needed to get the\nupdates made on the master. | \n \nSHOW DATABASES | List all databases using the SHOW DATABASES\nstatement. Without the SHOW DATABASES privilege, you can\nstill issue the SHOW DATABASES statement, but it will only\nlist databases containing tables on which you have\nprivileges. | \n \nSHUTDOWN | Shut down the server using SHUTDOWN or the\nmysqladmin shutdown command. | \n \nSUPER | Execute superuser statements: CHANGE MASTER TO, KILL\n(users who do not have this privilege can only KILL their\nown threads), PURGE LOGS, SET global system variables, or\nthe mysqladmin debug command. Also, this permission allows\nthe user to write data even if the read_only startup option\nis set, enable or disable logging, enable or disable\nreplication on slaves, specify a DEFINER for statements that\nsupport that clause, connect once after reaching the\nMAX_CONNECTIONS. If a statement has been specified for the\ninit-connect mysqld option, that command will not be\nexecuted when a user with SUPER privileges connects to the\nserver. | \n \nDatabase Privileges\n \nThe following table lists the privileges that can be granted\nat the database\nlevel. You can also grant all table and function privileges\nat the database\nlevel. Table and function privileges on a database apply to\nall tables or\nfunctions in that database, including those created later.\n \nTo set a privilege for a database, specify the database\nusing\ndb_name.* for priv_level, or just use *\nto specify the default database.\n \nPrivilege | Description | \n \nCREATE | Create a database using the CREATE DATABASE\nstatement, when the privilege is granted for a database. You\ncan grant the CREATE privilege on databases that do not yet\nexist. This also grants the CREATE privilege on all tables\nin the database. | \n \nCREATE ROUTINE | Create Stored Programs using the CREATE\nPROCEDURE and CREATE FUNCTION statements. | \n \nCREATE TEMPORARY TABLES | Create temporary tables with the\nCREATE TEMPORARY TABLE statement. This privilege enable\nwriting and dropping those temporary tables | \n \nDROP | Drop a database using the DROP DATABASE statement,\nwhen the privilege is granted for a database. This also\ngrants the DROP privilege on all tables in the database. | \n \nEVENT | Create, drop and alter EVENTs. Added in MySQL 5.1.6.\n| \n \nGRANT OPTION | Grant database privileges. You can only grant\nprivileges that you have. | \n \nLOCK TABLES | Acquire explicit locks using the LOCK TABLES\nstatement; you also need to have the SELECT privilege on a\ntable, in order to lock it. | \n \nTable Privileges\n \nPrivilege | Description | \n \nALTER | Change the structure of an existing table using the\nALTER TABLE statement. | \n \nCREATE | Create a table using the CREATE TABLE statement.\nYou can grant the CREATE privilege on tables that do not yet\nexist. | \n \nCREATE VIEW | Create a view using the CREATE_VIEW statement.\n| \n \nDELETE | Remove rows from a table using the DELETE\nstatement. | \n \nDELETE HISTORY | Remove historical rows from a table using\nthe DELETE HISTORY statement. Displays as DELETE VERSIONING\nROWS when running SHOW GRANTS (MDEV-17655). From MariaDB\n10.3.4. From MariaDB 10.3.5, if a user has the SUPER\nprivilege but not this privilege, running mysql_upgrade will\ngrant this privilege as well. | \n \nDROP | Drop a table using the DROP TABLE statement or a view\nusing the DROP VIEW statement. Also required to execute the\nTRUNCATE TABLE statement. | \n \nGRANT OPTION | Grant table privileges. You can only grant\nprivileges that you have. | \n \nINDEX | Create an index on a table using the CREATE INDEX\nstatement. Without the INDEX privilege, you can still create\nindexes when creating a table using the CREATE TABLE\nstatement if the you have the CREATE privilege, and you can\ncreate indexes using the ALTER TABLE statement if you have\nthe ALTER privilege. | \n \nINSERT | Add rows to a table using the INSERT statement. The\nINSERT privilege can also be set on individual columns; see\nColumn Privileges below for details. | \n \nREFERENCES | Unused. | \n \nSELECT | Read data from a table using the SELECT statement.\nThe SELECT privilege can also be set on individual columns;\nsee Column Privileges below for details. | \n \nSHOW VIEW | Show the CREATE VIEW statement to create a view\nusing the SHOW CREATE VIEW statement. | \n \nTRIGGER | Execute triggers associated to tables you update,\nexecute the CREATE TRIGGER and DROP TRIGGER statements. You\nwill still be able to see triggers. | \n \nUPDATE | Update existing rows in a table using the UPDATE\nstatement. UPDATE statements usually include a WHERE clause\nto update only certain rows. You must have SELECT privileges\non the table or the appropriate columns for the WHERE\nclause. The UPDATE privilege can also be set on individual\ncolumns; see Column Privileges below for details. | \n \nColumn Privileges\n \nSome table privileges can be set for individual columns of a\ntable. To use\ncolumn privileges, specify the table explicitly and provide\na list of column\nnames after the privilege type. For example, the following\nstatement would allow\nthe user to read the names and positions of employees, but\nnot other information\nfrom the same table, such as salaries.\n \nGRANT SELECT (name, position) on Employee to\n\'jeffrey\'@\'localhost\';\n \nPrivilege | Description | \n \nINSERT (column_list) | Add rows specifying values in columns\nusing the INSERT statement. If you only have column-level\nINSERT privileges, you must specify the columns you are\nsetting in the INSERT statement. All other columns will be\nset to their default values, or NULL. | \n \nREFERENCES (column_list) | Unused. | \n \nSELECT (column_list) | Read values in columns using the\nSELECT statement. You cannot access or query any columns for\nwhich you do not have SELECT privileges, including in WHERE,\nON, GROUP BY, and ORDER BY clauses. | \n \nUPDATE (column_list) | Update values in columns of existing\nrows using the UPDATE statement. UPDATE statements usually\ninclude a WHERE clause to update only certain rows. You must\nhave SELECT privileges on the table or the appropriate\ncolumns for the WHERE clause. | \n \nFunction Privileges\n \nPrivilege | Description | \n \nALTER ROUTINE | Change the characteristics of a stored\nfunction using the ALTER FUNCTION statement. | \n \nEXECUTE | Use a stored function. You need SELECT privileges\nfor any tables or columns accessed by the function. | \n \nGRANT OPTION | Grant function privileges. You can only grant\nprivileges that you have. | \n \nProcedure Privileges\n \nPrivilege | Description | \n \nALTER ROUTINE | Change the characteristics of a stored\nprocedure using the ALTER PROCEDURE statement. | \n \nEXECUTE | Execute a stored procedure using the CALL\nstatement. The privilege to call a procedure may allow you\nto perform actions you wouldn\'t otherwise be able to do,\nsuch as insert rows into a table. | \n \nGRANT OPTION | Grant procedure privileges. You can only\ngrant privileges that you have. | \n \nProxy Privileges\n \nPrivilege | Description | \n \nPROXY | Permits one user to be a proxy for another. | \n \nThe PROXY privilege allows one user to proxy as another\nuser, which means their privileges change to that of the\nproxy user, and the CURRENT_USER() function returns the user\nname of the proxy user.\n \nThe PROXY privilege only works with authentication plugins\nthat support it. The default mysql_native_password\nauthentication plugin does not support proxy users.\n \nThe pam authentication plugin is the only plugin included\nwith MariaDB that currently supports proxy users. The PROXY\nprivilege is commonly used with the pam authentication\nplugin to enable user and group mapping with PAM.\n \nFor example, to grant the PROXY privilege to an anonymous\naccount that authenticates with the pam authentication\nplugin, you could execute the following:\n \nCREATE USER \'dba\'@\'%\' IDENTIFIED BY \'strongpassword\';\n \nGRANT ALL PRIVILEGES ON *.* TO \'dba\'@\'%\' ;\n \nCREATE USER \'\'@\'%\' IDENTIFIED VIA pam USING \'mariadb\';\n \nGRANT PROXY ON \'dba\'@\'%\' TO \'\'@\'%\';\n \nA user account can only grant the PROXY privilege for a\nspecific user account if the granter also has the PROXY\nprivilege for that specific user account, and if that\nprivilege is defined WITH GRANT OPTION. For example, the\nfollowing example fails because the granter does not have\nthe PROXY privilege for that specific user account at all:\n \nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER() | CURRENT_USER() |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n \nSHOW GRANTS;\n \n+-----------------------------------------------------------------------------------------------------------------------+\n| Grants for alice@localhost |\n+-----------------------------------------------------------------------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\'\nIDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' |\n+-----------------------------------------------------------------------------------------------------------------------+\n \nGRANT PROXY ON \'dba\'@\'localhost\' TO\n\'bob\'@\'localhost\';\n \nERROR 1698 (28000): Access denied for user\n\'alice\'@\'localhost\'\n \nAnd the following example fails because the granter does\nhave the PROXY privilege for that specific user account, but\nit is not defined WITH GRANT OPTION:\n \nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER() | CURRENT_USER() |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n \nSHOW GRANTS;\n \n+-----------------------------------------------------------------------------------------------------------------------+\n| Grants for alice@localhost |\n+-----------------------------------------------------------------------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\'\nIDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' |\n| GRANT PROXY ON \'dba\'@\'localhost\' TO\n\'alice\'@\'localhost\' |\n+-----------------------------------------------------------------------------------------------------------------------+\n \nMariaDB [(none)]> GRANT PROXY ON \'dba\'@\'localhost\' TO\n\'bob\'@\'localhost\';\n \nERROR 1698 (28000): Access denied for user\n\'alice\'@\'localhost\'\n \nBut the following example succeeds because the granter does\nhave the PROXY privilege for that specific user account, and\nit is defined WITH GRANT OPTION:\n \nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER() | CURRENT_USER() |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n \nSHOW GRANTS;\n \n+-----------------------------------------------------------------------------------------------------------------------------------------+\n| Grants for alice@localhost |\n+-----------------------------------------------------------------------------------------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\'\nIDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' WITH GRANT\nOPTION |\n| GRANT PROXY ON \'dba\'@\'localhost\' TO\n\'alice\'@\'localhost\' WITH GRANT OPTION |\n+-----------------------------------------------------------------------------------------------------------------------------------------+\n \nGRANT PROXY ON \'dba\'@\'localhost\' TO\n\'bob\'@\'localhost\';\n \nQuery OK, 0 rows affected (0.004 sec)\n \nA user account can grant the PROXY privilege for any other\nuser account if the granter has the PROXY privilege for the\n\'\'@\'%\' anonymous user account, like this:\n \nGR','','https://mariadb.com/kb/en/library/grant/');
-update help_topic set description = CONCAT(description, 'ANT PROXY ON \'\'@\'%\' TO \'dba\'@\'localhost\' WITH\nGRANT OPTION;\n \nFor example, the following example succeeds because the user\ncan grant the PROXY privilege for any other user account:\n \nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER() | CURRENT_USER() |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n \nSHOW GRANTS;\n \n+-----------------------------------------------------------------------------------------------------------------------------------------+\n| Grants for alice@localhost |\n+-----------------------------------------------------------------------------------------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\'\nIDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' WITH GRANT\nOPTION |\n| GRANT PROXY ON \'\'@\'%\' TO \'alice\'@\'localhost\' WITH\nGRANT OPTION |\n+-----------------------------------------------------------------------------------------------------------------------------------------+\n \nGRANT PROXY ON \'app1_dba\'@\'localhost\' TO\n\'bob\'@\'localhost\';\n \nQuery OK, 0 rows affected (0.004 sec)\n \nGRANT PROXY ON \'app2_dba\'@\'localhost\' TO\n\'carol\'@\'localhost\';\n \nQuery OK, 0 rows affected (0.004 sec)\n \nThe default root user accounts created by mysql_install_db\nhave this privilege. For example:\n \nGRANT ALL PRIVILEGES ON *.* TO \'root\'@\'localhost\' WITH\nGRANT OPTION;\n \nGRANT PROXY ON \'\'@\'%\' TO \'root\'@\'localhost\' WITH\nGRANT OPTION;\n \nThis allows the default root user accounts to grant the\nPROXY privilege for any other user account, and it also\nallows the default root user accounts to grant others the\nprivilege to do the same.\n \nAuthentication Options\n \nThe authentication options for the GRANT statement are the\nsame as those for the CREATE USER statement.\n \nIDENTIFIED BY \'password\'\n \nThe optional IDENTIFIED BY clause can be used to provide an\naccount with a password. The password should be specified in\nplain text. It will be hashed by the PASSWORD function prior\nto being stored to the mysql.user table.\n \nFor example, if our password is mariadb, then we can create\nthe user with:\n \nGRANT USAGE ON *.* TO foo2@test IDENTIFIED BY \'mariadb\';\n \nIf you do not specify a password with the IDENTIFIED BY\nclause, the user\nwill be able to connect without a password. A blank password\nis not a wildcard\nto match any password. The user must connect without\nproviding a password if no\npassword is set.\n \nIf the user account already exists and if you provide the\nIDENTIFIED BY clause, then the user\'s password will be\nchanged. You must have the privileges needed for the SET\nPASSWORD\nstatement to change a user\'s password with GRANT.\n \nThe only authentication plugins that this clause supports\nare mysql_native_password and mysql_old_password.\n \nIDENTIFIED BY PASSWORD \'password_hash\'\n \nThe optional IDENTIFIED BY PASSWORD clause can be used to\nprovide an account with a password that has already been\nhashed. The password should be specified as a hash that was\nprovided by the PASSWORD function. It will be stored to the\nmysql.user table as-is.\n \nFor example, if our password is mariadb, then we can find\nthe hash with:\n \nSELECT PASSWORD(\'mariadb\');\n+-------------------------------------------+\n| PASSWORD(\'mariadb\') |\n+-------------------------------------------+\n| *54958E764CE10E50764C2EECBB71D01F08549980 |\n+-------------------------------------------+\n1 row in set (0.00 sec)\n \nAnd then we can create a user with the hash:\n \nGRANT USAGE ON *.* TO foo2@test IDENTIFIED BY PASSWORD\n\'*54958E764CE10E50764C2EECBB71D01F08549980\';\n \nIf you do not specify a password with the IDENTIFIED BY\nclause, the user\nwill be able to connect without a password. A blank password\nis not a wildcard\nto match any password. The user must connect without\nproviding a password if no\npassword is set.\n \nIf the user account already exists and if you provide the\nIDENTIFIED BY clause, then the user\'s password will be\nchanged. You must have the privileges needed for the SET\nPASSWORD\nstatement to change a user\'s password with GRANT.\n \nThe only authentication plugins that this clause supports\nare mysql_native_password and mysql_old_password.\n \nIDENTIFIED {VIA|WITH} authentication_plugin\n \nThe optional IDENTIFIED VIA authentication_plugin allows you\nto specify that the account should be authenticated by a\nspecific authentication plugin. The plugin name must be an\nactive authentication plugin as per SHOW PLUGINS. If it\ndoesn\'t show up in that output, then you will need to\ninstall it with INSTALL PLUGIN or INSTALL SONAME.\n \nFor example, this could be used with the PAM authentication\nplugin:\n \nGRANT USAGE ON *.* TO foo2@test IDENTIFIED VIA pam;\n \nSome authentication plugins allow additional arguments to be\nspecified after a USING or AS keyword. For example, the PAM\nauthentication plugin accepts a service name:\n \nGRANT USAGE ON *.* TO foo2@test IDENTIFIED VIA pam USING\n\'mariadb\';\n \nThe exact meaning of the additional argument would depend on\nthe specific authentication plugin.\n \nThe USING or AS keyword can also be used to provide a\nplain-text password to a plugin if it\'s provided as an\nargument to the PASSWORD() function. This is only valid for\nauthentication plugins that have implemented a hook for the\nPASSWORD() function. For example, the ed25519 authentication\nplugin supports this:\n \nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 USING\nPASSWORD(\'secret\');\n \nOne can specify many authentication plugins, they all works\nas alternatives ways of authenticating a user:\n \nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 USING\nPASSWORD(\'secret\') OR unix_socket;\n \nResource Limit Options\n \nMariaDB 10.2.0 introduced a number of resource limit\noptions.\n \nIt is possible to set per-account limits for certain server\nresources. The following table shows the values that can be\nset per account:\n \nLimit Type | Decription | \n \nMAX_QUERIES_PER_HOUR | Number of statements that the account\ncan issue per hour (including updates) | \n \nMAX_UPDATES_PER_HOUR | Number of updates (not queries) that\nthe account can issue per hour | \n \nMAX_CONNECTIONS_PER_HOUR | Number of connections that the\naccount can start per hour | \n \nMAX_USER_CONNECTIONS | Number of simultaneous connections\nthat can be accepted from the same account; if it is 0,\nmax_connections will be used instead; if max_connections is\n0, there is no limit for this account\'s simultaneous\nconnections. | \n \nMAX_STATEMENT_TIME | Timeout, in seconds, for statements\nexecuted by the user. See also Aborting Statements that\nExceed a Certain Time to Execute. | \n \nIf any of these limits are set to 0, then there is no limit\nfor that resource for that user.\n \nTo set resource limits for an account, if you do not want to\nchange that account\'s privileges, you can issue a GRANT\nstatement with the USAGE privilege, which has no meaning.\nThe statement can name some or all limit types, in any\norder.\n \nHere is an example showing how to set resource limits:\n \nGRANT USAGE ON *.* TO \'someone\'@\'localhost\' WITH\n MAX_USER_CONNECTIONS 0\n MAX_QUERIES_PER_HOUR 200;\n \nThe resources are tracked per account, which means\n\'user\'@\'server\'; not per user name or per connection.\n \nThe count can be reset for all users using FLUSH\nUSER_RESOURCES, FLUSH PRIVILEGES or mysqladmin reload.\n \nPer account resource limits are stored in the user table, in\nthe mysql database. Columns used for resources limits are\nnamed max_questions, max_updates, max_connections (for\nMAX_CONNECTIONS_PER_HOUR), and max_user_connections (for\nMAX_USER_CONNECTIONS).\n \nTLS Options\n \nBy default, MariaDB transmits data between the server and\nclients without encrypting it. This is generally acceptable\nwhen the server and client run on the same host or in\nnetworks where security is guaranteed through other means.\nHowever, in cases where the server and client exist on\nseparate networks or they are in a high-risk network, the\nlack of encryption does introduce security concerns as a\nmalicious actor could potentially eavesdrop on the traffic\nas it is sent over the network between them.\n \nTo mitigate this concern, MariaDB allows you to encrypt data\nin transit between the server and clients using the\nTransport Layer Security (TLS) protocol. TLS was formerly\nknown as Secure Socket Layer (SSL), but strictly speaking\nthe SSL protocol is a predecessor to TLS and, that version\nof the protocol is now considered insecure. The\ndocumentation still uses the term SSL often and for\ncompatibility reasons TLS-related server system and status\nvariables still use the prefix ssl_, but internally, MariaDB\nonly supports its secure successors.\n \nSee Secure Connections Overview for more information about\nhow to determine whether your MariaDB server has TLS\nsupport.\n \nYou can set certain TLS-related restrictions for specific\nuser accounts. For instance, you might use this with user\naccounts that require access to sensitive data while sending\nit across networks that you do not control. These\nrestrictions can be enabled for a user account with the\nCREATE USER, ALTER USER, or GRANT statements. The following\noptions are available:\n \nOption | Description | \n \nREQUIRE NONE | TLS is not required for this account, but can\nstill be used. | \n \nREQUIRE SSL | The account must use TLS, but no valid X509\ncertificate is required. This option cannot be combined with\nother TLS options. | \n \nREQUIRE X509 | The account must use TLS and must have a\nvalid X509 certificate. This option implies REQUIRE SSL.\nThis option cannot be combined with other TLS options. | \n \nREQUIRE ISSUER \'issuer\' | The account must use TLS and\nmust have a valid X509 certificate. Also, the Certificate\nAuthority must be the one specified via the string issuer.\nThis option implies REQUIRE X509. This option can be\ncombined with the SUBJECT, and CIPHER options in any order.\n| \n \nREQUIRE SUBJECT \'subject\' | The account must use TLS and\nmust have a valid X509 certificate. Also, the certificate\'s\nSubject must be the one specified via the string subject.\nThis option implies REQUIRE X509. This option can be\ncombined with the ISSUER, and CIPHER options in any order. |\n\n \nREQUIRE CIPHER \'cipher\' | The account must use TLS, but no\nvalid X509 certificate is required. Also, the encryption\nused for the connection must use one of the methods\nspecified in the string cipher. This option implies REQUIRE\nSSL. This option can be combined with the ISSUER, and\nSUBJECT options in any order. | \n \nThe REQUIRE keyword must be used only once for all specified\noptions, and the AND keyword can be used to separate\nindividual options, but it is not required.\n \nFor example, you can create a user account that requires\nthese TLS options with the following:\n \nGRANT USAGE ON *.* TO \'alice\'@\'%\'\n REQUIRE SUBJECT \'/CN=alice/O=My Dom,\nInc./C=US/ST=Oregon/L=Portland\'\n AND ISSUER \'/C=FI/ST=Somewhere/L=City/ O=Some\nCompany/CN=Peter Parker/emailAddress=p.parker@marvel.com\'\n AND CIPHER \'TLSv1.2\';\n \nIf any of these options are set for a specific user account,\nthen any client who tries to connect with that user account\nwill have to be configured to connect with TLS.\n \nSee Securing Connections for Client and Server for\ninformation on how to enable TLS on the client and server.\n \nRoles\n \nRoles were introduced in MariaDB 10.0.5.\n \nSyntax\n------ \nGRANT role TO grantee [, grantee2 ... ]\n[ WITH ADMIN OPTION ]\n \nThe GRANT statement is also used to grant the use a role to\none or more users or other roles. In order to be able to\ngrant a role, the grantor doing so must have permission to\ndo so (see WITH ADMIN in the CREATE ROLE article).\n \nSpecifying the WITH ADMIN OPTION permits the grantee to in\nturn grant the role to another.\n \nFor example, the following commands show how to grant the\nsame role to a couple different users.\n \nGRANT journalist TO hulda;\n \nGRANT journalist TO berengar WITH ADMIN OPTION;\n \nIf a user has been granted a role, they do not automatically\nobtain all permissions associated with that role. These\npermissions are only in use when the user activates the role\nwith the SET ROLE statement.\n \nGrant Examples\n \nGranting Root-like Privileges\n \nYou can create a user that has privileges similar to the\ndefault root accounts by executing the following:\n \nCREATE USER \'alexander\'@\'localhost\';\n \nGRANT ALL PRIVILEGES ON *.* to \'alexander\'@\'localhost\'\nWITH GRANT OPTION;\n \n\n\nURL: https://mariadb.com/kb/en/library/grant/') WHERE help_topic_id = 121;
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (122,10,'User Password Expiry','User password expiry was introduced in MariaDB 10.4.3.\n \nPassword expiry permits administrators to expire user\npasswords, either manually or automatically. \n \nSystem Variables\n \nThere are two system variables which affect password expiry:\ndefault_password_lifetime, which determines the amount of\ntime between requiring the user to change their password. 0,\nthe default, means automatic password expiry is not active.\n \nThe second variable, disconnect_on_expired_password\ndetermines whether a client is permitted to connect if their\npassword has expired, or whether they are permitted to\nconnect in sandbox mode, able to perform a limited subset of\nqueries related to resetting the password, in particular SET\nPASSWORD and SET.\n \nSetting a Password Expiry Limit for a User\n \nBesides automatic password expiry, as determined by\ndefault_password_lifetime, password expiry times can be set\non an individual user basis, overriding the global using the\nCREATE USER or ALTER USER statements, for example:\n \nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL\n120 DAY;\n \nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL\n120 DAY;\n \nLimits can be disabled by use of the NEVER keyword, for\nexample:\n \nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE NEVER;\n \nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE NEVER;\n \nA manually set limit can be restored the system default by\nuse of DEFAULT, for example:\n \nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n \nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n \nSHOW CREATE USER\n \nThe SHOW CREATE USER statement will display information\nabout the password expiry status of the user. Unlike MySQL,\nit will not display if the user is unlocked, or if the\npassword expiry is set to default.\n \nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL\n120 DAY;\n \nCREATE USER \'konstantin\'@\'localhost\' PASSWORD EXPIRE\nNEVER;\n \nCREATE USER \'amse\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n \nSHOW CREATE USER \'monty\'@\'localhost\';\n \n+------------------------------------------------------------------+\n| CREATE USER for monty@localhost |\n+------------------------------------------------------------------+\n| CREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE\nINTERVAL 120 DAY |\n+------------------------------------------------------------------+\n \nSHOW CREATE USER \'konstantin\'@\'localhost\';\n \n+------------------------------------------------------------+\n| CREATE USER for konstantin@localhost |\n+------------------------------------------------------------+\n| CREATE USER \'konstantin\'@\'localhost\' PASSWORD EXPIRE\nNEVER |\n+------------------------------------------------------------+\n \nSHOW CREATE USER \'amse\'@\'localhost\';\n \n+--------------------------------+\n| CREATE USER for amse@localhost |\n+--------------------------------+\n| CREATE USER \'amse\'@\'localhost\' |\n+--------------------------------+\n \n--connect-expired-password Client Option\n \nThe mysql client --connect-expired-password option notifies\nthe server that the client is prepared to handle expired\npassword sandbox mode (even if the --batch option was\nspecified).\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/user-password-expiry/','','https://mariadb.com/kb/en/library/user-password-expiry/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (123,10,'RENAME USER','Syntax\n------ \nRENAME USER old_user TO new_user\n [, old_user TO new_user] ...\n \nDescription\n----------- \nThe RENAME USER statement renames existing MariaDB accounts.\nTo use it,\nyou must have the global CREATE USER privilege\nor the UPDATE privilege for the mysql database.\nEach account is named using the same format as for the\nCREATE USER\nstatement; for example, \'jeffrey\'@\'localhost\'.\nIf you specify only the user name part of the account name,\na host\nname part of \'%\' is used.\n \nIf any of the old user accounts do not exist or any of the\nnew user accounts already\nexist, ERROR 1396 (HY000) results. If an error occurs,\nRENAME USER\nwill still rename the accounts that do not result in an\nerror.\n \nExamples\n-------- \nCREATE USER \'donald\', \'mickey\';\n \nRENAME USER \'donald\' TO \'duck\'@\'localhost\', \'mickey\'\nTO \'mouse\'@\'localhost\';\n \n\n \n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/rename-user/','','https://mariadb.com/kb/en/library/rename-user/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (124,10,'REVOKE','Privileges\n \nSyntax\n------ \nREVOKE \n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n FROM user [, user] ...\n \nREVOKE ALL PRIVILEGES, GRANT OPTION\n FROM user [, user] ...\n \nDescription\n----------- \nThe REVOKE statement enables system administrators to revoke\nprivileges (or roles - see section below) from MariaDB\naccounts. Each account is named using the same format\nas for the GRANT statement; for example,\n\'jeffrey\'@\'localhost\'. If you specify only the user name\npart\nof the account name, a host name part of \'%\' is used. For\ndetails on the levels at which privileges exist, the\nallowable\npriv_type and priv_level values, and the\nsyntax for specifying users and passwords, see GRANT.\n \nTo use the first REVOKE syntax, you must have the\nGRANT OPTION privilege, and you must have the privileges\nthat\nyou are revoking.\n \nTo revoke all privileges, use the second syntax, which drops\nall\nglobal, database, table, column, and routine privileges for\nthe named\nuser or users:\n \nREVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...\n \nTo use this REVOKE syntax, you must have the global\nCREATE USER privilege or the\nUPDATE privilege for the mysql database. See\nGRANT.\n \nExamples\n-------- \nREVOKE SUPER ON *.* FROM \'alexander\'@\'localhost\';\n \nRoles\n \nRoles were introduced in MariaDB 10.0.5.\n \nSyntax\n------ \nREVOKE role [, role ...]\n FROM grantee [, grantee2 ... ]\n \nDescription\n----------- \nREVOKE is also used to remove a role from a user or another\nrole that it\'s previously been assigned to. If a role has\npreviously been set as a default role, REVOKE does not\nremove the record of the default role from the mysql.user\ntable. If the role is subsequently granted again, it will\nagain be the user\'s default. Use SET DEFAULT ROLE NONE to\nexplicitly remove this.\n \nBefore MariaDB 10.1.13, the REVOKE role statement was not\npermitted in prepared statements.\n \nExample\n \nREVOKE journalist FROM hulda\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/revoke/','','https://mariadb.com/kb/en/library/revoke/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (125,10,'SET PASSWORD','Syntax\n------ \nSET PASSWORD [FOR user] =\n {\n PASSWORD(\'some password\')\n | OLD_PASSWORD(\'some password\')\n | \'encrypted password\'\n }\n \nDescription\n----------- \nThe SET PASSWORD statement assigns a password to an existing\nMariaDB user\naccount.\n \nIf the password is specified using the PASSWORD() or\nOLD_PASSWORD()\nfunction, the literal text of the password should be given.\nIf the\npassword is specified without using either function, the\npassword\nshould be the already-encrypted password value as returned\nby\nPASSWORD().\n \nOLD_PASSWORD() should only be used if your MariaDB/MySQL\nclients are very old (< 4.0.0).\n \nWith no FOR clause, this statement sets the password for the\ncurrent\nuser. Any client that has connected to the server using a\nnon-anonymous\naccount can change the password for that account.\n \nWith a FOR clause, this statement sets the password for a\nspecific\naccount on the current server host. Only clients that have\nthe UPDATE\nprivilege for the mysql database can do this. The user value\nshould be\ngiven in user_name@host_name format, where user_name and\nhost_name are\nexactly as they are listed in the User and Host columns of\nthe\nmysql.user table entry. \n \nThe argument to PASSWORD() and the password given to MariaDB\nclients can be of arbitrary length.\n \nAuthentication Plugin Support\n \nIn MariaDB 10.4 and later, SET PASSWORD (with or without\nPASSWORD()) works for accounts authenticated via any\nauthentication plugin that supports passwords stored in the\nmysql.global_priv table.\n \nThe ed25519, mysql_native_password, and mysql_old_password\nauthentication plugins store passwords in the\nmysql.global_priv table.\n \nIf you run SET PASSWORD on an account that authenticates\nwith one of these authentication plugins that stores\npasswords in the mysql.global_priv table, then the\nPASSWORD() function is evaluated by the specific\nauthentication plugin used by the account. The\nauthentication plugin hashes the password with a method that\nis compatible with that specific authentication plugin.\n \nThe unix_socket, named_pipe, gssapi, and pam authentication\nplugins do not store passwords in the mysql.global_priv\ntable. These authentication plugins rely on other methods to\nauthenticate the user.\n \nIf you attempt to run SET PASSWORD on an account that\nauthenticates with one of these authentication plugins that\ndoesn\'t store a password in the mysql.global_priv table,\nthen MariaDB Server will raise a warning like the following:\n \nSET PASSWORD is ignored for users authenticating via\nunix_socket plugin\n \nSee Authentication from MariaDB 10.4 for an overview of\nauthentication changes in MariaDB 10.4.\n \nMariaDB until 10.3\n \nIn MariaDB 10.3 and before, SET PASSWORD (with or without\nPASSWORD()) only works for accounts authenticated via\nmysql_native_password or mysql_old_password authentication\nplugins\n \nPasswordless User Accounts\n \nUser accounts do not always require passwords to login.\n \nThe unix_socket and named_pipe authentication plugins do not\nrequire a password to authenticate the user.\n \nThe gssapi and pam authentication plugins may or may not\nrequire a password to authenticate the user, depending on\nthe specific configuration.\n \nThe mysql_native_password and mysql_old_password\nauthentication plugins require passwords for authentication,\nbut the password can be blank. In that case, no password is\nrequired.\n \nIf you provide a password while attempting to log into the\nserver as an account that doesn\'t require a password, then\nMariaDB server will simply ignore the password.\n \nIn MariaDB 10.4 and later, a user account can be defined to\nuse multiple authentication plugins in a specific order of\npreference. This specific scenario may be more noticeable in\nthese versions, since an account could be associated with\nsome authentication plugins that require a password, and\nsome that do not.\n \nExample\n \nFor example, if you had an entry with User and\nHost column values of \'bob\' and \n\'%.loc.gov\', you would write the\nstatement like this:\n \nSET PASSWORD FOR \'bob\'@\'%.loc.gov\' =\nPASSWORD(\'newpass\');\n \n\n\nURL: https://mariadb.com/kb/en/library/set-password/','','https://mariadb.com/kb/en/library/set-password/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (126,10,'Roles Overview','Roles were introduced in MariaDB 10.0.5.\n \nDescription\n----------- \nA role bundles a number of privileges together. It assists\nlarger organizations where, typically, a number of users\nwould have the same privileges, and, previously, the only\nway to change the privileges for a group of users was by\nchanging each user\'s privileges individually. \n \nAlternatively, multiple external users could have been\nassigned the same user, and there would have been no way to\nsee which actual user was responsible for which action.\n \nWith roles, managing this is easy. For example, there could\nbe a number of users assigned to a journalist role, with\nidentical privileges. Changing the privileges for all the\njournalists is a matter of simply changing the role\'s\nprivileges, while the individual user is still linked with\nany changes that take place.\n \nRoles are created with the CREATE ROLE statement, and\ndropped with the DROP ROLE statement. Roles are then\nassigned to a user with an extension to the GRANT statement,\nwhile privileges are assigned to a role in the regular way\nwith GRANT. Similarly, the REVOKE statement can be used to\nboth revoke a role from a user, or revoke a privilege from a\nrole.\n \nOnce a user has connected, he can obtain all privileges\nassociated with a role by setting a role with the SET ROLE\nstatement. The CURRENT_ROLE function returns the currently\nset role for the session, if any.\n \nOnly roles granted directly to a user can be set, roles\ngranted to other roles cannot. Instead the privileges\ngranted to a role, which is, in turn, granted to another\nrole (grantee), will be immediately available to any user\nwho sets this second grantee role.\n \nRoles were implemented as a GSoC 2013 project by Vicentiu\nCiorbaru. \n \nThe SET DEFAULT ROLE statement allows one to set a default\nrole for a user. A default role is automatically enabled\nwhen a user connects (an implicit SET ROLE statement is\nexecuted immediately after a connection is established).\n \nSystem Tables\n \nInformation about roles and who they\'ve been granted to can\nbe found in the Information Schema APPLICABLE_ROLES table as\nwell as the mysql.ROLES_MAPPING table.\n \nThe Information Schema ENABLED_ROLES table shows the enabled\nroles for the current session.\n \nExamples\n-------- \nCreating a role and granting a privilege:\n \nCREATE ROLE journalist;\n \nGRANT SHOW DATABASES ON *.* TO journalist;\n \nGRANT journalist to hulda;\n \nNote, that hulda has no SHOW DATABASES privilege, even\nthough she was granted the journalist role. She needs to set\nthe role first:\n \nSHOW DATABASES;\n \n+--------------------+\n| Database |\n+--------------------+\n| information_schema |\n+--------------------+\n \nSELECT CURRENT_ROLE;\n \n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL |\n+--------------+\n \nSET ROLE journalist;\n \nSELECT CURRENT_ROLE;\n \n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| journalist |\n+--------------+\n \nSHOW DATABASES;\n \n+--------------------+\n| Database |\n+--------------------+\n| ... |\n| information_schema |\n| mysql |\n| performance_schema |\n| test |\n| ... |\n+--------------------+\n \nSET ROLE NONE;\n \nRoles can be granted to roles:\n \nCREATE ROLE writer;\n \nGRANT SELECT ON data.* TO writer;\n \nGRANT writer TO journalist;\n \nBut one does not need to set a role granted to a role. For\nexample, hulda will automatically get all writer privileges\nwhen she sets the journalist role:\n \nSELECT CURRENT_ROLE;\n \n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL |\n+--------------+\n \nSHOW TABLES FROM data;\n \nEmpty set (0.01 sec)\n \nSET ROLE journalist;\n \nSELECT CURRENT_ROLE;\n \n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| journalist |\n+--------------+\n \nSHOW TABLES FROM data;\n \n+------------------------------+\n| Tables_in_data |\n+------------------------------+\n| set1 |\n| ... |\n+------------------------------+\n \nRoles and Views (and Stored Routines)\n \nWhen a user sets a role, he, in a sense, has two identities\nwith two associated sets of privileges.\nBut a view (or a stored routine) can have only one definer.\nSo, when a view (or a stored routine) is created with the\nSQL SECURITY DEFINER, one can specify whether the definer\nshould be CURRENT_USER (and the view will have none of the\nprivileges of the user\'s role) or CURRENT_ROLE (in this\ncase, the view will use role\'s privileges, but none of the\nuser\'s privileges). As a result, sometimes one can create a\nview that is impossible to use.\n \nCREATE ROLE r1;\n \nGRANT ALL ON db1.* TO r1;\n \nGRANT r1 TO foo@localhost;\n \nGRANT ALL ON db.* TO foo@localhost;\n \nSELECT CURRENT_USER\n+---------------+\n| current_user |\n+---------------+\n| foo@localhost |\n+---------------+\n \nSET ROLE r1;\n \nCREATE TABLE db1.t1 (i int);\n \nCREATE VIEW db.v1 AS SELECT * FROM db1.t1;\n \nSHOW CREATE VIEW db.v1;\n \n+------+------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+\n| View | Create View | character_set_client |\ncollation_connection |\n+------+------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+\n| v1 | CREATE ALGORITHM=UNDEFINED DEFINER=`foo`@`localhost`\nSQL SECURITY DEFINER VIEW `db`.`v1` AS SELECT `db1`.`t1`.`i`\nAS `i` from `db1`.`t1` | utf8 | utf8_general_ci |\n+------+------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+\n \nCREATE DEFINER=CURRENT_ROLE VIEW db.v2 AS SELECT * FROM\ndb1.t1;\n \nSHOW CREATE VIEW db.b2;\n \n+------+-----------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+\n| View | Create View | character_set_client |\ncollation_connection |\n+------+-----------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+\n| v2 | CREATE ALGORITHM=UNDEFINED DEFINER=`r1` SQL SECURITY\nDEFINER VIEW `db`.`v2` AS select `db1`.`t1`.`a` AS `a` from\n`db1`.`t1` | utf8 | utf8_general_ci |\n+------+-----------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+\n \nOther Resources\n \nRoles Review by Peter Gulutzan\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/roles_overview/','','https://mariadb.com/kb/en/library/roles_overview/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (127,10,'CREATE ROLE','Roles were introduced in MariaDB 10.0.5.\n \nSyntax\n------ \nCREATE [OR REPLACE] ROLE [IF NOT EXISTS] role \n [WITH ADMIN \n {CURRENT_USER | CURRENT_ROLE | user | role}]\n \nDescription\n----------- \nThe CREATE ROLE statement creates one or more MariaDB roles.\nTo\nuse it, you must have the global CREATE USER\nprivilege or the INSERT privilege for the mysql\ndatabase. For each account, CREATE ROLE creates a new row in\nthe\nmysql.user table that has no privileges, and with the\ncorresponding is_role field set to Y. It also creates a\nrecord in the\nmysql.roles_mapping table.\n \nIf any of the specified roles already exist, ERROR 1396\n(HY000) results. If\nan error occurs, CREATE ROLE will still create the roles\nthat do not result\nin an error. The maximum length for a role is 128\ncharacters. Role names can be\nquoted, as explained in the Identifier names page. Only\none error is produced for all roles which have not been\ncreated:\n \nERROR 1396 (HY000): Operation CREATE ROLE failed for\n\'a\',\'b\',\'c\'\n \nFailed CREATE or DROP operations, for both users and roles,\nproduce the\nsame error code.\n \nPUBLIC and NONE are reserved, and cannot be used as role\nnames.\n \nBefore MariaDB 10.1.13, the CREATE ROLE statement was not\npermitted in prepared statements.\n \nFor valid identifiers to use as role names, see Identifier\nNames.\n \nWITH ADMIN\n \nThe optional WITH ADMIN clause determines whether the\ncurrent user, the\ncurrent role or another user or role has use of the newly\ncreated role. If the\nclause is omitted, WITH ADMIN CURRENT_USER is treated as the\ndefault, which\nmeans that the current user will be able to GRANT this role\nto\nusers.\n \nOR REPLACE\n \nThe OR REPLACE clause was added in MariaDB 10.1.3\n \nIf the optional OR REPLACE clause is used, it acts as a\nshortcut for:\n \nDROP ROLE IF EXISTS name;\n \nCREATE ROLE name ...;\n \nIF NOT EXISTS\n \nThe IF NOT EXISTS clause was added in MariaDB 10.1.3\n \nWhen the IF NOT EXISTS clause is used, MariaDB will return a\nwarning instead of an error if the specified role already\nexists. Cannot be used together with the OR REPLACE clause.\n \nExamples\n-------- \nCREATE ROLE journalist;\n \nCREATE ROLE developer WITH ADMIN lorinda;\n \nThe OR REPLACE and IF NOT EXISTS clauses:\n \nCREATE ROLE journalist;\nERROR 1396 (HY000): Operation CREATE ROLE failed for\n\'journalist\'\n \nCREATE OR REPLACE ROLE journalist;\nQuery OK, 0 rows affected (0.00 sec)\n \nCREATE ROLE IF NOT EXISTS journalist;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n \nSHOW WARNINGS;\n+-------+------+---------------------------------------------------+\n| Level | Code | Message |\n+-------+------+---------------------------------------------------+\n| Note | 1975 | Can\'t create role \'journalist\'; it\nalready exists |\n+-------+------+---------------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/create-role/','','https://mariadb.com/kb/en/library/create-role/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (128,10,'DROP ROLE','Roles were introduced in MariaDB 10.0.5.\n \nSyntax\n------ \nDROP ROLE [IF EXISTS] role_name [,role_name ...]\n \nDescription\n----------- \nThe DROP ROLE statement removes one or more MariaDB roles.\nTo use this\nstatement, you must have the global CREATE USER privilege or\nthe DELETE privilege for the mysql database.\n \nDROP ROLE does not disable roles for connections which\nselected them with SET ROLE. If a role has previously been\nset as a default role, DROP ROLE does not remove the record\nof the default role from the mysql.user table. If the role\nis subsequently recreated and granted, it will again be the\nuser\'s default. Use SET DEFAULT ROLE NONE to explicitly\nremove this.\n \nIf any of the specified user accounts do not exist, ERROR\n1396 (HY000)\nresults. If an error occurs, DROP ROLE will still drop the\nroles that\ndo not result in an error. Only one error is produced for\nall roles which have not been dropped:\n \nERROR 1396 (HY000): Operation DROP ROLE failed for\n\'a\',\'b\',\'c\'\n \nFailed CREATE or DROP operations, for both users and roles,\nproduce the same error code.\n \nBefore MariaDB 10.1.13, the DROP ROLE statement was not\npermitted in prepared statements.\n \nIF EXISTS\n \nThe IF EXISTS clause was added in MariaDB 10.1.3\n \nIf the IF EXISTS clause is used, MariaDB will return a\nwarning instead of an error if the role does not exist.\n \nExamples\n-------- \nDROP ROLE journalist;\n \nThe same thing using the optional IF EXISTS clause:\n \nDROP ROLE journalist;\n \nERROR 1396 (HY000): Operation DROP ROLE failed for\n\'journalist\'\n \nDROP ROLE IF EXISTS journalist;\n \nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n \nNote (Code 1975): Can\'t drop role \'journalist\'; it\ndoesn\'t exist\n \n\n\nURL: https://mariadb.com/kb/en/library/drop-role/','','https://mariadb.com/kb/en/library/drop-role/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (129,10,'SET ROLE','Roles were introduced in MariaDB 10.0.5.\n \nSyntax\n------ \nSET ROLE { role | NONE }\n \nDescription\n----------- \nThe SET ROLE statement enables a role, along with all of its\nassociated permissions, for the current session. To unset a\nrole, use NONE .\n \nIf a role that doesn\'t exist, or to which the user has not\nbeen assigned, is specified, an ERROR 1959 (OP000): Invalid\nrole specification error occurs.\n \nFrom MariaDB 10.1.1, an automatic SET ROLE is implicitly\nperformed when a user connects if that user has been\nassigned a default role. See SET DEFAULT ROLE.\n \nExample\n \nSELECT CURRENT_ROLE;\n \n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL |\n+--------------+\n \nSET ROLE staff;\n \nSELECT CURRENT_ROLE;\n \n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| staff |\n+--------------+\n \nSET ROLE NONE;\n \nQuery OK, 0 rows affected (0.00 sec)\n \nSELECT CURRENT_ROLE();\n+----------------+\n| CURRENT_ROLE() |\n+----------------+\n| NULL |\n+----------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/set-role/','','https://mariadb.com/kb/en/library/set-role/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (130,10,'SET DEFAULT ROLE','Default roles were implemented in MariaDB 10.1.1.\n \nSyntax\n------ \nSET DEFAULT ROLE { role | NONE } [ FOR user@host ]\n \nDescription\n----------- \nThe SET DEFAULT ROLE statement sets a default role for a\nspecified (or current) user. A default role is automatically\nenabled when a user connects (an implicit SET ROLE statement\nis executed immediately after a connection is established).\n \nTo be able to set a role as a default, one needs the\nprivileges to enable this role (if you cannot do SET ROLE X,\nyou won\'t be able to do SET DEFAULT ROLE X). To set a\ndefault role for another user one needs to have write access\nto the mysql database.\n \nTo remove a user\'s default role, use SET DEFAULT ROLE NONE\n[ FOR user@host ]. The record of the default role is not\nremoved if the role is dropped or revoked, so if the role is\nsubsequently re-created or granted, it will again be the\nuser\'s default role.\n \nThe default role is stored in a new column in the mysql.user\ntable, and currently viewing this table is the only way to\nsee which role has been assigned to a user as the default. \n \nExamples\n-------- \nSetting a default role for the current user:\n \nSET DEFAULT ROLE journalist;\n \nRemoving a default role from the current user:\n \nSET DEFAULT ROLE NONE;\n \n\n \n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/set-default-role/','','https://mariadb.com/kb/en/library/set-default-role/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (131,11,'ST_X','Syntax\n------ \nST_X(p)\nX(p)\n \nDescription\n----------- \nReturns the X-coordinate value for the point p as a\ndouble-precision number.\n \nST_X() and X() are synonyms.\n \nExamples\n-------- \nSET @pt = \'Point(56.7 53.34)\';\n \nSELECT X(GeomFromText(@pt));\n+----------------------+\n| X(GeomFromText(@pt)) |\n+----------------------+\n| 56.7 |\n+----------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_x/','','https://mariadb.com/kb/en/library/st_x/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (132,11,'ST_Y','Syntax\n------ \nST_Y(p)\nY(p)\n \nDescription\n----------- \nReturns the Y-coordinate value for the point p as a\ndouble-precision number.\n \nST_Y() and Y() are synonyms.\n \nExamples\n-------- \nSET @pt = \'Point(56.7 53.34)\';\n \nSELECT Y(GeomFromText(@pt));\n+----------------------+\n| Y(GeomFromText(@pt)) |\n+----------------------+\n| 53.34 |\n+----------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_y/','','https://mariadb.com/kb/en/library/st_y/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (133,11,'X','A synonym for ST_X.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/point-properties-x/','','https://mariadb.com/kb/en/library/point-properties-x/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (134,11,'Y','A synonym for ST_Y.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/point-properties-y/','','https://mariadb.com/kb/en/library/point-properties-y/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (135,12,'AES_DECRYPT','Syntax\n------ \nAES_DECRYPT(crypt_str,key_str)\n \nDescription\n----------- \nThis function allows decryption of data using the official\nAES\n(Advanced Encryption Standard) algorithm. For more\ninformation, see\nthe description of AES_ENCRYPT().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/aes_decrypt/','','https://mariadb.com/kb/en/library/aes_decrypt/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (136,12,'AES_ENCRYPT','Syntax\n------ \nAES_ENCRYPT(str,key_str)\n \nDescription\n----------- \nAES_ENCRYPT() and AES_DECRYPT() allow encryption and\ndecryption of\ndata using the official AES (Advanced Encryption Standard)\nalgorithm,\npreviously known as \"Rijndael.\" Encoding with a 128-bit\nkey length is\nused, but you can extend it up to 256 bits by modifying the\nsource. We\nchose 128 bits because it is much faster and it is secure\nenough for\nmost purposes.\n \nAES_ENCRYPT() encrypts a string str using the key key_str,\nand returns a binary string.\n \nAES_DECRYPT() decrypts the encrypted string and returns the\noriginal\nstring.\n \nThe input arguments may be any length. If either argument is\nNULL, the result of this function is also NULL.\n \nBecause AES is a block-level algorithm, padding is used to\nencode\nuneven length strings and so the result string length may be\ncalculated using this formula:\n \n16 x (trunc(string_length / 16) + 1)\n \nIf AES_DECRYPT() detects invalid data or incorrect padding,\nit returns\nNULL. However, it is possible for AES_DECRYPT() to return a\nnon-NULL\nvalue (possibly garbage) if the input data or the key is\ninvalid.\n \nExamples\n-------- \nINSERT INTO t VALUES\n(AES_ENCRYPT(\'text\',SHA2(\'password\',512)));\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/aes_encrypt/','','https://mariadb.com/kb/en/library/aes_encrypt/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (137,12,'COMPRESS','Syntax\n------ \nCOMPRESS(string_to_compress)\n \nDescription\n----------- \nCompresses a string and returns the result as a binary\nstring. This\nfunction requires MariaDB to have been compiled with a\ncompression\nlibrary such as zlib. Otherwise, the return value is always\nNULL. The\ncompressed string can be uncompressed with UNCOMPRESS().\n \nThe have_compress server system variable indicates whether a\ncompression library is present. \n \nExamples\n-------- \nSELECT LENGTH(COMPRESS(REPEAT(\'a\',1000)));\n+------------------------------------+\n| LENGTH(COMPRESS(REPEAT(\'a\',1000))) |\n+------------------------------------+\n| 21 |\n+------------------------------------+\n \nSELECT LENGTH(COMPRESS(\'\'));\n+----------------------+\n| LENGTH(COMPRESS(\'\')) |\n+----------------------+\n| 0 |\n+----------------------+\n \nSELECT LENGTH(COMPRESS(\'a\'));\n+-----------------------+\n| LENGTH(COMPRESS(\'a\')) |\n+-----------------------+\n| 13 |\n+-----------------------+\n \nSELECT LENGTH(COMPRESS(REPEAT(\'a\',16)));\n+----------------------------------+\n| LENGTH(COMPRESS(REPEAT(\'a\',16))) |\n+----------------------------------+\n| 15 |\n+----------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/compress/','','https://mariadb.com/kb/en/library/compress/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (138,12,'DECODE','Syntax\n------ \nDECODE(crypt_str,pass_str)\n \nDescription\n----------- \nDecrypts the encrypted string crypt_str using pass_str as\nthe\npassword. crypt_str should be a string returned from\nENCODE(). The resulting string will be the original string\nonly if pass_str is the same.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/decode/','','https://mariadb.com/kb/en/library/decode/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (139,12,'DES_DECRYPT','Syntax\n------ \nDES_DECRYPT(crypt_str[,key_str])\n \nDescription\n----------- \nDecrypts a string encrypted with DES_ENCRYPT(). If an error\noccurs,\nthis function returns NULL.\n \nThis function works only if MariaDB has been configured with\nTLS\nsupport.\n \nIf no key_str argument is given, DES_DECRYPT() examines the\nfirst byte\nof the encrypted string to determine the DES key number that\nwas used\nto encrypt the original string, and then reads the key from\nthe DES\nkey file to decrypt the message. For this to work, the user\nmust have\nthe SUPER privilege. The key file can be specified with the\n--des-key-file server option.\n \nIf you pass this function a key_str argument, that string is\nused as\nthe key for decrypting the message.\n \nIf the crypt_str argument does not appear to be an encrypted\nstring,\nMariaDB returns the given crypt_str.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/des_decrypt/','','https://mariadb.com/kb/en/library/des_decrypt/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (140,12,'DES_ENCRYPT','Syntax\n------ \nDES_ENCRYPT(str[,{key_num|key_str}])\n \nDescription\n----------- \nEncrypts the string with the given key using the Triple-DES\nalgorithm.\n \nThis function works only if MariaDB has been configured with\nTLS support.\n \nThe encryption key to use is chosen based on the second\nargument to\nDES_ENCRYPT(), if one was given. With no argument, the first\nkey from\nthe DES key file is used. With a key_num argument, the given\nkey \nnumber (0-9) from the DES key file is used. With a key_str\nargument,\nthe given key string is used to encrypt str. \n \nThe key file can be specified with the --des-key-file server\noption.\n \nThe return string is a binary string where the first\ncharacter is \nCHAR(128 | key_num). If an error occurs, DES_ENCRYPT()\nreturns NULL.\n \nThe 128 is added to make it easier to recognize an encrypted\nkey. If\nyou use a string key, key_num is 127.\n \nThe string length for the result is given by this formula:\n \nnew_len = orig_len + (8 - (orig_len % 8)) + 1\n \nEach line in the DES key file has the following format:\n \nkey_num des_key_str\n \nEach key_num value must be a number in the range from 0 to\n9. Lines in\nthe file may be in any order. des_key_str is the string that\nis used\nto encrypt the message. There should be at least one space\nbetween the\nnumber and the key. The first key is the default key that is\nused if\nyou do not specify any key argument to DES_ENCRYPT().\n \nYou can tell MariaDB to read new key values from the key\nfile with the\nFLUSH DES_KEY_FILE statement. This requires the RELOAD\nprivilege.\n \nOne benefit of having a set of default keys is that it gives\napplications a way to check for the existence of encrypted\ncolumn\nvalues, without giving the end user the right to decrypt\nthose values.\n \nExamples\n-------- \nSELECT customer_address FROM customer_table \n WHERE crypted_credit_card =\nDES_ENCRYPT(\'credit_card_number\');\n \n\n\nURL: https://mariadb.com/kb/en/library/des_encrypt/','','https://mariadb.com/kb/en/library/des_encrypt/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (141,12,'ENCODE','Syntax\n------ \nENCODE(str,pass_str)\n \nDescription\n----------- \nENCODE is not considered cryptographically secure, and\nshould not be used for password encryption.\n \nEncrypt str using pass_str as the password. To decrypt the\nresult, use\nDECODE().\n \nThe result is a binary string of the same length as str.\n \nThe strength of the encryption is based on how good the\nrandom generator is. \n \nIt is not recommended to rely on the encryption performed by\nthe ENCODE function. Using a salt value (changed when a\npassword is updated) will improve matters somewhat, but for\nstoring passwords, consider a more cryptographically secure\nfunction, such as SHA2().\n \nExamples\n-------- \nENCODE(\'not so secret text\',\nCONCAT(\'random_salt\',\'password\'))\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/encode/','','https://mariadb.com/kb/en/library/encode/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (142,12,'ENCRYPT','Syntax\n------ \nENCRYPT(str[,salt])\n \nDescription\n----------- \nEncrypts a string using the Unix crypt() system call,\nreturning an encrypted binary string. The salt argument\nshould be a string with at least two characters or the\nreturned result will be NULL. If no salt argument is given,\na random value of sufficient length is used.\n \nIt is not recommended to use ENCRYPT() with utf16, utf32 or\nucs2 multi-byte character sets because the crypt() system\ncall expects a string terminated with a zero byte.\n \nNote that the underlying crypt() system call may have some\nlimitations, such as ignoring all but the first eight\ncharacters.\n \nIf the have_crypt system variable is set to NO (because the\ncrypt() system call is not available), the ENCRYPT function\nwill always return NULL.\n \nExamples\n-------- \nSELECT ENCRYPT(\'encrypt me\');\n+-----------------------+\n| ENCRYPT(\'encrypt me\') |\n+-----------------------+\n| 4I5BsEx0lqTDk |\n+-----------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/encrypt/','','https://mariadb.com/kb/en/library/encrypt/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (143,12,'MD5','Syntax\n------ \nMD5(str)\n \nDescription\n----------- \nCalculates an MD5 128-bit checksum for the string. \n \nThe return value is a 32-hex digit string, and as of MariaDB\n5.5, is a nonbinary string in the connection character set\nand collation, determined by the values of the\ncharacter_set_connection and collation_connection system\nvariables. Before 5.5, the return value was a binary string.\n \nNULL is returned if the argument was NULL. \n \nExamples\n-------- \nSELECT MD5(\'testing\');\n+----------------------------------+\n| MD5(\'testing\') |\n+----------------------------------+\n| ae2b1fca515949e5d54fb22b8ed95575 |\n+----------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/md5/','','https://mariadb.com/kb/en/library/md5/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (144,12,'OLD_PASSWORD','Syntax\n------ \nOLD_PASSWORD(str)\n \nDescription\n----------- \nOLD_PASSWORD() was added to MySQL when the implementation of\n\nPASSWORD() was changed to improve security. OLD_PASSWORD()\nreturns the\nvalue of the old (pre-MySQL 4.1) implementation of\nPASSWORD() as a\nstring, and is intended to permit you to reset passwords for\nany\npre-4.1 clients that need to connect to a more recent MySQL\nserver version, or any version of MariaDB,\nwithout locking them out.\n \nAs of MariaDB 5.5, the return value is a nonbinary string in\nthe connection character set and collation, determined by\nthe values of the character_set_connection and\ncollation_connection system variables. Before 5.5, the\nreturn value was a binary string.\n \nThe return value is 16 bytes in length, or NULL if the\nargument was NULL.\n \n\n\nURL: https://mariadb.com/kb/en/library/old_password/','','https://mariadb.com/kb/en/library/old_password/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (145,12,'PASSWORD','Syntax\n------ \nPASSWORD(str)\n \nDescription\n----------- \nThe PASSWORD() function is used for hashing passwords for\nuse in authentication by the MariaDB server. It is not\nintended for use in other applications.\n \nCalculates and returns a hashed password string from the\nplaintext password str. Returns an empty string (>= MariaDB\n10.0.4) or NULL (\n\nURL: https://mariadb.com/kb/en/library/password/','','https://mariadb.com/kb/en/library/password/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (146,12,'SHA1','Syntax\n------ \nSHA1(str), SHA(str)\n \nDescription\n----------- \nCalculates an SHA-1 160-bit checksum for the string str, as\ndescribed in\nRFC 3174 (Secure Hash Algorithm).\n \nThe value is returned as a string of 40 hex digits, or NULL\nif the argument was NULL. As of MariaDB 5.5, the return\nvalue is a nonbinary string in the connection character set\nand collation, determined by the values of the\ncharacter_set_connection and collation_connection system\nvariables. Before 5.5, the return value was a binary string.\n \nExamples\n-------- \nSELECT SHA1(\'some boring text\');\n+------------------------------------------+\n| SHA1(\'some boring text\') |\n+------------------------------------------+\n| af969fc2085b1bb6d31e517d5c456def5cdd7093 |\n+------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/sha1/','','https://mariadb.com/kb/en/library/sha1/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (147,12,'SHA2','SHA2() was introduced in MariaDB 5.5\n \nSyntax\n------ \nSHA2(str,hash_len)\n \nDescription\n----------- \nGiven a string str, calculates an SHA-2 checksum, which is\nconsidered more cryptographically secure than its SHA-1\nequivalent. The SHA-2 family includes SHA-224, SHA-256,\nSHA-384, and SHA-512, and the hash_len must correspond to\none of these, i.e. 224, 256, 384 or 512. 0 is equivalent to\n256.\n \nThe return value is a nonbinary string in the connection\ncharacter set and collation, determined by the values of the\ncharacter_set_connection and collation_connection system\nvariables. \n \nNULL is returned if the hash length is not valid, or the\nstring str is NULL.\n \nSHA2 will only work if MariaDB was has been configured with\nTLS support. \n \nExamples\n-------- \nSELECT SHA2(\'Maria\',224);\n+----------------------------------------------------------+\n| SHA2(\'Maria\',224) |\n+----------------------------------------------------------+\n| 6cc67add32286412efcab9d0e1675a43a5c2ef3cec8879f81516ff83 |\n+----------------------------------------------------------+\n \nSELECT SHA2(\'Maria\',256);\n+------------------------------------------------------------------+\n| SHA2(\'Maria\',256) |\n+------------------------------------------------------------------+\n|\n9ff18ebe7449349f358e3af0b57cf7a032c1c6b2272cb2656ff85eb112232f16\n|\n+------------------------------------------------------------------+\n \nSELECT SHA2(\'Maria\',0);\n+------------------------------------------------------------------+\n| SHA2(\'Maria\',0) |\n+------------------------------------------------------------------+\n|\n9ff18ebe7449349f358e3af0b57cf7a032c1c6b2272cb2656ff85eb112232f16\n|\n+------------------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/sha2/','','https://mariadb.com/kb/en/library/sha2/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (148,12,'UNCOMPRESS','Syntax\n------ \nUNCOMPRESS(string_to_uncompress)\n \nDescription\n----------- \nUncompresses a string compressed by the COMPRESS() function.\nIf the\nargument is not a compressed value, the result is NULL. This\nfunction\nrequires MariaDB to have been compiled with a compression\nlibrary such\nas zlib. Otherwise, the return value is always NULL. The\nhave_compress server system variable indicates whether a\ncompression library is present. \n \nExamples\n-------- \nSELECT UNCOMPRESS(COMPRESS(\'a string\'));\n+----------------------------------+\n| UNCOMPRESS(COMPRESS(\'a string\')) |\n+----------------------------------+\n| a string |\n+----------------------------------+\n \nSELECT UNCOMPRESS(\'a string\');\n+------------------------+\n| UNCOMPRESS(\'a string\') |\n+------------------------+\n| NULL |\n+------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/uncompress/','','https://mariadb.com/kb/en/library/uncompress/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (149,12,'UNCOMPRESSED_LENGTH','Syntax\n------ \nUNCOMPRESSED_LENGTH(compressed_string)\n \nDescription\n----------- \nReturns the length that the compressed string had before\nbeing\ncompressed with COMPRESS().\n \nUNCOMPRESSED_LENGTH() returns NULL or an incorrect result if\nthe string is not compressed.\n \nUntil MariaDB 10.3.1, returns MYSQL_TYPE_LONGLONG, or\nbigint(10), in all cases. From MariaDB 10.3.1, returns\nMYSQL_TYPE_LONG, or int(10), when the result would fit\nwithin 32-bits.\n \nExamples\n-------- \nSELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT(\'a\',30)));\n+-----------------------------------------------+\n| UNCOMPRESSED_LENGTH(COMPRESS(REPEAT(\'a\',30))) |\n+-----------------------------------------------+\n| 30 |\n+-----------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/uncompressed_length/','','https://mariadb.com/kb/en/library/uncompressed_length/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (150,13,'ENDPOINT','A synonym for ST_ENDPOINT.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/linestring-properties-endpoint/','','https://mariadb.com/kb/en/library/linestring-properties-endpoint/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (151,13,'GLENGTH','Syntax\n------ \nGLength(ls)\n \nDescription\n----------- \nReturns as a double-precision number the length of the\nLineString value ls in its associated spatial reference.\n \nExamples\n-------- \nSET @ls = \'LineString(1 1,2 2,3 3)\';\n \nSELECT GLength(GeomFromText(@ls));\n+----------------------------+\n| GLength(GeomFromText(@ls)) |\n+----------------------------+\n| 2.82842712474619 |\n+----------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/glength/','','https://mariadb.com/kb/en/library/glength/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (152,13,'NumPoints','A synonym for ST_NumPoints.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/linestring-properties-numpoints/','','https://mariadb.com/kb/en/library/linestring-properties-numpoints/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (153,13,'PointN','A synonym for ST_PointN.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/linestring-properties-pointn/','','https://mariadb.com/kb/en/library/linestring-properties-pointn/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (154,13,'STARTPOINT','A synonym for ST_STARTPOINT.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/linestring-properties-startpoint/','','https://mariadb.com/kb/en/library/linestring-properties-startpoint/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (155,13,'ST_ENDPOINT','Syntax\n------ \nST_EndPoint(ls)\nEndPoint(ls)\n \nDescription\n----------- \nReturns the Point that is the endpoint of the\nLineString value ls.\n \nST_EndPoint() and EndPoint() are synonyms.\n \nExamples\n-------- \nSET @ls = \'LineString(1 1,2 2,3 3)\';\n \nSELECT AsText(EndPoint(GeomFromText(@ls)));\n+-------------------------------------+\n| AsText(EndPoint(GeomFromText(@ls))) |\n+-------------------------------------+\n| POINT(3 3) |\n+-------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_endpoint/','','https://mariadb.com/kb/en/library/st_endpoint/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (156,13,'ST_NUMPOINTS','Syntax\n------ \nST_NumPoints(ls)\nNumPoints(ls)\n \nDescription\n----------- \nReturns the number of Point objects in the LineString\nvalue ls.\n \nST_NumPoints() and NumPoints() are synonyms.\n \nExamples\n-------- \nSET @ls = \'LineString(1 1,2 2,3 3)\';\n \nSELECT NumPoints(GeomFromText(@ls));\n+------------------------------+\n| NumPoints(GeomFromText(@ls)) |\n+------------------------------+\n| 3 |\n+------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_numpoints/','','https://mariadb.com/kb/en/library/st_numpoints/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (157,13,'ST_POINTN','Syntax\n------ \nST_PointN(ls,N)\nPointN(ls,N)\n \nDescription\n----------- \nReturns the N-th Point in the LineString value ls.\nPoints are numbered beginning with 1.\n \nST_PointN() and PointN() are synonyms.\n \nExamples\n-------- \nSET @ls = \'LineString(1 1,2 2,3 3)\';\n \nSELECT AsText(PointN(GeomFromText(@ls),2));\n+-------------------------------------+\n| AsText(PointN(GeomFromText(@ls),2)) |\n+-------------------------------------+\n| POINT(2 2) |\n+-------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_pointn/','','https://mariadb.com/kb/en/library/st_pointn/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (158,14,'GET_LOCK','Syntax\n------ \nGET_LOCK(str,timeout)\n \nDescription\n----------- \nTries to obtain a lock with a name given by the string str,\nusing a timeout of timeout seconds. Returns 1 if the lock\nwas obtained successfully, 0 if the attempt timed out (for\nexample, because another client has previously locked the\nname), or NULL if an error occurred (such as running out of\nmemory or the thread was killed with mysqladmin kill).\n \nA lock is released with RELEASE_LOCK(), when the connection\nterminates (either normally or abnormally), or before\nMariaDB 10.0.2, when the connection executes another\nGET_LOCK statement. From MariaDB 10.0.2, a connection can\nhold multiple locks at the same time, so a lock that is no\nlonger needed needs to be explicitly released.\n \nThe IS_FREE_LOCK function returns whether a specified lock a\nfree or not, and the IS_USED_LOCK whether the function is in\nuse or not.\n \nLocks obtained with GET_LOCK() do not interact with\ntransactions. That is, committing a transaction does not\nrelease any such locks obtained during the transaction.\n \nFrom MariaDB 10.0.2, it is also possible to recursively set\nthe same lock. If a lock with the same name is set n times,\nit needs to be released n times as well. \n \nstr is case insensitive for GET_LOCK() and related\nfunctions. If str is an empty string or NULL, GET_LOCK()\nreturns NULL and does nothing. From MariaDB 10.2.2, timeout\nsupports microseconds. Before then, it was rounded to the\nclosest integer.\n \nIf the metadata_lock_info plugin is installed, locks\nacquired with this function are visible in the Information\nSchema METADATA_LOCK_INFO table.\n \nThis function can be used to implement application locks or\nto simulate record locks. Names are locked on a server-wide\nbasis. If a name has been locked by one client, GET_LOCK()\nblocks any request by another client for a lock with the\nsame name. This allows clients that agree on a given lock\nname to use the name to perform cooperative advisory\nlocking. But be aware that it also allows a client that is\nnot among the set of cooperating clients to lock a name,\neither inadvertently or deliberately, and thus prevent any\nof the cooperating clients from locking that name. One way\nto reduce the likelihood of this is to use lock names that\nare database-specific or application-specific. For example,\nuse lock names of the form db_name.str or app_name.str.\n \nStatements using the GET_LOCK() function are not safe for\nreplication.\n \nThe patch to permit multiple locks was contributed by\nKonstantin \"Kostja\" Osipov (MDEV-3917).\n \nExamples\n-------- \nSELECT GET_LOCK(\'lock1\',10);\n+----------------------+\n| GET_LOCK(\'lock1\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n \nSELECT IS_FREE_LOCK(\'lock1\'), IS_USED_LOCK(\'lock1\');\n+-----------------------+-----------------------+\n| IS_FREE_LOCK(\'lock1\') | IS_USED_LOCK(\'lock1\') |\n+-----------------------+-----------------------+\n| 0 | 46 |\n+-----------------------+-----------------------+\n \nSELECT IS_FREE_LOCK(\'lock2\'), IS_USED_LOCK(\'lock2\');\n+-----------------------+-----------------------+\n| IS_FREE_LOCK(\'lock2\') | IS_USED_LOCK(\'lock2\') |\n+-----------------------+-----------------------+\n| 1 | NULL |\n+-----------------------+-----------------------+\n \nFrom MariaDB 10.0.2, multiple locks can be held:\n \nSELECT GET_LOCK(\'lock2\',10);\n+----------------------+\n| GET_LOCK(\'lock2\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n \nSELECT IS_FREE_LOCK(\'lock1\'), IS_FREE_LOCK(\'lock2\');\n+-----------------------+-----------------------+\n| IS_FREE_LOCK(\'lock1\') | IS_FREE_LOCK(\'lock2\') |\n+-----------------------+-----------------------+\n| 0 | 0 |\n+-----------------------+-----------------------+\n \nSELECT RELEASE_LOCK(\'lock1\'), RELEASE_LOCK(\'lock2\');\n+-----------------------+-----------------------+\n| RELEASE_LOCK(\'lock1\') | RELEASE_LOCK(\'lock2\') |\n+-----------------------+-----------------------+\n| 1 | 1 |\n+-----------------------+-----------------------+\n \nBefore MariaDB 10.0.2, a connection could only hold a single\nlock:\n \nSELECT GET_LOCK(\'lock2\',10);\n+----------------------+\n| GET_LOCK(\'lock2\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n \nSELECT IS_FREE_LOCK(\'lock1\'), IS_FREE_LOCK(\'lock2\');\n+-----------------------+-----------------------+\n| IS_FREE_LOCK(\'lock1\') | IS_FREE_LOCK(\'lock2\') |\n+-----------------------+-----------------------+\n| 1 | 0 |\n+-----------------------+-----------------------+\n \nSELECT RELEASE_LOCK(\'lock1\'), RELEASE_LOCK(\'lock2\');\n+-----------------------+-----------------------+\n| RELEASE_LOCK(\'lock1\') | RELEASE_LOCK(\'lock2\') |\n+-----------------------+-----------------------+\n| NULL | 1 |\n+-----------------------+-----------------------+\n \nFrom MariaDB 10.0.2, it is possible to hold the same lock\nrecursively. This example is viewed using the\nmetadata_lock_info plugin:\n \nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n \nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n \nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n \n+-----------+---------------------+---------------+-----------+--------------+------------+\n| THREAD_ID | LOCK_MODE | LOCK_DURATION | LOCK_TYPE |\nTABLE_SCHEMA | TABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+------------+\n| 46 | MDL_SHARED_NO_WRITE | NULL | User lock | lock3 | |\n+-----------+---------------------+---------------+-----------+--------------+------------+\n \nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n| 1 |\n+-----------------------+\n \nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n \n+-----------+---------------------+---------------+-----------+--------------+------------+\n| THREAD_ID | LOCK_MODE | LOCK_DURATION | LOCK_TYPE |\nTABLE_SCHEMA | TABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+------------+\n| 46 | MDL_SHARED_NO_WRITE | NULL | User lock | lock3 | |\n+-----------+---------------------+---------------+-----------+--------------+------------+\n \nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n| 1 |\n+-----------------------+\n \nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n \nEmpty set (0.000 sec)\n \nTimeout example: Connection 1:\n \nSELECT GET_LOCK(\'lock4\',10);\n+----------------------+\n| GET_LOCK(\'lock4\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n \nConnection 2:\n \nSELECT GET_LOCK(\'lock4\',10);\n \nAfter 10 seconds...\n \n+----------------------+\n| GET_LOCK(\'lock4\',10) |\n+----------------------+\n| 0 |\n+----------------------+\n \nDeadlocks are automatically detected and resolved.\nConnection 1:\n \nSELECT GET_LOCK(\'lock5\',10); \n+----------------------+\n| GET_LOCK(\'lock5\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n \nConnection 2:\n \nSELECT GET_LOCK(\'lock6\',10);\n+----------------------+\n| GET_LOCK(\'lock6\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n \nConnection 1:\n \nSELECT GET_LOCK(\'lock6\',10); \n+----------------------+\n| GET_LOCK(\'lock6\',10) |\n+----------------------+\n| 0 |\n+----------------------+\n \nConnection 2:\n \nSELECT GET_LOCK(\'lock5\',10);\nERROR 1213 (40001): Deadlock found when trying to get lock;\n try restarting transaction\n \n\n\nURL: https://mariadb.com/kb/en/library/get_lock/','','https://mariadb.com/kb/en/library/get_lock/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (159,14,'INET6_ATON','INET6_ATON() has been available since MariaDB 10.0.12.\n \nSyntax\n------ \nINET6_ATON(expr)\n \nDescription\n----------- \nGiven an IPv6 or IPv4 network address as a string, returns a\nbinary string that represents the numeric value of the\naddress.\n \nNo trailing zone ID\'s or traling network masks are\npermitted. For IPv4 addresses, or IPv6 addresses with IPv4\naddress parts, no classful addresses or trailing port\nnumbers are permitted and octal numbers are not supported.\n \nThe returned binary string will be VARBINARY(16) or\nVARBINARY(4) for IPv6 and IPv4 addresses respectively.\n \nReturns NULL if the argument is not understood.\n \nExamples\n-------- \nSELECT HEX(INET6_ATON(\'10.0.1.1\'));\n+-----------------------------+\n| HEX(INET6_ATON(\'10.0.1.1\')) |\n+-----------------------------+\n| 0A000101 |\n+-----------------------------+\n \nSELECT HEX(INET6_ATON(\'48f3::d432:1431:ba23:846f\'));\n+----------------------------------------------+\n| HEX(INET6_ATON(\'48f3::d432:1431:ba23:846f\')) |\n+----------------------------------------------+\n| 48F3000000000000D4321431BA23846F |\n+----------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/inet6_aton/','','https://mariadb.com/kb/en/library/inet6_aton/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (160,14,'INET6_NTOA','INET6_NTOA() has been available from MariaDB 10.0.12.\n \nSyntax\n------ \nINET6_NTOA(expr)\n \nDescription\n----------- \nGiven an IPv6 or IPv4 network address as a numeric binary\nstring, returns the address as a nonbinary string in the\nconnection character set.\n \nThe return string is lowercase, and is platform independent,\nsince it does not use functions specific to the operating\nsystem. It has a maximum length of 39 characters.\n \nReturns NULL if the argument is not understood.\n \nExamples\n-------- \nSELECT INET6_NTOA(UNHEX(\'0A000101\'));\n+-------------------------------+\n| INET6_NTOA(UNHEX(\'0A000101\')) |\n+-------------------------------+\n| 10.0.1.1 |\n+-------------------------------+\n \nSELECT\nINET6_NTOA(UNHEX(\'48F3000000000000D4321431BA23846F\'));\n+-------------------------------------------------------+\n| INET6_NTOA(UNHEX(\'48F3000000000000D4321431BA23846F\')) |\n+-------------------------------------------------------+\n| 48f3::d432:1431:ba23:846f |\n+-------------------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/inet6_ntoa/','','https://mariadb.com/kb/en/library/inet6_ntoa/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (161,14,'INET_ATON','Syntax\n------ \nINET_ATON(expr)\n \nDescription\n----------- \nGiven the dotted-quad representation of an IPv4 network\naddress as a string,\nreturns an integer that represents the numeric value of the\naddress.\nAddresses may be 4- or 8-byte addresses.\n \nReturns NULL if the argument is not understood.\n \nExamples\n-------- \nSELECT INET_ATON(\'192.168.1.1\');\n+--------------------------+\n| INET_ATON(\'192.168.1.1\') |\n+--------------------------+\n| 3232235777 |\n+--------------------------+\n \nThis is calculated as follows: 192 x 2563 + 168 x 256 2 + 1\nx 256 + 1\n \n\n\nURL: https://mariadb.com/kb/en/library/inet_aton/','','https://mariadb.com/kb/en/library/inet_aton/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (162,14,'INET_NTOA','Syntax\n------ \nINET_NTOA(expr)\n \nDescription\n----------- \nGiven a numeric IPv4 network address in network byte order\n(4 or 8 byte),\nreturns the dotted-quad representation of the address as a\nstring.\n \nExamples\n-------- \nSELECT INET_NTOA(3232235777);\n+-----------------------+\n| INET_NTOA(3232235777) |\n+-----------------------+\n| 192.168.1.1 |\n+-----------------------+\n \n192.168.1.1 corresponds to 3232235777 since 192 x 2563 + 168\nx 256 2 + 1 x 256 + 1 = 3232235777\n \n\n\nURL: https://mariadb.com/kb/en/library/inet_ntoa/','','https://mariadb.com/kb/en/library/inet_ntoa/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (163,14,'IS_FREE_LOCK','Syntax\n------ \nIS_FREE_LOCK(str)\n \nDescription\n----------- \nChecks whether the lock named str is free to use (that is,\nnot locked).\nReturns 1 if the lock is free (no one is using the lock),\n 0 if the lock is in use, and NULL if an\nerror occurs (such as an incorrect argument, like an empty\nstring or NULL). str is case insensitive.\n \nIf the metadata_lock_info plugin is installed, the\nInformation Schema metadata_lock_info table contains\ninformation about locks of this kind (as well as metadata\nlocks).\n \nStatements using the IS_FREE_LOCK() function are not safe\nfor replication.\n \n\n\nURL: https://mariadb.com/kb/en/library/is_free_lock/','','https://mariadb.com/kb/en/library/is_free_lock/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (164,14,'IS_IPV4','IS_IPV4() has been available since MariaDB 10.0.12.\n \nSyntax\n------ \nIS_IPV4(expr)\n \nDescription\n----------- \nIf the expression is a valid IPv4 address, returns 1,\notherwise returns 0.\n \nIS_IPV4() is stricter than INET_ATON(), but as strict as\nINET6_ATON(), in determining the validity of an IPv4\naddress. This implies that if IS_IPV4 returns 1, the same\nexpression will always return a non-NULL result when passed\nto INET_ATON(), but that the reverse may not apply.\n \nExamples\n-------- \nSELECT IS_IPV4(\'1110.0.1.1\');\n+-----------------------+\n| IS_IPV4(\'1110.0.1.1\') |\n+-----------------------+\n| 0 |\n+-----------------------+\n \nSELECT IS_IPV4(\'48f3::d432:1431:ba23:846f\');\n+--------------------------------------+\n| IS_IPV4(\'48f3::d432:1431:ba23:846f\') |\n+--------------------------------------+\n| 0 |\n+--------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/is_ipv4/','','https://mariadb.com/kb/en/library/is_ipv4/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (165,14,'IS_IPV4_COMPAT','IS_IPV4_COMPAT() has been available since MariaDB 10.0.12.\n \nSyntax\n------ \nIS_IPV4_COMPAT(expr)\n \nDescription\n----------- \nReturns 1 if a given numeric binary string IPv6 address,\nsuch as returned by INET6_ATON(), is IPv4-compatible,\notherwise returns 0. \n \nExamples\n-------- \nSELECT IS_IPV4_COMPAT(INET6_ATON(\'::10.0.1.1\'));\n+------------------------------------------+\n| IS_IPV4_COMPAT(INET6_ATON(\'::10.0.1.1\')) |\n+------------------------------------------+\n| 1 |\n+------------------------------------------+\n \nSELECT\nIS_IPV4_COMPAT(INET6_ATON(\'::48f3::d432:1431:ba23:846f\'));\n+-----------------------------------------------------------+\n|\nIS_IPV4_COMPAT(INET6_ATON(\'::48f3::d432:1431:ba23:846f\'))\n|\n+-----------------------------------------------------------+\n| 0 |\n+-----------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/is_ipv4_compat/','','https://mariadb.com/kb/en/library/is_ipv4_compat/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (166,14,'IS_IPV4_MAPPED','IS_IPV4_MAPPED() has been available since MariaDB 10.0.12.\n \nSyntax\n------ \nIS_IPV4_MAPPED(expr)\n \nDescription\n----------- \nReturns 1 if a given a numeric binary string IPv6 address,\nsuch as returned by INET6_ATON(), is a valid IPv4-mapped\naddress, otherwise returns 0.\n \nExamples\n-------- \nSELECT IS_IPV4_MAPPED(INET6_ATON(\'::10.0.1.1\'));\n+------------------------------------------+\n| IS_IPV4_MAPPED(INET6_ATON(\'::10.0.1.1\')) |\n+------------------------------------------+\n| 0 |\n+------------------------------------------+\n \nSELECT IS_IPV4_MAPPED(INET6_ATON(\'::ffff:10.0.1.1\'));\n+-----------------------------------------------+\n| IS_IPV4_MAPPED(INET6_ATON(\'::ffff:10.0.1.1\')) |\n+-----------------------------------------------+\n| 1 |\n+-----------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/is_ipv4_mapped/','','https://mariadb.com/kb/en/library/is_ipv4_mapped/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (167,14,'IS_IPV6','IS_IPV6() has been available since MariaDB 10.0.12.\n \nSyntax\n------ \nIS_IPV6(expr)\n \nDescription\n----------- \nReturns 1 if the expression is a valid IPv6 address\nspecified as a string, otherwise returns 0. Does not\nconsider IPv4 addresses to be valid IPv6 addresses.\n \nExamples\n-------- \n SELECT IS_IPV6(\'48f3::d432:1431:ba23:846f\');\n+--------------------------------------+\n| IS_IPV6(\'48f3::d432:1431:ba23:846f\') |\n+--------------------------------------+\n| 1 |\n+--------------------------------------+\n1 row in set (0.02 sec)\n \nSELECT IS_IPV6(\'10.0.1.1\');\n+---------------------+\n| IS_IPV6(\'10.0.1.1\') |\n+---------------------+\n| 0 |\n+---------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/is_ipv6/','','https://mariadb.com/kb/en/library/is_ipv6/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (168,14,'IS_USED_LOCK','Syntax\n------ \nIS_USED_LOCK(str)\n \nDescription\n----------- \nChecks whether the lock named str is in use (that is,\nlocked). If so,\nit returns the connection identifier of the client that\nholds the\nlock. Otherwise, it returns NULL. str is case insensitive.\n \nIf the metadata_lock_info plugin is installed, the\nInformation Schema metadata_lock_info table contains\ninformation about locks of this kind (as well as metadata\nlocks).\n \nStatements using the IS_USED_LOCK() function are not safe\nfor replication.\n \n\n\nURL: https://mariadb.com/kb/en/library/is_used_lock/','','https://mariadb.com/kb/en/library/is_used_lock/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (169,14,'MASTER_GTID_WAIT','MASTER_GTID_WAIT() was included in MariaDB 10.0.9.\n \nSyntax\n------ \nMASTER_GTID_WAIT(gtid-list[, timeout)\n \nDescription\n----------- \nThis function takes a string containing a comma-separated\nlist of global transaction id\'s\n(similar to the value of, for example, gtid_binlog_pos). It\nwaits until the value of gtid_slave_pos has the same or\nhigher seq_no within all replication domains specified in\nthe gtid-list; in other words, it waits until the slave has\nreached the specified GTID position.\n \nAn optional second argument gives a timeout in seconds. If\nthe timeout\nexpires before the specified GTID position is reached, then\nthe function\nreturns -1. Passing NULL or a negative number for the\ntimeout means no timeout, and the function will wait\nindefinitely.\n \n If the wait completes without a timeout, 0 is returned.\nPassing NULL for the\n gtid-list makes the function return NULL immediately,\nwithout waiting.\n \nThe gtid-list may be the empty string, in which case\nMASTER_GTID_WAIT()\nreturns immediately. If the gtid-list contains fewer domains\nthan\ngtid_slave_pos, then only those domains are waited upon. If\ngtid-list\ncontains a domain that is not present in @@gtid_slave_pos,\nthen\nMASTER_GTID_WAIT() will wait until an event containing such\ndomain_id arrives\non the slave (or until timed out or killed).\n \nMASTER_GTID_WAIT() can be useful to ensure that a slave has\ncaught up to\na master. Simply take the value of gtid_binlog_pos on the\nmaster, and use it in a MASTER_GTID_WAIT() call on the\nslave; when the call completes, the slave\nwill have caught up with that master position.\n \nMASTER_GTID_WAIT() can also be used in client applications\ntogether with the\nlast_gtid session variable. This is useful in a\nread-scaleout replication setup, where the application\nwrites to a single master but divides the\nreads out to a number of slaves to distribute the load. In\nsuch a setup, there\nis a risk that an application could first do an update on\nthe master, and then\na bit later do a read on a slave, and if the slave is not\nfast enough, the\ndata read from the slave might not include the update just\nmade, possibly\nconfusing the application and/or the end-user. One way to\navoid this is to\nrequest the value of last_gtid on the master just after the\nupdate. Then\nbefore doing the read on the slave, do a MASTER_GTID_WAIT()\non the value\nobtained from the master; this will ensure that the read is\nnot performed\nuntil the slave has replicated sufficiently far for the\nupdate to have become\nvisible.\n \nNote that MASTER_GTID_WAIT() can be used even if the slave\nis configured not\nto use GTID for connections (CHANGE MASTER TO\nmaster_use_gtid=no). This is\nbecause from MariaDB 10, GTIDs are always logged on the\nmaster server, and\nalways recorded on the slave servers.\n \nDifferences to MASTER_POS_WAIT()\n \nMASTER_GTID_WAIT() is global; it waits for any master\nconnection to reach\n the specified GTID position. MASTER_POS_WAIT() works only\nagainst a\n specific connection. This also means that while\nMASTER_POS_WAIT() aborts if\n its master connection is terminated with STOP SLAVE or due\nto an error,\n MASTER_GTID_WAIT() continues to wait while slaves are\nstopped.\n \nMASTER_GTID_WAIT() can take its timeout as a floating-point\nvalue, so a\n timeout in fractional seconds is supported, eg.\nMASTER_GTID_WAIT(\"0-1-100\",\n 0.5). (The minimum wait is one microsecond, 0.000001\nseconds).\n \nMASTER_GTID_WAIT() allows one to specify a timeout of zero\nin order to do a\n non-blocking check to see if the slaves have progressed to\na specific GTID position\n (MASTER_POS_WAIT() takes a zero timeout as meaning an\ninfinite wait). To do\n an infinite MASTER_GTID_WAIT(), specify a negative timeout,\nor omit the\n timeout argument.\n \nMASTER_GTID_WAIT() does not return the number of events\nexecuted since the\n wait started, nor does it return NULL if a slave thread is\nstopped. It\n always returns either 0 for successful wait completed, or\n-1 for timeout\n reached (or NULL if the specified gtid-pos is NULL).\n \nSince MASTER_GTID_WAIT() looks only at the seq_no part of\nthe GTIDs, not the\nserver_id, care is needed if a slave becomes diverged from\nanother server so\nthat two different GTIDs with the same seq_no (in the same\ndomain) arrive at\nthe same server. This situation is in any case best avoided;\nsetting\ngtid_strict_mode is recommended, as this will prevent any\nsuch out-of-order sequence numbers from ever being\nreplicated on a slave.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/master_gtid_wait/','','https://mariadb.com/kb/en/library/master_gtid_wait/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (170,14,'MASTER_POS_WAIT','MASTER_POS_WAIT was introduced in MariaDB 10.0.9.\n \nSyntax\n------ \nMASTER_POS_WAIT(log_name,log_pos[,timeout,[\"connection_name\"]])\n \nDescription\n----------- \nThis function is useful in replication for controlling\nmaster/slave synchronization. It blocks until the slave has\nread and applied all updates up to the specified position\n(log_name,log_pos) in the master log. The return value is\nthe number of log events the slave had to wait for to\nadvance to the specified position. The function returns NULL\nif\nthe slave SQL thread is not started, the slave\'s master\ninformation is not\ninitialized, the arguments are incorrect, or an error\noccurs. It returns -1 if\nthe timeout has been exceeded. If the slave SQL thread stops\nwhile\n MASTER_POS_WAIT() is waiting, the function returns NULL. If\nthe slave is past the specified position, the function\nreturns immediately.\n \nIf a timeout value is specified, MASTER_POS_WAIT() stops\nwaiting when timeout seconds have elapsed. timeout must be\ngreater than 0; a\nzero or negative timeout means no timeout.\n \nThe connection_name is used when you are using\nmulti-source-replication. If you don\'t specify it, it\'s\nset to the value of the default_master_connection system\nvariable.\n \nStatements using the MASTER_POS_WAIT() function are not safe\nfor replication.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/master_pos_wait/','','https://mariadb.com/kb/en/library/master_pos_wait/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (171,14,'NAME_CONST','Syntax\n------ \nNAME_CONST(name,value)\n \nDescription\n----------- \nReturns the given value. When used to produce a result set\ncolumn,\n NAME_CONST() causes the column to have the given name. The\narguments should be constants.\n \nThis function is used internally when replicating stored\nprocedures. It makes little sense to use it explicitly in\nSQL statements, and it was not supposed to be used like\nthat.\n \nSELECT NAME_CONST(\'myname\', 14);\n+--------+\n| myname |\n+--------+\n| 14 |\n+--------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/name_const/','','https://mariadb.com/kb/en/library/name_const/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (172,14,'RELEASE_LOCK','Syntax\n------ \nRELEASE_LOCK(str)\n \nDescription\n----------- \nReleases the lock named by the string str that was obtained\nwith GET_LOCK(). Returns 1 if the lock was released, 0 if\nthe lock was not established by this thread (in which case\nthe lock is not\nreleased), and NULL if the named lock did not exist. The\nlock does not exist if it was never obtained by a call to\nGET_LOCK() or if it has previously been released.\n \nMariaDB until 10.0.1\n \nBefore 10.0.2, GET_LOCK() released the existing lock, if\nany. Since 10.0.2 this does not happen, because multiple\nlocks are allowed.\n \nstr is case insensitive. If str is an empty string or NULL,\nRELEASE_LOCK() returns NULL and does nothing.\n \nStatements using the RELEASE_LOCK() function are not safe\nfor replication.\n \nThe DO statement is convenient to use with RELEASE_LOCK().\n \nExamples\n-------- \nConnection1:\n \nSELECT GET_LOCK(\'lock1\',10);\n+----------------------+\n| GET_LOCK(\'lock1\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n \nConnection 2:\n \nSELECT GET_LOCK(\'lock2\',10);\n+----------------------+\n| GET_LOCK(\'lock2\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n \nConnection 1:\n \nSELECT RELEASE_LOCK(\'lock1\'), RELEASE_LOCK(\'lock2\'),\nRELEASE_LOCK(\'lock3\');\n+-----------------------+-----------------------+-----------------------+\n| RELEASE_LOCK(\'lock1\') | RELEASE_LOCK(\'lock2\') |\nRELEASE_LOCK(\'lock3\') |\n+-----------------------+-----------------------+-----------------------+\n| 1 | 0 | NULL |\n+-----------------------+-----------------------+-----------------------+\n \nFrom MariaDB 10.0.2, it is possible to hold the same lock\nrecursively. This example is viewed using the\nmetadata_lock_info plugin:\n \nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n \nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n \nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n \n+-----------+---------------------+---------------+-----------+--------------+------------+\n| THREAD_ID | LOCK_MODE | LOCK_DURATION | LOCK_TYPE |\nTABLE_SCHEMA | TABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+------------+\n| 46 | MDL_SHARED_NO_WRITE | NULL | User lock | lock3 | |\n+-----------+---------------------+---------------+-----------+--------------+------------+\n \nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n| 1 |\n+-----------------------+\n \nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n \n+-----------+---------------------+---------------+-----------+--------------+------------+\n| THREAD_ID | LOCK_MODE | LOCK_DURATION | LOCK_TYPE |\nTABLE_SCHEMA | TABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+------------+\n| 46 | MDL_SHARED_NO_WRITE | NULL | User lock | lock3 | |\n+-----------+---------------------+---------------+-----------+--------------+------------+\n \nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n| 1 |\n+-----------------------+\n \nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n \nEmpty set (0.000 sec)\n \n\n\nURL: https://mariadb.com/kb/en/library/release_lock/','','https://mariadb.com/kb/en/library/release_lock/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (173,14,'SLEEP','Syntax\n------ \nSLEEP(duration)\n \nDescription\n----------- \nSleeps (pauses) for the number of seconds given by the\nduration argument, then\nreturns 0. If SLEEP() is interrupted, it\nreturns 1. The duration may have a fractional part given in\nmicroseconds.\n \nStatements using the SLEEP() function are not safe for\nreplication.\n \nExample\n \nSELECT SLEEP(5.5);\n+------------+\n| SLEEP(5.5) |\n+------------+\n| 0 |\n+------------+\n1 row in set (5.50 sec)\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/sleep/','','https://mariadb.com/kb/en/library/sleep/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (174,14,'UUID','Syntax\n------ \nUUID()\n \nDescription\n----------- \nReturns a Universal Unique Identifier (UUID) generated\naccording to \"DCE 1.1:\nRemote Procedure Call\" (Appendix A) CAE (Common\nApplications Environment)\nSpecifications published by The Open Group in October\n1997 \n(Document Number C706).\n \nA UUID is designed as a number that is globally unique in\nspace and time. Two\ncalls to UUID() are expected to generate two different\nvalues, even if these calls are performed on two separate\ncomputers that are\nnot connected to each other.\n \nA UUID is a 128-bit number represented by a utf8 string of\nfive\nhexadecimal numbers in aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\nformat:\nThe first three numbers are generated from a timestamp.\nThe fourth number preserves temporal uniqueness in case the\ntimestamp value\n loses monotonicity (for example, due to daylight saving\ntime).\nThe fifth number is an IEEE 802 node number that provides\nspatial uniqueness.\n A random number is substituted if the latter is not\navailable (for example,\n because the host computer has no Ethernet card, or we do\nnot know how to find\n the hardware address of an interface on your operating\nsystem). In this case,\n spatial uniqueness cannot be guaranteed. Nevertheless, a\ncollision should\n have very low probability.\n \nCurrently, the MAC address of an interface is taken into\naccount only on FreeBSD and Linux. On other operating\nsystems, MariaDB uses a randomly generated 48-bit number.\n \nStatements using the UUID() function are not safe for\nreplication.\n \nUUID() results are intended to be unique, but cannot always\nbe relied upon to unpredictable and unguessable, so should\nnot be relied upon for these purposes.\n \nExamples\n-------- \nSELECT UUID();\n+--------------------------------------+\n| UUID() |\n+--------------------------------------+\n| cd41294a-afb0-11df-bc9b-00241dd75637 |\n+--------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/uuid/','','https://mariadb.com/kb/en/library/uuid/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (175,14,'UUID_SHORT','Syntax\n------ \nUUID_SHORT()\n \nDescription\n----------- \nReturns a \"short\" universal identifier as a 64-bit\nunsigned integer (rather\nthan a string-form 128-bit identifier as returned by the\nUUID() function).\n \nThe value of UUID_SHORT() is guaranteed to be unique if the\nfollowing conditions hold:\nThe server_id of the current host is unique among your set\nof master and\n slave servers\nserver_id is between 0 and 255\nYou don\'t set back your system time for your server between\nmysqld restarts\nYou do not invoke UUID_SHORT() on average more than 16\n million times per second between mysqld restarts\n \nThe UUID_SHORT() return value is constructed this way:\n \n (server_id & 255) \n\nURL: https://mariadb.com/kb/en/library/uuid_short/','','https://mariadb.com/kb/en/library/uuid_short/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (176,14,'VALUES / VALUE','Syntax\n------ \nVALUE(col_name) \n \nMariaDB until 10.3.2\n \nVALUES(col_name) \n \nDescription\n----------- \nIn an INSERT ... ON DUPLICATE KEY UPDATE statement, you can\nuse the VALUES(col_name) function in the UPDATE clause to\nrefer to column values from the INSERT portion of the\nstatement. In other words, VALUES(col_name) in the UPDATE\nclause refers to the value of col_name that would be\ninserted, had no duplicate-key conflict occurred. This\nfunction is especially useful in multiple-row inserts.\n \nThe VALUES() function is meaningful only in INSERT ... ON\nDUPLICATE KEY UPDATE statements and returns NULL otherwise.\n \nIn MariaDB 10.3.3 this function was renamed to VALUE(),\nbecause it\'s incompatible with the standard Table Value\nConstructors syntax, implemented in MariaDB 10.3.3.\n \nThe VALUES() function can still be used even from MariaDB\n10.3.3, but only in INSERT ... ON DUPLICATE KEY UPDATE\nstatements; it\'s a syntax error otherwise.\n \nExamples\n-------- \nINSERT INTO t (a,b,c) VALUES (1,2,3),(4,5,6)\n ON DUPLICATE KEY UPDATE c=VALUE(a)+VALUE(b);\n \nMariaDB until 10.3.2\n \nINSERT INTO t (a,b,c) VALUES (1,2,3),(4,5,6)\n ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/values-value/','','https://mariadb.com/kb/en/library/values-value/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (177,15,'!','Syntax\n------ \nNOT, !\n \nDescription\n----------- \nLogical NOT. Evaluates to 1 if the operand is 0, to 0 if the\noperand\nis non-zero, and NOT NULL returns NULL.\n \nBy default, the ! operator has a higher precedence. If the\nHIGH_NOT_PRECEDENCE SQL_MODE flag is set, NOT and ! have the\nsame precedence.\n \nExamples\n-------- \nSELECT NOT 10;\n \n+--------+\n| NOT 10 |\n+--------+\n| 0 |\n+--------+\n \nSELECT NOT 0;\n \n+-------+\n| NOT 0 |\n+-------+\n| 1 |\n+-------+\n \nSELECT NOT NULL;\n \n+----------+\n| NOT NULL |\n+----------+\n| NULL |\n+----------+\n \nSELECT ! (1+1);\n+---------+\n| ! (1+1) |\n+---------+\n| 0 |\n+---------+\n \nSELECT ! 1+1;\n \n+-------+\n| ! 1+1 |\n+-------+\n| 1 |\n+-------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/not/','','https://mariadb.com/kb/en/library/not/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (178,15,'&amp;&amp;','Syntax\n------ \nAND, &&\n \nDescription\n----------- \nLogical AND. Evaluates to 1 if all operands are non-zero and\nnot NULL,\nto 0 if one or more operands are 0, otherwise NULL is\nreturned.\n \nFor this operator, short-circuit evaluation can be used.\n \nExamples\n-------- \nSELECT 1 && 1;\n \n+--------+\n| 1 && 1 |\n+--------+\n| 1 |\n+--------+\n \nSELECT 1 && 0;\n \n+--------+\n| 1 && 0 |\n+--------+\n| 0 |\n+--------+\n \nSELECT 1 && NULL;\n \n+-----------+\n| 1 && NULL |\n+-----------+\n| NULL |\n+-----------+\n \nSELECT 0 && NULL;\n \n+-----------+\n| 0 && NULL |\n+-----------+\n| 0 |\n+-----------+\n \nSELECT NULL && 0;\n \n+-----------+\n| NULL && 0 |\n+-----------+\n| 0 |\n+-----------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/and/','','https://mariadb.com/kb/en/library/and/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (179,15,'||','Syntax\n------ \nOR, ||\n \nDescription\n----------- \nLogical OR. When both operands are non-NULL, the result is 1\nif any\noperand is non-zero, and 0 otherwise. With a NULL operand,\nthe result\nis 1 if the other operand is non-zero, and NULL otherwise.\nIf both\noperands are NULL, the result is NULL.\n \nFor this operator, short-circuit evaluation can be used.\n \nNote that, if the PIPES_AS_CONCAT SQL_MODE is set, || is\nused as a string concatenation operator. This means that a\n|| b is the same as CONCAT(a,b). See CONCAT() for details.\n \nOracle Mode\n \nIn Oracle mode from MariaDB 10.3, || ignores NULL.\n \nExamples\n-------- \nSELECT 1 || 1;\n \n+--------+\n| 1 || 1 |\n+--------+\n| 1 |\n+--------+\n \nSELECT 1 || 0;\n \n+--------+\n| 1 || 0 |\n+--------+\n| 1 |\n+--------+\n \nSELECT 0 || 0;\n \n+--------+\n| 0 || 0 |\n+--------+\n| 0 |\n+--------+\n \nSELECT 0 || NULL;\n \n+-----------+\n| 0 || NULL |\n+-----------+\n| NULL |\n+-----------+\n \nSELECT 1 || NULL;\n \n+-----------+\n| 1 || NULL |\n+-----------+\n| 1 |\n+-----------+\n \nIn Oracle mode, from MariaDB 10.3:\n \nSELECT 0 || NULL;\n \n+-----------+\n| 0 || NULL |\n+-----------+\n| 0 |\n+-----------+\n \n\n\nURL: https://mariadb.com/kb/en/library/or/','','https://mariadb.com/kb/en/library/or/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (180,15,'XOR','Syntax\n------ \nXOR\n \nDescription\n----------- \nXOR stands for eXclusive OR. Returns NULL if either operand\nis NULL. For non-NULL\noperands, evaluates to 1 if an odd number of operands is\nnon-zero,\notherwise 0 is returned.\n \nExamples\n-------- \nSELECT 1 XOR 1;\n \n+---------+\n| 1 XOR 1 |\n+---------+\n| 0 |\n+---------+\n \nSELECT 1 XOR 0;\n \n+---------+\n| 1 XOR 0 |\n+---------+\n| 1 |\n+---------+\n \nSELECT 1 XOR NULL;\n \n+------------+\n| 1 XOR NULL |\n+------------+\n| NULL |\n+------------+\n \nIn the following example, the right 1 XOR 1 is evaluated\nfirst, and returns 0. Then, 1 XOR 0 is evaluated, and 1 is\nreturned.\n \nSELECT 1 XOR 1 XOR 1;\n \n+---------------+\n| 1 XOR 1 XOR 1 |\n+---------------+\n| 1 |\n+---------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/xor/','','https://mariadb.com/kb/en/library/xor/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (181,15,'Assignment Operator (=)','Syntax\n------ \nidentifier = expr\n \nDescription\n----------- \nThe equal sign is used as both an assignment operator in\ncertain contexts, and as a comparison operator. When used as\nassignment operator, the value on the right is assigned to\nthe variable (or column, in some contexts) on the left.\n \nSince its use can be ambiguous, unlike the := assignment\noperator, the = assignment operator cannot be used in all\ncontexts, and is only valid as part of a SET statement, or\nthe SET clause of an UPDATE statement\n \nThis operator works with both user-defined variables and\nlocal variables.\n \nExamples\n-------- \nUPDATE table_name SET x = 2 WHERE x > 100;\n \nSET @x = 1, @y := 2;\n \n\n \n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/assignment-operators-assignment-operator/','','https://mariadb.com/kb/en/library/assignment-operators-assignment-operator/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (182,15,'Assignment Operator (:=)','Syntax\n------ \nvar_name := expr\n \nDescription\n----------- \nAssignment operator for assigning a value. The value on the\nright is assigned to the variable on left.\n \nUnlike the = operator, := can always be used to assign a\nvalue to a variable.\n \nThis operator works with both user-defined variables and\nlocal variables.\n \nWhen assigning the same value to several variables,\nLAST_VALUE() can be useful.\n \nExamples\n-------- \n SELECT @x := 10;\n \n+----------+\n| @x := 10 |\n+----------+\n| 10 |\n+----------+\n \nSELECT @x, @y := @x;\n \n+------+----------+\n| @x | @y := @x |\n+------+----------+\n| 10 | 10 |\n+------+----------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/assignment-operator/','','https://mariadb.com/kb/en/library/assignment-operator/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (183,16,'Stored Aggregate Functions','The ability to create stored aggregate functions was added\nin MariaDB 10.3.3.\n \nAggregate functions are functions that are computed over a\nsequence of rows and return one result for the sequence of\nrows.\n \nCreating a custom aggregate function is done using the\nCREATE FUNCTION statement with two main differences:\nThe addition of the AGGREGATE keyword, so CREATE AGGREGATE\nFUNCTION\nThe FETCH GROUP NEXT ROW instruction inside the loop\nOracle PL/SQL compatibility using SQL/PL is provided\n \nStandard Syntax\n \nCREATE AGGREGATE FUNCTION function_name (parameters) RETURNS\nreturn_type\nBEGIN\n All types of declarations\n DECLARE CONTINUE HANDLER FOR NOT FOUND RETURN return_val;\n LOOP\n FETCH GROUP NEXT ROW; // fetches next row from table\n other instructions\n END LOOP;\nEND\n \nStored aggregate functions were a 2016 Google Summer of Code\nproject by Varun Gupta.\n \nUsing SQL/PL\n \nSET sql_mode=Oracle;\nDELIMITER //\n \nCREATE AGGREGATE FUNCTION function_name (parameters) RETURN\nreturn_type\n declarations\nBEGIN\n LOOP\n FETCH GROUP NEXT ROW; -- fetches next row from table\n -- other instructions\n \n END LOOP;\nEXCEPTION\n WHEN NO_DATA_FOUND THEN\n RETURN return_val;\nEND //\n \nDELIMITER ;\n \nExamples\n-------- \nFirst a simplified example:\n \nCREATE TABLE marks(stud_id INT, grade_count INT);\n \nINSERT INTO marks VALUES (1,6), (2,4), (3,7), (4,5), (5,8);\n \nSELECT * FROM marks;\n \n+---------+-------------+\n| stud_id | grade_count |\n+---------+-------------+\n| 1 | 6 |\n| 2 | 4 |\n| 3 | 7 |\n| 4 | 5 |\n| 5 | 8 |\n+---------+-------------+\n \nDELIMITER //\nCREATE AGGREGATE FUNCTION IF NOT EXISTS aggregate_count(x\nINT) RETURNS INT\nBEGIN\n DECLARE count_students INT DEFAULT 0;\n \n DECLARE CONTINUE HANDLER FOR NOT FOUND\n RETURN count_students;\n \n LOOP\n FETCH GROUP NEXT ROW;\n \n IF x THEN\n SET count_students = count_students+1;\n \n END IF;\n \n END LOOP;\n \nEND //\nDELIMITER ;\n \nA non-trivial example that cannot easily be rewritten using\nexisting functions:\n \nDELIMITER //\nCREATE AGGREGATE FUNCTION medi_int(x INT) RETURNS DOUBLE\nBEGIN\n DECLARE CONTINUE HANDLER FOR NOT FOUND\n BEGIN\n DECLARE res DOUBLE;\n \n DECLARE cnt INT DEFAULT (SELECT COUNT(*) FROM tt);\n DECLARE lim INT DEFAULT (cnt-1) DIV 2;\n \n IF cnt % 2 = 0 THEN\n SET res = (SELECT AVG(a) FROM (SELECT a FROM tt ORDER BY a\nLIMIT lim,2) ttt);\n ELSE\n SET res = (SELECT a FROM tt ORDER BY a LIMIT lim,1);\n END IF;\n \n DROP TEMPORARY TABLE tt;\n \n RETURN res;\n \n END;\n \n CREATE TEMPORARY TABLE tt (a INT);\n LOOP\n FETCH GROUP NEXT ROW;\n \n INSERT INTO tt VALUES (x);\n END LOOP;\n \nEND //\nDELIMITER ;\n \nSQL/PL Example\n \nThis uses the same marks table as created above.\n \nSET sql_mode=Oracle;\n \nDELIMITER //\n \nCREATE AGGREGATE FUNCTION aggregate_count(x INT) RETURN INT\nAS count_students INT DEFAULT 0;\n \nBEGIN\n LOOP\n FETCH GROUP NEXT ROW;\n \n IF x THEN\n SET count_students := count_students+1;\n \n END IF;\n \n END LOOP;\n \nEXCEPTION\n WHEN NO_DATA_FOUND THEN\n RETURN count_students;\n \nEND aggregate_count //\nDELIMITER ;\n \nSELECT aggregate_count(stud_id) FROM marks;\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/stored-aggregate-functions/','','https://mariadb.com/kb/en/library/stored-aggregate-functions/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (184,16,'AVG','Syntax\n------ \nAVG([DISTINCT] expr)\n \nDescription\n----------- \nReturns the average value of expr. The DISTINCT option can\nbe used to return the average of the distinct values of\nexpr. NULL values are ignored. It is an aggregate function,\nand so can be used with the GROUP BY clause.\n \nAVG() returns NULL if there were no matching rows.\n \nFrom MariaDB 10.2.0, AVG() can be used as a window function.\n \nExamples\n-------- \nCREATE TABLE sales (sales_value INT);\n \nINSERT INTO sales VALUES(10),(20),(20),(40);\n \nSELECT AVG(sales_value) FROM sales;\n \n+------------------+\n| AVG(sales_value) |\n+------------------+\n| 22.5000 |\n+------------------+\n \nSELECT AVG(DISTINCT(sales_value)) FROM sales;\n \n+----------------------------+\n| AVG(DISTINCT(sales_value)) |\n+----------------------------+\n| 23.3333 |\n+----------------------------+\n \nCommonly, AVG() is used with a GROUP BY clause:\n \nCREATE TABLE student (name CHAR(10), test CHAR(10), score\nTINYINT); \n \nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73), \n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31), \n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88), \n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n \nSELECT name, AVG(score) FROM student GROUP BY name;\n \n+---------+------------+\n| name | AVG(score) |\n+---------+------------+\n| Chun | 74.0000 |\n| Esben | 37.0000 |\n| Kaolin | 72.0000 |\n| Tatiana | 85.0000 |\n+---------+------------+\n \nBe careful to avoid this common mistake, not grouping\ncorrectly and returning mismatched data: \n \nSELECT name,test,AVG(score) FROM student;\n \n+------+------+------------+\n| name | test | MIN(score) |\n+------+------+------------+\n| Chun | SQL | 31 |\n+------+------+------------+\n \nAs a window function:\n \nCREATE TABLE student_test (name CHAR(10), test CHAR(10),\nscore TINYINT); \n \nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73), \n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31), \n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88), \n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n \nSELECT name, test, score, AVG(score) OVER (PARTITION BY\ntest) \n AS average_by_test FROM student_test;\n \n+---------+--------+-------+-----------------+\n| name | test | score | average_by_test |\n+---------+--------+-------+-----------------+\n| Chun | SQL | 75 | 65.2500 |\n| Chun | Tuning | 73 | 68.7500 |\n| Esben | SQL | 43 | 65.2500 |\n| Esben | Tuning | 31 | 68.7500 |\n| Kaolin | SQL | 56 | 65.2500 |\n| Kaolin | Tuning | 88 | 68.7500 |\n| Tatiana | SQL | 87 | 65.2500 |\n| Tatiana | Tuning | 83 | 68.7500 |\n+---------+--------+-------+-----------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/avg/','','https://mariadb.com/kb/en/library/avg/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (185,16,'BIT_AND','Syntax\n------ \nBIT_AND(expr)\n \nDescription\n----------- \nReturns the bitwise AND of all bits in expr. The calculation\nis performed with 64-bit (BIGINT) precision. It is an\naggregate function, and so can be used with the GROUP BY\nclause.\n \nFrom MariaDB 10.2.0, BIT_AND() can be used as a window\nfunction.\n \nExamples\n-------- \nCREATE TABLE vals (x INT);\n \nINSERT INTO vals VALUES(111),(110),(100);\n \nSELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals;\n \n+------------+-----------+------------+\n| BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+------------+-----------+------------+\n| 100 | 111 | 101 |\n+------------+-----------+------------+\n \nAs an aggregate function:\n \nCREATE TABLE vals2 (category VARCHAR(1), x INT);\n \nINSERT INTO vals2 VALUES\n (\'a\',111),(\'a\',110),(\'a\',100),\n (\'b\',\'000\'),(\'b\',001),(\'b\',011);\n \nSELECT category, BIT_AND(x), BIT_OR(x), BIT_XOR(x) \n FROM vals GROUP BY category;\n \n+----------+------------+-----------+------------+\n| category | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+----------+------------+-----------+------------+\n| a | 100 | 111 | 101 |\n| b | 0 | 11 | 10 |\n+----------+------------+-----------+------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/bit_and/','','https://mariadb.com/kb/en/library/bit_and/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (186,16,'BIT_OR','Syntax\n------ \nBIT_OR(expr)\n \nDescription\n----------- \nReturns the bitwise OR of all bits in expr. The calculation\nis performed with 64-bit (BIGINT) precision. It is an\naggregate function, and so can be used with the GROUP BY\nclause.\n \nFrom MariaDB 10.2.0, BIT_OR can be used as a window\nfunction.\n \nExamples\n-------- \nCREATE TABLE vals (x INT);\n \nINSERT INTO vals VALUES(111),(110),(100);\n \nSELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals;\n \n+------------+-----------+------------+\n| BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+------------+-----------+------------+\n| 100 | 111 | 101 |\n+------------+-----------+------------+\n \nAs an aggregate function:\n \nCREATE TABLE vals2 (category VARCHAR(1), x INT);\n \nINSERT INTO vals2 VALUES\n (\'a\',111),(\'a\',110),(\'a\',100),\n (\'b\',\'000\'),(\'b\',001),(\'b\',011);\n \nSELECT category, BIT_AND(x), BIT_OR(x), BIT_XOR(x) \n FROM vals GROUP BY category;\n \n+----------+------------+-----------+------------+\n| category | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+----------+------------+-----------+------------+\n| a | 100 | 111 | 101 |\n| b | 0 | 11 | 10 |\n+----------+------------+-----------+------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/bit_or/','','https://mariadb.com/kb/en/library/bit_or/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (187,16,'BIT_XOR','Syntax\n------ \nBIT_XOR(expr)\n \nDescription\n----------- \nReturns the bitwise XOR of all bits in expr. The calculation\nis performed with 64-bit (BIGINT) precision. It is an\naggregate function, and so can be used with the GROUP BY\nclause.\n \nFrom MariaDB 10.2.0, BIT_XOR() can be used as a window\nfunction.\n \nExamples\n-------- \nCREATE TABLE vals (x INT);\n \nINSERT INTO vals VALUES(111),(110),(100);\n \nSELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals;\n \n+------------+-----------+------------+\n| BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+------------+-----------+------------+\n| 100 | 111 | 101 |\n+------------+-----------+------------+\n \nAs an aggregate function:\n \nCREATE TABLE vals2 (category VARCHAR(1), x INT);\n \nINSERT INTO vals2 VALUES\n (\'a\',111),(\'a\',110),(\'a\',100),\n (\'b\',\'000\'),(\'b\',001),(\'b\',011);\n \nSELECT category, BIT_AND(x), BIT_OR(x), BIT_XOR(x) \n FROM vals GROUP BY category;\n \n+----------+------------+-----------+------------+\n| category | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+----------+------------+-----------+------------+\n| a | 100 | 111 | 101 |\n| b | 0 | 11 | 10 |\n+----------+------------+-----------+------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/bit_xor/','','https://mariadb.com/kb/en/library/bit_xor/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (188,16,'COUNT','Syntax\n------ \nCOUNT(expr)\n \nDescription\n----------- \nReturns a count of the number of non-NULL values of expr in\nthe rows retrieved by a SELECT statement. The result is a\nBIGINT value. It is an aggregate function, and so can be\nused with the GROUP BY clause.\n \nCOUNT(*) counts the total number of rows in a table.\n \nCOUNT() returns 0 if there were no matching rows.\n \nFrom MariaDB 10.2.0, COUNT() can be used as a window\nfunction.\n \nExamples\n-------- \nCREATE TABLE student (name CHAR(10), test CHAR(10), score\nTINYINT); \n \nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73), \n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31), \n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88), \n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n \nSELECT COUNT(*) FROM student;\n \n+----------+\n| COUNT(*) |\n+----------+\n| 8 |\n+----------+\n \nCOUNT(DISTINCT) example:\n \nSELECT COUNT(DISTINCT (name)) FROM student;\n \n+------------------------+\n| COUNT(DISTINCT (name)) |\n+------------------------+\n| 4 |\n+------------------------+\n \nAs a window function\n \nCREATE OR REPLACE TABLE student_test (name CHAR(10), test\nCHAR(10), score TINYINT);\n \nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73), \n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31), \n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88), \n (\'Tatiana\', \'SQL\', 87);\n \nSELECT name, test, score, COUNT(score) OVER (PARTITION BY\nname) \n AS tests_written FROM student_test;\n \n+---------+--------+-------+---------------+\n| name | test | score | tests_written |\n+---------+--------+-------+---------------+\n| Chun | SQL | 75 | 2 |\n| Chun | Tuning | 73 | 2 |\n| Esben | SQL | 43 | 2 |\n| Esben | Tuning | 31 | 2 |\n| Kaolin | SQL | 56 | 2 |\n| Kaolin | Tuning | 88 | 2 |\n| Tatiana | SQL | 87 | 1 |\n+---------+--------+-------+---------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/count/','','https://mariadb.com/kb/en/library/count/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (189,16,'GROUP_CONCAT','Syntax\n------ \nGROUP_CONCAT(expr)\n \nDescription\n----------- \nThis function returns a string result with the concatenated\nnon-NULL\nvalues from a group. It returns NULL if there are no\nnon-NULL values.\n \nThe maximum returned length in bytes is determined by the\ngroup_concat_max_len server system variable, which defaults\nto 1M (>= MariaDB 10.2.4) or 1K (\n\nURL: https://mariadb.com/kb/en/library/group_concat/','','https://mariadb.com/kb/en/library/group_concat/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (190,16,'MAX','Syntax\n------ \nMAX([DISTINCT] expr)\n \nDescription\n----------- \nReturns the largest, or maximum, value of expr. MAX() can\nalso take a string\nargument in which case it returns the maximum string value.\nThe DISTINCT\nkeyword can be used to find the maximum of the distinct\nvalues of expr,\nhowever, this produces the same result as omitting DISTINCT.\n \nNote that SET and ENUM fields are currently compared by\ntheir string value rather than their relative position in\nthe set, so MAX() may produce a different highest result\nthan ORDER BY DESC.\n \nIt is an aggregate function, and so can be used with the\nGROUP BY clause.\n \nFrom MariaDB 10.2.2, MAX() can be used as a window function.\n \nMAX() returns NULL if there were no matching rows.\n \nExamples\n-------- \nCREATE TABLE student (name CHAR(10), test CHAR(10), score\nTINYINT); \n \nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73), \n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31), \n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88), \n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n \nSELECT name, MAX(score) FROM student GROUP BY name;\n \n+---------+------------+\n| name | MAX(score) |\n+---------+------------+\n| Chun | 75 |\n| Esben | 43 |\n| Kaolin | 88 |\n| Tatiana | 87 |\n+---------+------------+\n \nMAX string:\n \nSELECT MAX(name) FROM student;\n \n+-----------+\n| MAX(name) |\n+-----------+\n| Tatiana |\n+-----------+\n \nBe careful to avoid this common mistake, not grouping\ncorrectly and returning mismatched data: \n \nSELECT name,test,MAX(SCORE) FROM student;\n \n+------+------+------------+\n| name | test | MAX(SCORE) |\n+------+------+------------+\n| Chun | SQL | 88 |\n+------+------+------------+\n \nDifference between ORDER BY DESC and MAX():\n \nCREATE TABLE student2(name CHAR(10),grade\nENUM(\'b\',\'c\',\'a\'));\n \nINSERT INTO student2\nVALUES(\'Chun\',\'b\'),(\'Esben\',\'c\'),(\'Kaolin\',\'a\');\n \nSELECT MAX(grade) FROM student2;\n \n+------------+\n| MAX(grade) |\n+------------+\n| c |\n+------------+\n \nSELECT grade FROM student2 ORDER BY grade DESC LIMIT 1;\n \n+-------+\n| grade |\n+-------+\n| a |\n+-------+\n \nAs a window function:\n \nCREATE OR REPLACE TABLE student_test (name CHAR(10), test\nCHAR(10), score TINYINT);\nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73), \n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31), \n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88), \n (\'Tatiana\', \'SQL\', 87);\n \nSELECT name, test, score, MAX(score) \n OVER (PARTITION BY name) AS highest_score FROM\nstudent_test;\n \n+---------+--------+-------+---------------+\n| name | test | score | highest_score |\n+---------+--------+-------+---------------+\n| Chun | SQL | 75 | 75 |\n| Chun | Tuning | 73 | 75 |\n| Esben | SQL | 43 | 43 |\n| Esben | Tuning | 31 | 43 |\n| Kaolin | SQL | 56 | 88 |\n| Kaolin | Tuning | 88 | 88 |\n| Tatiana | SQL | 87 | 87 |\n+---------+--------+-------+---------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/max/','','https://mariadb.com/kb/en/library/max/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (191,16,'MIN','Syntax\n------ \nMIN([DISTINCT] expr)\n \nDescription\n----------- \nReturns the minimum value of expr. MIN() may take a string\nargument, in which case it returns the minimum string value.\nThe DISTINCT\nkeyword can be used to find the minimum of the distinct\nvalues of expr,\nhowever, this produces the same result as omitting DISTINCT.\n \nNote that SET and ENUM fields are currently compared by\ntheir string value rather than their relative position in\nthe set, so MIN() may produce a different lowest result than\nORDER BY ASC.\n \nIt is an aggregate function, and so can be used with the\nGROUP BY clause.\n \nFrom MariaDB 10.2.2, MIN() can be used as a window function.\n \nMIN() returns NULL if there were no matching rows.\n \nExamples\n-------- \nCREATE TABLE student (name CHAR(10), test CHAR(10), score\nTINYINT); \n \nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73), \n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31), \n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88), \n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n \nSELECT name, MIN(score) FROM student GROUP BY name;\n \n+---------+------------+\n| name | MIN(score) |\n+---------+------------+\n| Chun | 73 |\n| Esben | 31 |\n| Kaolin | 56 |\n| Tatiana | 83 |\n+---------+------------+\n \nMIN() with a string:\n \nSELECT MIN(name) FROM student;\n \n+-----------+\n| MIN(name) |\n+-----------+\n| Chun |\n+-----------+\n \nBe careful to avoid this common mistake, not grouping\ncorrectly and returning mismatched data: \n \nSELECT name,test,MIN(score) FROM student;\n \n+------+------+------------+\n| name | test | MIN(score) |\n+------+------+------------+\n| Chun | SQL | 31 |\n+------+------+------------+\n \nDifference between ORDER BY ASC and MIN():\n \nCREATE TABLE student2(name CHAR(10),grade\nENUM(\'b\',\'c\',\'a\'));\n \nINSERT INTO student2\nVALUES(\'Chun\',\'b\'),(\'Esben\',\'c\'),(\'Kaolin\',\'a\');\n \nSELECT MIN(grade) FROM student2;\n \n+------------+\n| MIN(grade) |\n+------------+\n| a |\n+------------+\n \nSELECT grade FROM student2 ORDER BY grade ASC LIMIT 1;\n \n+-------+\n| grade |\n+-------+\n| b |\n+-------+\n \nAs a window function:\n \nCREATE OR REPLACE TABLE student_test (name CHAR(10), test\nCHAR(10), score TINYINT);\nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73), \n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31), \n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88), \n (\'Tatiana\', \'SQL\', 87);\n \nSELECT name, test, score, MIN(score) \n OVER (PARTITION BY name) AS lowest_score FROM student_test;\n \n+---------+--------+-------+--------------+\n| name | test | score | lowest_score |\n+---------+--------+-------+--------------+\n| Chun | SQL | 75 | 73 |\n| Chun | Tuning | 73 | 73 |\n| Esben | SQL | 43 | 31 |\n| Esben | Tuning | 31 | 31 |\n| Kaolin | SQL | 56 | 56 |\n| Kaolin | Tuning | 88 | 56 |\n| Tatiana | SQL | 87 | 87 |\n+---------+--------+-------+--------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/min/','','https://mariadb.com/kb/en/library/min/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (192,16,'STD','Syntax\n------ \nSTD(expr)\n \nDescription\n----------- \nReturns the population standard deviation of expr. This is\nan extension\nto standard SQL. The standard SQL function STDDEV_POP() can\nbe used instead. \n \nIt is an aggregate function, and so can be used with the\nGROUP BY clause.\n \nFrom MariaDB 10.2.2, STD() can be used as a window function.\n \nThis function returns NULL if there were no matching rows.\n \nExamples\n-------- \nAs an aggregate function:\n \nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n \nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n \nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n \n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a | 0.8165 | 1.0000 | 0.6667 |\n| b | 18.0400 | 20.1693 | 325.4400 |\n+----------+---------------+----------------+------------+\n \nAs a window function:\n \nCREATE OR REPLACE TABLE student_test (name CHAR(10), test\nCHAR(10), score TINYINT);\n \nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73), \n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31), \n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88), \n (\'Tatiana\', \'SQL\', 87);\n \nSELECT name, test, score, STDDEV_POP(score) \n OVER (PARTITION BY test) AS stddev_results FROM\nstudent_test;\n \n+---------+--------+-------+----------------+\n| name | test | score | stddev_results |\n+---------+--------+-------+----------------+\n| Chun | SQL | 75 | 16.9466 |\n| Chun | Tuning | 73 | 24.1247 |\n| Esben | SQL | 43 | 16.9466 |\n| Esben | Tuning | 31 | 24.1247 |\n| Kaolin | SQL | 56 | 16.9466 |\n| Kaolin | Tuning | 88 | 24.1247 |\n| Tatiana | SQL | 87 | 16.9466 |\n+---------+--------+-------+----------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/std/','','https://mariadb.com/kb/en/library/std/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (193,16,'STDDEV','Syntax\n------ \nSTDDEV(expr)\n \nDescription\n----------- \nReturns the population standard deviation of expr. This\nfunction is\nprovided for compatibility with Oracle. The standard SQL\nfunction\nSTDDEV_POP() can be used instead.\n \nIt is an aggregate function, and so can be used with the\nGROUP BY clause.\n \nFrom MariaDB 10.2.2, STDDEV() can be used as a window\nfunction.\n \nThis function returns NULL if there were no matching rows.\n \nExamples\n-------- \nAs an aggregate function:\n \nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n \nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n \nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n \n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a | 0.8165 | 1.0000 | 0.6667 |\n| b | 18.0400 | 20.1693 | 325.4400 |\n+----------+---------------+----------------+------------+\n \nAs a window function:\n \nCREATE OR REPLACE TABLE student_test (name CHAR(10), test\nCHAR(10), score TINYINT);\n \nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73), \n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31), \n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88), \n (\'Tatiana\', \'SQL\', 87);\n \nSELECT name, test, score, STDDEV_POP(score) \n OVER (PARTITION BY test) AS stddev_results FROM\nstudent_test;\n \n+---------+--------+-------+----------------+\n| name | test | score | stddev_results |\n+---------+--------+-------+----------------+\n| Chun | SQL | 75 | 16.9466 |\n| Chun | Tuning | 73 | 24.1247 |\n| Esben | SQL | 43 | 16.9466 |\n| Esben | Tuning | 31 | 24.1247 |\n| Kaolin | SQL | 56 | 16.9466 |\n| Kaolin | Tuning | 88 | 24.1247 |\n| Tatiana | SQL | 87 | 16.9466 |\n+---------+--------+-------+----------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/stddev/','','https://mariadb.com/kb/en/library/stddev/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (194,16,'STDDEV_POP','Syntax\n------ \nSTDDEV_POP(expr)\n \nDescription\n----------- \nReturns the population standard deviation of expr (the\nsquare root of\nVAR_POP()). You can also use STD() or\nSTDDEV(), which are equivalent but not standard SQL.\n \nIt is an aggregate function, and so can be used with the\nGROUP BY clause.\n \nFrom MariaDB 10.2.2, STDDEV_POP() can be used as a window\nfunction.\n \nSTDDEV_POP() returns NULL if there were no matching rows.\n \nExamples\n-------- \nAs an aggregate function:\n \nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n \nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n \nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n \n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a | 0.8165 | 1.0000 | 0.6667 |\n| b | 18.0400 | 20.1693 | 325.4400 |\n+----------+---------------+----------------+------------+\n \nAs a window function:\n \nCREATE OR REPLACE TABLE student_test (name CHAR(10), test\nCHAR(10), score TINYINT);\n \nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73), \n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31), \n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88), \n (\'Tatiana\', \'SQL\', 87);\n \nSELECT name, test, score, STDDEV_POP(score) \n OVER (PARTITION BY test) AS stddev_results FROM\nstudent_test;\n \n+---------+--------+-------+----------------+\n| name | test | score | stddev_results |\n+---------+--------+-------+----------------+\n| Chun | SQL | 75 | 16.9466 |\n| Chun | Tuning | 73 | 24.1247 |\n| Esben | SQL | 43 | 16.9466 |\n| Esben | Tuning | 31 | 24.1247 |\n| Kaolin | SQL | 56 | 16.9466 |\n| Kaolin | Tuning | 88 | 24.1247 |\n| Tatiana | SQL | 87 | 16.9466 |\n+---------+--------+-------+----------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/stddev_pop/','','https://mariadb.com/kb/en/library/stddev_pop/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (195,16,'STDDEV_SAMP','Syntax\n------ \nSTDDEV_SAMP(expr)\n \nDescription\n----------- \nReturns the sample standard deviation of expr (the square\nroot of VAR_SAMP()).\n \nIt is an aggregate function, and so can be used with the\nGROUP BY clause.\n \nFrom MariaDB 10.2.2, STDDEV_SAMP() can be used as a window\nfunction.\n \nSTDDEV_SAMP() returns NULL if there were no matching rows.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/stddev_samp/','','https://mariadb.com/kb/en/library/stddev_samp/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (196,16,'SUM','Syntax\n------ \nSUM([DISTINCT] expr)\n \nDescription\n----------- \nReturns the sum of expr. If the return set has no rows,\nSUM() returns\nNULL. The DISTINCT keyword can be used to sum only the\ndistinct values\nof expr.\n \nFrom MariaDB 10.2.0, SUM() can be used as a window function,\nalthough not with the DISTINCT specifier.\n \nExamples\n-------- \nCREATE TABLE sales (sales_value INT);\nINSERT INTO sales VALUES(10),(20),(20),(40);\n \nSELECT SUM(sales_value) FROM sales;\n \n+------------------+\n| SUM(sales_value) |\n+------------------+\n| 90 |\n+------------------+\n \nSELECT SUM(DISTINCT(sales_value)) FROM sales;\n \n+----------------------------+\n| SUM(DISTINCT(sales_value)) |\n+----------------------------+\n| 70 |\n+----------------------------+\n \nCommonly, SUM is used with a GROUP BY clause:\n \nCREATE TABLE sales (name CHAR(10), month CHAR(10), units\nINT);\n \nINSERT INTO sales VALUES \n (\'Chun\', \'Jan\', 75), (\'Chun\', \'Feb\', 73),\n (\'Esben\', \'Jan\', 43), (\'Esben\', \'Feb\', 31),\n (\'Kaolin\', \'Jan\', 56), (\'Kaolin\', \'Feb\', 88),\n (\'Tatiana\', \'Jan\', 87), (\'Tatiana\', \'Feb\', 83);\n \nSELECT name, SUM(units) FROM sales GROUP BY name;\n \n+---------+------------+\n| name | SUM(units) |\n+---------+------------+\n| Chun | 148 |\n| Esben | 74 |\n| Kaolin | 144 |\n| Tatiana | 170 |\n+---------+------------+\n \nThe GROUP BY clause is required when using an aggregate\nfunction along with regular column data, otherwise the\nresult will be a mismatch, as in the following common type\nof mistake:\n \nSELECT name,SUM(units) FROM sales\n;\n+------+------------+\n| name | SUM(units) |\n+------+------------+\n| Chun | 536 |\n+------+------------+\n \nAs a window function:\n \nCREATE OR REPLACE TABLE student_test (name CHAR(10), test\nCHAR(10), score TINYINT);\nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73), \n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31), \n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88), \n (\'Tatiana\', \'SQL\', 87);\n \nSELECT name, test, score, SUM(score) OVER (PARTITION BY\nname) AS total_score FROM student_test;\n \n+---------+--------+-------+-------------+\n| name | test | score | total_score |\n+---------+--------+-------+-------------+\n| Chun | SQL | 75 | 148 |\n| Chun | Tuning | 73 | 148 |\n| Esben | SQL | 43 | 74 |\n| Esben | Tuning | 31 | 74 |\n| Kaolin | SQL | 56 | 144 |\n| Kaolin | Tuning | 88 | 144 |\n| Tatiana | SQL | 87 | 87 |\n+---------+--------+-------+-------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/sum/','','https://mariadb.com/kb/en/library/sum/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (197,16,'VARIANCE','Syntax\n------ \nVARIANCE(expr) \n \nDescription\n----------- \nReturns the population standard variance of expr. This is an\nextension to\nstandard SQL. The standard SQL function VAR_POP() can be\nused\ninstead.\n \nVariance is calculated by\nworking out the mean for the set\nfor each number, subtracting the mean and squaring the\nresult\ncalculate the average of the resulting differences\n \nIt is an aggregate function, and so can be used with the\nGROUP BY clause.\n \nFrom MariaDB 10.2.2, VARIANCE() can be used as a window\nfunction.\n \nVARIANCE() returns NULL if there were no matching rows.\n \nExamples\n-------- \nCREATE TABLE v(i tinyint);\n \nINSERT INTO v VALUES(101),(99);\n \nSELECT VARIANCE(i) FROM v;\n \n+-------------+\n| VARIANCE(i) |\n+-------------+\n| 1.0000 |\n+-------------+\n \nINSERT INTO v VALUES(120),(80);\n \nSELECT VARIANCE(i) FROM v;\n \n+-------------+\n| VARIANCE(i) |\n+-------------+\n| 200.5000 |\n+-------------+\n \nAs an aggregate function:\n \nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n \nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n \nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n \n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a | 0.8165 | 1.0000 | 0.6667 |\n| b | 18.0400 | 20.1693 | 325.4400 |\n+----------+---------------+----------------+------------+\n \nAs a window function:\n \nCREATE OR REPLACE TABLE student_test (name CHAR(10), test\nCHAR(10), score TINYINT);\n \nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73), \n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31), \n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88), \n (\'Tatiana\', \'SQL\', 87);\n \nSELECT name, test, score, VAR_POP(score) \n OVER (PARTITION BY test) AS variance_results FROM\nstudent_test;\n \n+---------+--------+-------+------------------+\n| name | test | score | variance_results |\n+---------+--------+-------+------------------+\n| Chun | SQL | 75 | 287.1875 |\n| Chun | Tuning | 73 | 582.0000 |\n| Esben | SQL | 43 | 287.1875 |\n| Esben | Tuning | 31 | 582.0000 |\n| Kaolin | SQL | 56 | 287.1875 |\n| Kaolin | Tuning | 88 | 582.0000 |\n| Tatiana | SQL | 87 | 287.1875 |\n+---------+--------+-------+------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/variance/','','https://mariadb.com/kb/en/library/variance/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (198,16,'VAR_POP','Syntax\n------ \nVAR_POP(expr)\n \nDescription\n----------- \nReturns the population standard variance of expr. It\nconsiders rows as\nthe whole population, not as a sample, so it has the number\nof rows as\nthe denominator. You can also use VARIANCE(), which is\nequivalent but\nis not standard SQL.\n \nVariance is calculated by\nworking out the mean for the set\nfor each number, subtracting the mean and squaring the\nresult\ncalculate the average of the resulting differences\n \nIt is an aggregate function, and so can be used with the\nGROUP BY clause.\n \nFrom MariaDB 10.2.2, VAR_POP() can be used as a window\nfunction.\n \nVAR_POP() returns NULL if there were no matching rows.\n \nExamples\n-------- \nCREATE TABLE v(i tinyint);\n \nINSERT INTO v VALUES(101),(99);\n \nSELECT VAR_POP(i) FROM v;\n \n+------------+\n| VAR_POP(i) |\n+------------+\n| 1.0000 |\n+------------+\n \nINSERT INTO v VALUES(120),(80);\n \nSELECT VAR_POP(i) FROM v;\n \n+------------+\n| VAR_POP(i) |\n+------------+\n| 200.5000 |\n+------------+\n \nAs an aggregate function:\n \nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n \nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n \nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n \n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a | 0.8165 | 1.0000 | 0.6667 |\n| b | 18.0400 | 20.1693 | 325.4400 |\n+----------+---------------+----------------+------------+\n \nAs a window function:\n \nCREATE OR REPLACE TABLE student_test (name CHAR(10), test\nCHAR(10), score TINYINT);\n \nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73), \n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31), \n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88), \n (\'Tatiana\', \'SQL\', 87);\n \nSELECT name, test, score, VAR_POP(score) \n OVER (PARTITION BY test) AS variance_results FROM\nstudent_test;\n \n+---------+--------+-------+------------------+\n| name | test | score | variance_results |\n+---------+--------+-------+------------------+\n| Chun | SQL | 75 | 287.1875 |\n| Chun | Tuning | 73 | 582.0000 |\n| Esben | SQL | 43 | 287.1875 |\n| Esben | Tuning | 31 | 582.0000 |\n| Kaolin | SQL | 56 | 287.1875 |\n| Kaolin | Tuning | 88 | 582.0000 |\n| Tatiana | SQL | 87 | 287.1875 |\n+---------+--------+-------+------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/var_pop/','','https://mariadb.com/kb/en/library/var_pop/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (199,16,'VAR_SAMP','Syntax\n------ \nVAR_SAMP(expr)\n \nDescription\n----------- \nReturns the sample variance of expr. That is, the\ndenominator is the number of rows minus one.\n \nIt is an aggregate function, and so can be used with the\nGROUP BY clause.\n \nFrom MariaDB 10.2.2, VAR_SAMP() can be used as a window\nfunction.\n \nVAR_SAMP() returns NULL if there were no matching rows.\n \nExamples\n-------- \nAs an aggregate function:\n \nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n \nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n \nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n \n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a | 0.8165 | 1.0000 | 0.6667 |\n| b | 18.0400 | 20.1693 | 325.4400 |\n+----------+---------------+----------------+------------+\n \nAs a window function:\n \nCREATE OR REPLACE TABLE student_test (name CHAR(10), test\nCHAR(10), score TINYINT);\n \nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73), \n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31), \n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88), \n (\'Tatiana\', \'SQL\', 87);\n \nSELECT name, test, score, VAR_SAMP(score) \n OVER (PARTITION BY test) AS variance_results FROM\nstudent_test;\n \n+---------+--------+-------+------------------+\n| name | test | score | variance_results |\n+---------+--------+-------+------------------+\n| Chun | SQL | 75 | 382.9167 |\n| Chun | Tuning | 73 | 873.0000 |\n| Esben | SQL | 43 | 382.9167 |\n| Esben | Tuning | 31 | 873.0000 |\n| Kaolin | SQL | 56 | 382.9167 |\n| Kaolin | Tuning | 88 | 873.0000 |\n| Tatiana | SQL | 87 | 382.9167 |\n+---------+--------+-------+------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/var_samp/','','https://mariadb.com/kb/en/library/var_samp/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (200,17,'BENCHMARK','Syntax\n------ \nBENCHMARK(count,expr)\n \nDescription\n----------- \nThe BENCHMARK() function executes the expression expr\nrepeatedly count\ntimes. It may be used to time how quickly MariaDB processes\nthe\nexpression. The result value is always 0. The intended use\nis from\nwithin the mysql client, which reports query execution\ntimes.\n \nExamples\n-------- \nSELECT BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\'));\n+----------------------------------------------+\n| BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\')) |\n+----------------------------------------------+\n| 0 |\n+----------------------------------------------+\n1 row in set (0.21 sec)\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/benchmark/','','https://mariadb.com/kb/en/library/benchmark/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (201,17,'BINLOG_GTID_POS','From version 10.0.2, MariaDB supports global transaction IDs\nfor replication.\n \nSyntax\n------ \nBINLOG_GTID_POS(binlog_filename,binlog_offset)\n \nDescription\n----------- \nThe BINLOG_GTID_POS() function takes as input an old-style\nbinary log position in the form of a file name and a file\noffset. It looks up the position in the current binlog, and\nreturns a string representation of the corresponding GTID\nposition. If the position is not found in the current\nbinlog, NULL is returned.\n \nExamples\n-------- \nSELECT BINLOG_GTID_POS(\"master-bin.000001\", 600);\n \n\n\nURL: https://mariadb.com/kb/en/library/binlog_gtid_pos/','','https://mariadb.com/kb/en/library/binlog_gtid_pos/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (202,17,'CHARSET','Syntax\n------ \nCHARSET(str)\n \nDescription\n----------- \nReturns the character set of the string argument. If str is\nnot a string, it is considered as a binary string (so the\nfunction returns \'binary\'). This applies to NULL, too. The\nreturn value is a string in the utf8 character set.\n \nExamples\n-------- \nSELECT CHARSET(\'abc\');\n+----------------+\n| CHARSET(\'abc\') |\n+----------------+\n| latin1 |\n+----------------+\n \nSELECT CHARSET(CONVERT(\'abc\' USING utf8));\n+------------------------------------+\n| CHARSET(CONVERT(\'abc\' USING utf8)) |\n+------------------------------------+\n| utf8 |\n+------------------------------------+\n \nSELECT CHARSET(USER());\n+-----------------+\n| CHARSET(USER()) |\n+-----------------+\n| utf8 |\n+-----------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/charset/','','https://mariadb.com/kb/en/library/charset/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (203,17,'COERCIBILITY','Syntax\n------ \nCOERCIBILITY(str)\n \nDescription\n----------- \nReturns the collation coercibility value of the string\nargument. Coercibility defines what will be converted to\nwhat in case of collation conflict, with an expression with\nhigher coercibility being converted to the collation of an\nexpression with lower coercibility.\n \nCoercibility | Description | Example | \n \n0 | Explicit | Value using a COLLATE clause | \n \n1 | No collation | Concatenated strings using different\ncollations | \n \n2 | Implicit | Column value | \n \n3 | Constant | USER() return value | \n \n4 | Coercible | Literal string | \n \n5 | Ignorable | NULL or derived from NULL | \n \nExamples\n-------- \nSELECT COERCIBILITY(\'abc\' COLLATE latin1_swedish_ci);\n+-----------------------------------------------+\n| COERCIBILITY(\'abc\' COLLATE latin1_swedish_ci) |\n+-----------------------------------------------+\n| 0 |\n+-----------------------------------------------+\n \nSELECT COERCIBILITY(USER());\n+----------------------+\n| COERCIBILITY(USER()) |\n+----------------------+\n| 3 |\n+----------------------+\n \nSELECT COERCIBILITY(\'abc\');\n+---------------------+\n| COERCIBILITY(\'abc\') |\n+---------------------+\n| 4 |\n+---------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/coercibility/','','https://mariadb.com/kb/en/library/coercibility/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (204,17,'COLLATION','Syntax\n------ \nCOLLATION(str)\n \nDescription\n----------- \nReturns the collation of the string argument. If str is not\na string, it is considered as a binary string (so the\nfunction returns \'binary\'). This applies to NULL, too. The\nreturn value is a string in the utf8 character set.\n \nSee Character Sets and Collations.\n \nExamples\n-------- \nSELECT COLLATION(\'abc\');\n+-------------------+\n| COLLATION(\'abc\') |\n+-------------------+\n| latin1_swedish_ci |\n+-------------------+\n \nSELECT COLLATION(_utf8\'abc\');\n+-----------------------+\n| COLLATION(_utf8\'abc\') |\n+-----------------------+\n| utf8_general_ci |\n+-----------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/collation/','','https://mariadb.com/kb/en/library/collation/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (205,17,'CONNECTION_ID','Syntax\n------ \nCONNECTION_ID()\n \nDescription\n----------- \nReturns the connection ID (thread ID) for the connection.\nEvery\nthread (including events) has an ID that is unique among the\nset of currently\nconnected clients.\n \nUntil MariaDB 10.3.1, returns MYSQL_TYPE_LONGLONG, or\nbigint(10), in all cases. From MariaDB 10.3.1, returns\nMYSQL_TYPE_LONG, or int(10), when the result would fit\nwithin 32-bits.\n \nExamples\n-------- \nSELECT CONNECTION_ID();\n+-----------------+\n| CONNECTION_ID() |\n+-----------------+\n| 3 |\n+-----------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/connection_id/','','https://mariadb.com/kb/en/library/connection_id/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (206,17,'CURRENT_ROLE','Roles were introduced in MariaDB 10.0.5.\n \nSyntax\n------ \nCURRENT_ROLE, CURRENT_ROLE()\n \nDescription\n----------- \nReturns the current role name. This determines your access\nprivileges. The return value is a string in the\nutf8 character set.\n \nIf there is no current role, NULL is returned.\n \nThe output of SELECT CURRENT_ROLE is equivalent to the\ncontents of the ENABLED_ROLES Information Schema table.\n \nUSER() returns the combination of user and host used to\nlogin. CURRENT_USER() returns the account used to determine\ncurrent connection\'s privileges.\n \nExamples\n-------- \nSELECT CURRENT_ROLE;\n \n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL |\n+--------------+\n \nSET ROLE staff;\n \nSELECT CURRENT_ROLE;\n \n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| staff |\n+--------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/current_role/','','https://mariadb.com/kb/en/library/current_role/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (207,17,'CURRENT_USER','Syntax\n------ \nCURRENT_USER, CURRENT_USER()\n \nDescription\n----------- \nReturns the user name and host name combination for the\nMariaDB account\nthat the server used to authenticate the current client.\nThis account\ndetermines your access privileges. The return value is a\nstring in the\nutf8 character set.\n \nThe value of CURRENT_USER() can differ from the value of\nUSER(). CURRENT_ROLE() returns the current active role.\n \nExamples\n-------- \nshell> mysql --user=\"anonymous\"\n \nMariaDB [(none)]> select user(),current_user();\n+---------------------+----------------+\n| user() | current_user() |\n+---------------------+----------------+\n| anonymous@localhost | @localhost |\n+---------------------+----------------+\n \nWhen calling CURRENT_USER() in a stored procedure, it\nreturns the owner of the stored procedure, as defined with\nDEFINER.\n \n\n\nURL: https://mariadb.com/kb/en/library/current_user/','','https://mariadb.com/kb/en/library/current_user/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (208,17,'DATABASE','Syntax\n------ \nDATABASE()\n \nDescription\n----------- \nReturns the default (current) database name as a string in\nthe utf8 character set. If there is no default database,\nDATABASE() returns NULL. Within a stored routine, the\ndefault database is the database that the routine is\nassociated with, which is not necessarily the same as the\ndatabase that is the default in the calling context.\n \nSCHEMA() is a synonym for DATABASE().\n \nTo select a default database, the USE statement can be run.\nAnother way to set the default database is specifying its\nname at mysql command line client startup.\n \nExamples\n-------- \nSELECT DATABASE();\n+------------+\n| DATABASE() |\n+------------+\n| NULL |\n+------------+\n \nUSE test;\n \nDatabase changed\n \nSELECT DATABASE();\n+------------+\n| DATABASE() |\n+------------+\n| test |\n+------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/database/','','https://mariadb.com/kb/en/library/database/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (209,17,'DECODE_HISTOGRAM','DECODE_HISTOGRAM() was introduced in MariaDB 10.0.2\n \nSyntax\n------ \nDECODE_HISTOGRAM(hist_type,histogram)\n \nNote: Before MariaDB 10.0.10 the arguments were reversed.\n \nDescription\n----------- \nReturns a string of comma separated numeric values\ncorresponding to a probability distribution represented by\nthe histogram of type hist_type (SINGLE_PREC_HB or\nDOUBLE_PREC_HB). The hist_type and histogram would be\ncommonly used from the mysql.column_stats table.\n \nSee Histogram Based Statistics for details.\n \nExamples\n-------- \nCREATE TABLE origin (\n i INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,\n v INT UNSIGNED NOT NULL\n);\n \nINSERT INTO origin(v) VALUES \n (1),(2),(3),(4),(5),(10),(20),\n (30),(40),(50),(60),(70),(80),\n (90),(100),(200),(400),(800);\n \nSET histogram_size=10,histogram_type=SINGLE_PREC_HB;\n \nANALYZE TABLE origin PERSISTENT FOR ALL;\n \n+-------------+---------+----------+-----------------------------------------+\n| Table | Op | Msg_type | Msg_text |\n+-------------+---------+----------+-----------------------------------------+\n| test.origin | analyze | status | Engine-independent\nstatistics collected |\n| test.origin | analyze | status | OK |\n+-------------+---------+----------+-----------------------------------------+\n \nSELECT db_name,table_name,column_name,hist_type,\n hex(histogram),decode_histogram(hist_type,histogram) \n FROM mysql.column_stats WHERE db_name=\'test\' and\ntable_name=\'origin\';\n \n+---------+------------+-------------+----------------+----------------------+-------------------------------------------------------------------+\n| db_name | table_name | column_name | hist_type |\nhex(histogram) | decode_histogram(hist_type,histogram) |\n+---------+------------+-------------+----------------+----------------------+-------------------------------------------------------------------+\n| test | origin | i | SINGLE_PREC_HB | 0F2D3C5A7887A5C3D2F0\n|\n0.059,0.118,0.059,0.118,0.118,0.059,0.118,0.118,0.059,0.118,0.059\n|\n| test | origin | v | SINGLE_PREC_HB | 000001060C0F161C1F7F\n|\n0.000,0.000,0.004,0.020,0.024,0.012,0.027,0.024,0.012,0.376,0.502\n|\n+---------+------------+-------------+----------------+----------------------+-------------------------------------------------------------------+\n \nSET histogram_size=20,histogram_type=DOUBLE_PREC_HB;\n \nANALYZE TABLE origin PERSISTENT FOR ALL;\n \n+-------------+---------+----------+-----------------------------------------+\n| Table | Op | Msg_type | Msg_text |\n+-------------+---------+----------+-----------------------------------------+\n| test.origin | analyze | status | Engine-independent\nstatistics collected |\n| test.origin | analyze | status | OK |\n+-------------+---------+----------+-----------------------------------------+\n \nSELECT db_name,table_name,column_name,\n hist_type,hex(histogram),decode_histogram(hist_type,histogram)\n\n FROM mysql.column_stats WHERE db_name=\'test\' and\ntable_name=\'origin\';\n \n+---------+------------+-------------+----------------+------------------------------------------+-----------------------------------------------------------------------------------------+\n| db_name | table_name | column_name | hist_type |\nhex(histogram) | decode_histogram(hist_type,histogram) |\n+---------+------------+-------------+----------------+------------------------------------------+-----------------------------------------------------------------------------------------+\n| test | origin | i | DOUBLE_PREC_HB |\n0F0F2D2D3C3C5A5A78788787A5A5C3C3D2D2F0F0 |\n0.05882,0.11765,0.05882,0.11765,0.11765,0.05882,0.11765,0.11765,0.05882,0.11765,0.05882\n|\n| test | origin | v | DOUBLE_PREC_HB |\n5200F600480116067E0CB30F1B16831CB81FD67F |\n0.00125,0.00250,0.00125,0.01877,0.02502,0.01253,0.02502,0.02502,0.01253,0.37546,0.50063\n|\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/decode_histogram/','','https://mariadb.com/kb/en/library/decode_histogram/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (210,17,'DEFAULT','Syntax\n------ \nDEFAULT(col_name)\n \nDescription\n----------- \nReturns the default value for a table column. If the column\nhas no default value, NULL is returned.\nFor integer columns using AUTO_INCREMENT, 0 is returned.\n \nWhen using DEFAULT as a value to set in an INSERT or UPDATE\nstatement, you can use the bare keyword DEFAULT without the\nparentheses and argument to\nrefer to the column in context. You can only use DEFAULT as\na bare keyword if you are using it\nalone without a surrounding expression or function.\n \nExamples\n-------- \nSelect only non-default values for a column:\n \nSELECT i FROM t WHERE i != DEFAULT(i);\n \nUpdate values to be one greater than the default value:\n \nUPDATE t SET i = DEFAULT(i)+1 WHERE i \n\nURL: https://mariadb.com/kb/en/library/default/','','https://mariadb.com/kb/en/library/default/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (211,17,'FOUND_ROWS','Syntax\n------ \nFOUND_ROWS()\n \nDescription\n----------- \nA SELECT statement may include a LIMIT clause to restrict\nthe number\nof rows the server returns to the client. In some cases, it\nis\ndesirable to know how many rows the statement would have\nreturned\nwithout the LIMIT, but without running the statement again.\nTo obtain\nthis row count, include a SQL_CALC_FOUND_ROWS option in the\nSELECT\nstatement, and then invoke FOUND_ROWS() afterwards.\n \nYou can also use FOUND_ROWS() to obtain the number of rows\nreturned by a SELECT which does not contain a LIMIT clause.\nIn this case you don\'t need to use the SQL_CALC_FOUND_ROWS\noption. This can be useful for example in a stored\nprocedure.\n \nAlso, this function works with some other statements which\nreturn a resultset, including SHOW, DESC and HELP. For\nDELETE ... RETURNING you should use ROW_COUNT(). It also\nworks as a prepared statement, or after executing a prepared\nstatement.\n \nStatements which don\'t return any results don\'t affect\nFOUND_ROWS() - the previous value will still be returned.\n \nWarning: When used after a CALL statement, this function\nreturns the number of rows selected by the last query in the\nprocedure, not by the whole procedure.\n \nStatements using the FOUND_ROWS() function are not safe for\nreplication.\n \nExamples\n-------- \nSHOW ENGINES;\n \n+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+\n| Engine | Support | Comment | Transactions | XA |\nSavepoints |\n+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+\n| InnoDB | DEFAULT | Supports transactions, row-level\nlocking, and foreign keys | YES | YES | YES |\n...\n| SPHINX | YES | Sphinx storage engine | NO | NO | NO |\n+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+\n11 rows in set (0.01 sec)\n \nSELECT FOUND_ROWS();\n+--------------+\n| FOUND_ROWS() |\n+--------------+\n| 11 |\n+--------------+\n \nSELECT SQL_CALC_FOUND_ROWS * FROM tbl_name WHERE id > 100\nLIMIT 10;\n \nSELECT FOUND_ROWS();\n+--------------+\n| FOUND_ROWS() |\n+--------------+\n| 23 |\n+--------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/found_rows/','','https://mariadb.com/kb/en/library/found_rows/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (212,17,'LAST_INSERT_ID','Syntax\n------ \nLAST_INSERT_ID(), LAST_INSERT_ID(expr)\n \nDescription\n----------- \nLAST_INSERT_ID() (no arguments) returns\nthe first automatically generated value successfully\ninserted for an\nAUTO_INCREMENT column as a result of the most recently\nexecuted INSERT\nstatement. The value of LAST_INSERT_ID() remains unchanged\nif no rows\nare successfully inserted.\n \nIf one gives an argument to LAST_INSERT_ID(), then it will\nreturn the value of the expression and\nthe next call to LAST_INSERT_ID() will return the same\nvalue. The value will also be sent to the client\nand can be accessed by the mysql_insert_id function.\n \nFor example, after inserting a row that generates an\nAUTO_INCREMENT\nvalue, you can get the value like this:\n \nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n| 9 |\n+------------------+\n \nYou can also use LAST_INSERT_ID() to delete the last\ninserted row:\n \nDELETE FROM product WHERE id = LAST_INSERT_ID();\n \nIf no rows were successfully inserted, LAST_INSERT_ID()\nreturns 0.\n \nThe value of LAST_INSERT_ID() will be consistent across all\nversions\nif all rows in the INSERT or UPDATE statement were\nsuccessful.\n \nThe currently executing statement does not affect the value\nof\nLAST_INSERT_ID(). Suppose that you generate an\nAUTO_INCREMENT value\nwith one statement, and then refer to LAST_INSERT_ID() in a\nmultiple-row INSERT statement that inserts rows into a table\nwith its\nown AUTO_INCREMENT column. The value of LAST_INSERT_ID()\nwill remain\nstable in the second statement; its value for the second and\nlater\nrows is not affected by the earlier row insertions.\n(However, if you\nmix references to LAST_INSERT_ID() and LAST_INSERT_ID(expr),\nthe\neffect is undefined.)\n \nIf the previous statement returned an error, the value of\nLAST_INSERT_ID() is undefined. For transactional tables, if\nthe\nstatement is rolled back due to an error, the value of\nLAST_INSERT_ID() is left undefined. For manual ROLLBACK, the\nvalue of\nLAST_INSERT_ID() is not restored to that before the\ntransaction; it\nremains as it was at the point of the ROLLBACK.\n \nWithin the body of a stored routine (procedure or function)\nor a\ntrigger, the value of LAST_INSERT_ID() changes the same way\nas for\nstatements executed outside the body of these kinds of\nobjects. The\neffect of a stored routine or trigger upon the value of\nLAST_INSERT_ID() that is seen by following statements\ndepends on the\nkind of routine:\nIf a stored procedure executes statements that change the\nvalue of LAST_INSERT_ID(), the new value will be seen by\nstatements that follow the procedure call.\n \nFor stored functions and triggers that change the value, the\nvalue is restored when the function or trigger ends, so\nfollowing statements will not see a changed value.\n \nExamples\n-------- \nCREATE TABLE t (\n id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY, \n f VARCHAR(1)) \nENGINE = InnoDB;\n \nINSERT INTO t(f) VALUES(\'a\');\n \nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n| 1 |\n+------------------+\n \nINSERT INTO t(f) VALUES(\'b\');\n \nINSERT INTO t(f) VALUES(\'c\');\n \nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n| 3 |\n+------------------+\n \nINSERT INTO t(f) VALUES(\'d\'),(\'e\');\n \nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n| 4 |\n+------------------+\n \nSELECT * FROM t;\n \n+----+------+\n| id | f |\n+----+------+\n| 1 | a |\n| 2 | b |\n| 3 | c |\n| 4 | d |\n| 5 | e |\n+----+------+\n \nSELECT LAST_INSERT_ID(12);\n+--------------------+\n| LAST_INSERT_ID(12) |\n+--------------------+\n| 12 |\n+--------------------+\n \nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n| 12 |\n+------------------+\n \nINSERT INTO t(f) VALUES(\'f\');\n \nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n| 6 |\n+------------------+\n \nSELECT * FROM t;\n \n+----+------+\n| id | f |\n+----+------+\n| 1 | a |\n| 2 | b |\n| 3 | c |\n| 4 | d |\n| 5 | e |\n| 6 | f |\n+----+------+\n \nSELECT LAST_INSERT_ID(12);\n+--------------------+\n| LAST_INSERT_ID(12) |\n+--------------------+\n| 12 |\n+--------------------+\n \nINSERT INTO t(f) VALUES(\'g\');\n \nSELECT * FROM t;\n \n+----+------+\n| id | f |\n+----+------+\n| 1 | a |\n| 2 | b |\n| 3 | c |\n| 4 | d |\n| 5 | e |\n| 6 | f |\n| 7 | g |\n+----+------+\n \n\n\nURL: https://mariadb.com/kb/en/library/last_insert_id/','','https://mariadb.com/kb/en/library/last_insert_id/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (213,17,'LAST_VALUE','Syntax\n------ \nLAST_VALUE(expr,[expr,...])\n \nLAST_VALUE(expr) OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n) \n \nDescription\n----------- \nLAST_VALUE() evaluates all expressions and returns the last.\n \nThis is useful together with setting user variables to a\nvalue with @var:=expr, for example when you want to get data\nof rows updated/deleted without having to do two queries\nagainst the table.\n \nSince MariaDB 10.2.2, LAST_VALUE can be used as a window\nfunction.\n \nReturns NULL if no last value exists.\n \nExamples\n-------- \nCREATE TABLE t1 (a int, b int);\nINSERT INTO t1 VALUES(1,10),(2,20);\nDELETE FROM t1 WHERE a=1 AND last_value(@a:=a,@b:=b,1);\nSELECT @a,@b;\n \n+------+------+\n| @a | @b |\n+------+------+\n| 1 | 10 |\n+------+------+\n \nAs a window function:\n \nCREATE TABLE t1 (\n pk int primary key,\n a int,\n b int,\n c char(10),\n d decimal(10, 3),\n e real\n);\n \nINSERT INTO t1 VALUES\n( 1, 0, 1, \'one\', 0.1, 0.001),\n( 2, 0, 2, \'two\', 0.2, 0.002),\n( 3, 0, 3, \'three\', 0.3, 0.003),\n( 4, 1, 2, \'three\', 0.4, 0.004),\n( 5, 1, 1, \'two\', 0.5, 0.005),\n( 6, 1, 1, \'one\', 0.6, 0.006),\n( 7, 2, NULL, \'n_one\', 0.5, 0.007),\n( 8, 2, 1, \'n_two\', NULL, 0.008),\n( 9, 2, 2, NULL, 0.7, 0.009),\n(10, 2, 0, \'n_four\', 0.8, 0.010),\n(11, 2, 10, NULL, 0.9, NULL);\n \nSELECT pk, FIRST_VALUE(pk) OVER (ORDER BY pk) AS first_asc,\n LAST_VALUE(pk) OVER (ORDER BY pk) AS last_asc,\n FIRST_VALUE(pk) OVER (ORDER BY pk DESC) AS first_desc,\n LAST_VALUE(pk) OVER (ORDER BY pk DESC) AS last_desc\nFROM t1\nORDER BY pk DESC;\n \n+----+-----------+----------+------------+-----------+\n| pk | first_asc | last_asc | first_desc | last_desc |\n+----+-----------+----------+------------+-----------+\n| 11 | 1 | 11 | 11 | 11 |\n| 10 | 1 | 10 | 11 | 10 |\n| 9 | 1 | 9 | 11 | 9 |\n| 8 | 1 | 8 | 11 | 8 |\n| 7 | 1 | 7 | 11 | 7 |\n| 6 | 1 | 6 | 11 | 6 |\n| 5 | 1 | 5 | 11 | 5 |\n| 4 | 1 | 4 | 11 | 4 |\n| 3 | 1 | 3 | 11 | 3 |\n| 2 | 1 | 2 | 11 | 2 |\n| 1 | 1 | 1 | 11 | 1 |\n+----+-----------+----------+------------+-----------+\n \nCREATE OR REPLACE TABLE t1 (i int);\nINSERT INTO t1 VALUES\n(1),(2),(3),(4),(5),(6),(7),(8),(9),(10);\n \nSELECT i,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW\nand 1 FOLLOWING) AS f_1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and\n1 FOLLOWING) AS l_1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING\nAND 1 FOLLOWING) AS f_1p1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND\n1 FOLLOWING) AS f_1p1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING\nAND 1 PRECEDING) AS f_2p1p,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND\n1 PRECEDING) AS f_2p1p,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING\nAND 2 FOLLOWING) AS f_1f2f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND\n2 FOLLOWING) AS f_1f2f\nFROM t1;\n \n+------+------+------+--------+--------+--------+--------+--------+--------+\n| i | f_1f | l_1f | f_1p1f | f_1p1f | f_2p1p | f_2p1p |\nf_1f2f | f_1f2f |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n| 1 | 1 | 2 | 1 | 2 | NULL | NULL | 2 | 3 |\n| 2 | 2 | 3 | 1 | 3 | 1 | 1 | 3 | 4 |\n| 3 | 3 | 4 | 2 | 4 | 1 | 2 | 4 | 5 |\n| 4 | 4 | 5 | 3 | 5 | 2 | 3 | 5 | 6 |\n| 5 | 5 | 6 | 4 | 6 | 3 | 4 | 6 | 7 |\n| 6 | 6 | 7 | 5 | 7 | 4 | 5 | 7 | 8 |\n| 7 | 7 | 8 | 6 | 8 | 5 | 6 | 8 | 9 |\n| 8 | 8 | 9 | 7 | 9 | 6 | 7 | 9 | 10 |\n| 9 | 9 | 10 | 8 | 10 | 7 | 8 | 10 | 10 |\n| 10 | 10 | 10 | 9 | 10 | 8 | 9 | NULL | NULL |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n \n\n\nURL: https://mariadb.com/kb/en/library/last_value/','','https://mariadb.com/kb/en/library/last_value/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (214,17,'PROCEDURE ANALYSE','Syntax\n------ \nanalyse([max_elements[,max_memory]])\n \nDescription\n----------- \nThis procedure is defined in the sql/sql_analyse.cc file. It\nexamines\nthe result from a query and returns an analysis of the\nresults that\nsuggests optimal data types for each column. To obtain this\nanalysis,\nappend PROCEDURE ANALYSE to the end of a SELECT statement:\n \nSELECT ... FROM ... WHERE ... PROCEDURE\nANALYSE([max_elements,[max_memory]])\n \nFor example:\n \nSELECT col1, col2 FROM table1 PROCEDURE ANALYSE(10, 2000);\n \nThe results show some statistics for the values returned by\nthe query,\nand propose an optimal data type for the columns. This can\nbe helpful\nfor checking your existing tables, or after importing new\ndata. You\nmay need to try different settings for the arguments so that\nPROCEDURE\nANALYSE() does not suggest the ENUM data type when it is not\nappropriate.\n \nThe arguments are optional and are used as follows:\nmax_elements (default 256) is the maximum number of distinct\nvalues that analyse notices per column. This is used by\nanalyse to check whether the optimal data type should be of\ntype ENUM; if there are more than max_elements distinct\nvalues, then ENUM is not a suggested type.\nmax_memory (default 8192) is the maximum amount of memory\nthat analyse should allocate per column while trying to find\nall distinct values.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/procedure-analyse/','','https://mariadb.com/kb/en/library/procedure-analyse/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (215,17,'ROW_COUNT','Syntax\n------ \nROW_COUNT()\n \nDescription\n----------- \nROW_COUNT() returns the number of rows updated, inserted or\ndeleted\nby the preceding statement. This is the same as the row\ncount that the\nmysql client displays and the value from the\nmysql_affected_rows() C\nAPI function.\n \nGenerally:\nFor statements which return a result set (such as SELECT,\nSHOW, DESC or HELP), returns -1, even when the result set is\nempty. This is also true for administrative statements, such\nas OPTIMIZE.\nFor DML statements other than SELECT and for ALTER TABLE,\nreturns the number of affected rows.\nFor DDL statements (including TRUNCATE) and for other\nstatements which don\'t return any result set (such as USE,\nDO, SIGNAL or DEALLOCATE PREPARE), returns 0.\n \nFor UPDATE, affected rows is by default the number of rows\nthat were actually changed. If the CLIENT_FOUND_ROWS flag to\nmysql_real_connect() is specified when connecting to mysqld,\naffected rows is instead the number of rows matched by the\nWHERE clause. \n \nFor REPLACE, deleted rows are also counted. So, if REPLACE\ndeletes a row and adds a new row, ROW_COUNT() returns 2.\n \nFor INSERT ... ON DUPLICATE KEY, updated rows are counted\ntwice. So, if INSERT adds a new rows and modifies another\nrow, ROW_COUNT() returns 3.\n \nROW_COUNT() does not take into account rows that are not\ndirectly deleted/updated by the last statement. This means\nthat rows deleted by foreign keys or triggers are not\ncounted.\n \nWarning: You can use ROW_COUNT() with prepared statements,\nbut you need to call it after EXECUTE, not after DEALLOCATE\nPREPARE, because the row count for allocate prepare is\nalways 0.\n \nWarning: When used after a CALL statement, this function\nreturns the number of rows affected by the last statement in\nthe procedure, not by the whole procedure.\n \nWarning: After INSERT DELAYED, ROW_COUNT() returns the\nnumber of the rows you tried to insert, not the number of\nthe successful writes.\n \nThis information can also be found in the diagnostics area.\n \nStatements using the ROW_COUNT() function are not safe for\nreplication.\n \nExamples\n-------- \nCREATE TABLE t (A INT);\n \nINSERT INTO t VALUES(1),(2),(3);\n \nSELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 3 |\n+-------------+\n \nDELETE FROM t WHERE A IN(1,2);\n \nSELECT ROW_COUNT(); \n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 2 |\n+-------------+\n \nExample with prepared statements:\n \nSET @q = \'INSERT INTO t VALUES(1),(2),(3);\';\n \nPREPARE stmt FROM @q;\n \nEXECUTE stmt;\n \nQuery OK, 3 rows affected (0.39 sec)\nRecords: 3 Duplicates: 0 Warnings: 0\n \nSELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 3 |\n+-------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/row_count/','','https://mariadb.com/kb/en/library/row_count/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (216,17,'SCHEMA','Syntax\n------ \nSCHEMA()\n \nDescription\n----------- \nThis function is a synonym for DATABASE().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/schema/','','https://mariadb.com/kb/en/library/schema/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (217,17,'SESSION_USER','Syntax\n------ \nSESSION_USER()\n \nDescription\n----------- \nSESSION_USER() is a synonym for USER().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/session_user/','','https://mariadb.com/kb/en/library/session_user/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (218,17,'SYSTEM_USER','Syntax\n------ \nSYSTEM_USER()\n \nDescription\n----------- \nSYSTEM_USER() is a synonym for USER().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/system_user/','','https://mariadb.com/kb/en/library/system_user/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (219,17,'USER','Syntax\n------ \nUSER()\n \nDescription\n----------- \nReturns the current MariaDB user name and host name, given\nwhen authenticating to MariaDB, as a string in the utf8\ncharacter set.\n \nNote that the value of USER() may differ from the value of\nCURRENT_USER(), which is the user used to authenticate the\ncurrent client. \nCURRENT_ROLE() returns the current active role.\n \nSYSTEM_USER() and SESSION_USER are synonyms for USER().\n \nStatements using the USER() function or one of its synonyms\nare not safe for statement level replication.\n \nExamples\n-------- \nshell> mysql --user=\"anonymous\"\n \nMariaDB [(none)]> select user(),current_user();\n+---------------------+----------------+\n| user() | current_user() |\n+---------------------+----------------+\n| anonymous@localhost | @localhost |\n+---------------------+----------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/user/','','https://mariadb.com/kb/en/library/user/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (220,17,'VERSION','Syntax\n------ \nVERSION()\n \nDescription\n----------- \nReturns a string that indicates the MariaDB server version.\nThe string\nuses the utf8 character set.\n \nExamples\n-------- \nSELECT VERSION();\n+------------------------------+\n| VERSION() |\n+------------------------------+\n| 10.0.3-MariaDB-1~precise-log |\n+------------------------------+\n \nThe VERSION() string may have one or more of the following\nsuffixes:\n \nSuffix | Description | \n \n-embedded | The server is an embedded server (libmysqld). | \n \n-log | General logging, slow logging or binary (replication)\nlogging is enabled. | \n \n-debug | The server is compiled for debugging. | \n \n-valgrind |  The server is compiled to be instrumented with\nvalgrind. | \n \nChanging the Version String\n \nSome old legacy code may break because they are parsing the\nVERSION string and expecting a MySQL string or a simple\nversion\nstring like Joomla til API17, see MDEV-7780.\n \nIn MariaDB 10.2 one can fool these applications by setting\nthe version string from the command line or the my.cnf files\nwith --version=....\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/version/','','https://mariadb.com/kb/en/library/version/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (221,18,'!=','Syntax\n------ \n, !=\n \nDescription\n----------- \nNot equal operator. Evaluates both SQL expressions and\nreturns 1 if they are not equal and 0 if they are equal, or\nNULL if either expression is NULL. If the expressions return\ndifferent data types, (for instance, a number and a string),\nperforms type conversion.\n \nWhen used in row comparisons these two queries return the\nsame results:\n \nSELECT (t1.a, t1.b) != (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n \nSELECT (t1.a != t2.x) OR (t1.b != t2.y)\nFROM t1 INNER JOIN t2;\n \nExamples\n-------- \nSELECT \'.01\' \'0.01\';\n \n+-----------------+\n| \'.01\' \'0.01\' |\n+-----------------+\n| 1 |\n+-----------------+\n \nSELECT .01 \'0.01\';\n \n+---------------+\n| .01 \'0.01\' |\n+---------------+\n| 0 |\n+---------------+\n \nSELECT \'zapp\' \'zappp\';\n \n+-------------------+\n| \'zapp\' \'zappp\' |\n+-------------------+\n| 1 |\n+-------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/not-equal/','','https://mariadb.com/kb/en/library/not-equal/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (222,18,'&lt;','Syntax\n------ \n\n\nURL: https://mariadb.com/kb/en/library/less-than/','','https://mariadb.com/kb/en/library/less-than/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (223,18,'&lt;=','Syntax\n------ \n\n\nURL: https://mariadb.com/kb/en/library/less-than-or-equal/','','https://mariadb.com/kb/en/library/less-than-or-equal/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (224,18,'&lt;=&gt;','Syntax\n------ \n\n \nDescription\n----------- \nNULL-safe equal operator. It performs an equality comparison\nlike\nthe = operator, but returns 1 rather than NULL if both\noperands are\nNULL, and 0 rather than NULL if one operand is NULL.\n \na b is equivalent to a = b OR (a IS NULL AND b IS NULL).\n \nWhen used in row comparisons these two queries return the\nsame results:\n \nSELECT (t1.a, t1.b) (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n \nSELECT (t1.a t2.x) AND (t1.b t2.y)\nFROM t1 INNER JOIN t2;\n \nSee also NULL Values in MariaDB.\n \nExamples\n-------- \nSELECT 1 1, NULL NULL, 1 NULL;\n \n+---------+---------------+------------+\n| 1 1 | NULL NULL | 1 NULL |\n+---------+---------------+------------+\n| 1 | 1 | 0 |\n+---------+---------------+------------+\n \nSELECT 1 = 1, NULL = NULL, 1 = NULL;\n \n+-------+-------------+----------+\n| 1 = 1 | NULL = NULL | 1 = NULL |\n+-------+-------------+----------+\n| 1 | NULL | NULL |\n+-------+-------------+----------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/null-safe-equal/','','https://mariadb.com/kb/en/library/null-safe-equal/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (225,18,'=','Syntax\n------ \nleft_expr = right_expr\n \nDescription\n----------- \nEqual operator. Evaluates both SQL expressions and returns 1\nif they are equal, 0 if they are not equal, or NULL if\neither expression is NULL. If the expressions return\ndifferent data types (for example, a number and a string), a\ntype conversion is performed.\n \nWhen used in row comparisons these two queries are\nsynonymous and return the same results:\n \nSELECT (t1.a, t1.b) = (t2.x, t2.y) FROM t1 INNER JOIN t2;\n \nSELECT (t1.a = t2.x) AND (t1.b = t2.y) FROM t1 INNER JOIN\nt2;\n \nTo perform a NULL-safe comparison, use the operator.\n \n= can also be used as an assignment operator.\n \nExamples\n-------- \nSELECT 1 = 0;\n \n+-------+\n| 1 = 0 |\n+-------+\n| 0 |\n+-------+\n \nSELECT \'0\' = 0;\n \n+---------+\n| \'0\' = 0 |\n+---------+\n| 1 |\n+---------+\n \nSELECT \'0.0\' = 0;\n \n+-----------+\n| \'0.0\' = 0 |\n+-----------+\n| 1 |\n+-----------+\n \nSELECT \'0.01\' = 0;\n \n+------------+\n| \'0.01\' = 0 |\n+------------+\n| 0 |\n+------------+\n \nSELECT \'.01\' = 0.01;\n \n+--------------+\n| \'.01\' = 0.01 |\n+--------------+\n| 1 |\n+--------------+\n \nSELECT (5 * 2) = CONCAT(\'1\', \'0\');\n+----------------------------+\n| (5 * 2) = CONCAT(\'1\', \'0\') |\n+----------------------------+\n| 1 |\n+----------------------------+\n \nSELECT 1 = NULL;\n \n+----------+\n| 1 = NULL |\n+----------+\n| NULL |\n+----------+\n \nSELECT NULL = NULL;\n \n+-------------+\n| NULL = NULL |\n+-------------+\n| NULL |\n+-------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/equal/','','https://mariadb.com/kb/en/library/equal/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (226,18,'&gt;','Syntax\n------ \n>\n \nDescription\n----------- \nGreater than operator. Evaluates both SQL expressions and\nreturns 1 if the left value is greater than the right value\nand 0 if it is not, or NULL if either expression is NULL. If\nthe expressions return different data types, (for instance,\na number and a string), performs type conversion.\n \nWhen used in row comparisons these two queries return the\nsame results:\n \nSELECT (t1.a, t1.b) > (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n \nSELECT (t1.a > t2.x) OR ((t1.a = t2.x) AND (t1.b > t2.y))\nFROM t1 INNER JOIN t2;\n \nExamples\n-------- \nSELECT 2 > 2;\n \n+-------+\n| 2 > 2 |\n+-------+\n| 0 |\n+-------+\n \nSELECT \'b\' > \'a\';\n \n+-----------+\n| \'b\' > \'a\' |\n+-----------+\n| 1 |\n+-----------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/greater-than/','','https://mariadb.com/kb/en/library/greater-than/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (227,18,'&gt;=','Syntax\n------ \n>=\n \nDescription\n----------- \nGreater than or equal operator. Evaluates both SQL\nexpressions and returns 1 if the left value is greater than\nor equal to the right value and 0 if it is not, or NULL if\neither expression is NULL. If the expressions return\ndifferent data types, (for instance, a number and a string),\nperforms type conversion.\n \nWhen used in row comparisons these two queries return the\nsame results:\n \nSELECT (t1.a, t1.b) >= (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n \nSELECT (t1.a > t2.x) OR ((t1.a = t2.x) AND (t1.b >= t2.y))\nFROM t1 INNER JOIN t2;\n \nExamples\n-------- \nSELECT 2 >= 2;\n \n+--------+\n| 2 >= 2 |\n+--------+\n| 1 |\n+--------+\n \nSELECT \'A\' >= \'a\';\n \n+------------+\n| \'A\' >= \'a\' |\n+------------+\n| 1 |\n+------------+\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/greater-than-or-equal/','','https://mariadb.com/kb/en/library/greater-than-or-equal/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (228,18,'BETWEEN AND','Syntax\n------ \nexpr BETWEEN min AND max\n \nDescription\n----------- \nIf expr is greater than or equal to min and expr is less\nthan or equal\nto max, BETWEEN returns 1, otherwise it returns 0. This is\nequivalent\nto the expression (min \n\nURL: https://mariadb.com/kb/en/library/between-and/','','https://mariadb.com/kb/en/library/between-and/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (229,18,'COALESCE','Syntax\n------ \nCOALESCE(value,...)\n \nDescription\n----------- \nReturns the first non-NULL value in the list, or NULL if\nthere are no\nnon-NULL values. At least one parameter must be passed.\n \nSee also NULL Values in MariaDB.\n \nExamples\n-------- \nSELECT COALESCE(NULL,1);\n+------------------+\n| COALESCE(NULL,1) |\n+------------------+\n| 1 |\n+------------------+\n \nSELECT COALESCE(NULL,NULL,NULL);\n+--------------------------+\n| COALESCE(NULL,NULL,NULL) |\n+--------------------------+\n| NULL |\n+--------------------------+\n \nWhen two arguments are given, COALESCE() is the same as\nIFNULL():\n \nSET @a=NULL, @b=1;\n \nSELECT COALESCE(@a, @b), IFNULL(@a, @b);\n+------------------+----------------+\n| COALESCE(@a, @b) | IFNULL(@a, @b) |\n+------------------+----------------+\n| 1 | 1 |\n+------------------+----------------+\n \nHex type confusion:\n \nCREATE TABLE t1 (a INT, b VARCHAR(10));\nINSERT INTO t1 VALUES (0x31, 0x61),(COALESCE(0x31),\nCOALESCE(0x61));\n \nSELECT * FROM t1;\n \n+------+------+\n| a | b |\n+------+------+\n| 49 | a |\n| 1 | a |\n+------+------+\n \nThe reason for the differing results above is that when 0x31\nis inserted directly to the column, it\'s treated as a\nnumber (see Hexadecimal Literals), while when 0x31 is passed\nto COALESCE(), it\'s treated as a string, because:\nHEX values have a string data type by default.\nCOALESCE() has the same data type as the argument. \n \n\n\nURL: https://mariadb.com/kb/en/library/coalesce/','','https://mariadb.com/kb/en/library/coalesce/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (230,18,'GREATEST','Syntax\n------ \nGREATEST(value1,value2,...)\n \nDescription\n----------- \nWith two or more arguments, returns the largest\n(maximum-valued)\nargument. The arguments are compared using the same rules as\nfor\nLEAST().\n \nExamples\n-------- \nSELECT GREATEST(2,0);\n+---------------+\n| GREATEST(2,0) |\n+---------------+\n| 2 |\n+---------------+\n \nSELECT GREATEST(34.0,3.0,5.0,767.0);\n+------------------------------+\n| GREATEST(34.0,3.0,5.0,767.0) |\n+------------------------------+\n| 767.0 |\n+------------------------------+\n \nSELECT GREATEST(\'B\',\'A\',\'C\');\n+-----------------------+\n| GREATEST(\'B\',\'A\',\'C\') |\n+-----------------------+\n| C |\n+-----------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/greatest/','','https://mariadb.com/kb/en/library/greatest/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (231,18,'IN','Syntax\n------ \nexpr IN (value,...)\n \nDescription\n----------- \nReturns 1 if expr is equal to any of the values in the IN\nlist, else\nreturns 0. If all values are constants, they are evaluated\naccording\nto the type of expr and sorted. The search for the item then\nis done\nusing a binary search. This means IN is very quick if the IN\nvalue\nlist consists entirely of constants. Otherwise, type\nconversion takes\nplace according to the rules described at Type Conversion,\nbut\napplied to all the arguments.\n \nIf expr is NULL, IN always returns NULL. If at least one of\nthe values in the list is NULL, and one of the comparisons\nis true, the result is 1. If at least one of the values in\nthe list is NULL and none of the comparisons is true, the\nresult is NULL.\n \nExamples\n-------- \nSELECT 2 IN (0,3,5,7);\n+----------------+\n| 2 IN (0,3,5,7) |\n+----------------+\n| 0 |\n+----------------+\n \nSELECT \'wefwf\' IN (\'wee\',\'wefwf\',\'weg\');\n+----------------------------------+\n| \'wefwf\' IN (\'wee\',\'wefwf\',\'weg\') |\n+----------------------------------+\n| 1 |\n+----------------------------------+ \n \nType conversion:\n \nSELECT 1 IN (\'1\', \'2\', \'3\');\n+----------------------+\n| 1 IN (\'1\', \'2\', \'3\') |\n+----------------------+\n| 1 |\n+----------------------+\n \nSELECT NULL IN (1, 2, 3);\n+-------------------+\n| NULL IN (1, 2, 3) |\n+-------------------+\n| NULL |\n+-------------------+\n \nMariaDB [(none)]> SELECT 1 IN (1, 2, NULL);\n+-------------------+\n| 1 IN (1, 2, NULL) |\n+-------------------+\n| 1 |\n+-------------------+\n \nMariaDB [(none)]> SELECT 5 IN (1, 2, NULL);\n+-------------------+\n| 5 IN (1, 2, NULL) |\n+-------------------+\n| NULL |\n+-------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/in/','','https://mariadb.com/kb/en/library/in/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (232,18,'INTERVAL','Syntax\n------ \nINTERVAL(N,N1,N2,N3,...)\n \nDescription\n----------- \nReturns the index of the last argument that is less than the\nfirst argument or is NULL. \n \nReturns 0 if N < N1, 1 if N < N2, 2 if N < N3 and so on or\n-1 if N is NULL. All\narguments are treated as integers. It is required that N1 <\nN2 < N3 \n\nURL: https://mariadb.com/kb/en/library/interval/','','https://mariadb.com/kb/en/library/interval/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (233,18,'IS','Syntax\n------ \nIS boolean_value\n \nDescription\n----------- \nTests a value against a boolean value, where boolean_value\ncan be\nTRUE, FALSE, or UNKNOWN.\n \nThere is an important difference between using IS TRUE or\ncomparing a value with TRUE using =. When using =, only 1\nequals to TRUE. But when using IS TRUE, all values which are\nlogically true (like a number > 1) return TRUE.\n \nExamples\n-------- \nSELECT 1 IS TRUE, 0 IS FALSE, NULL IS UNKNOWN;\n+-----------+------------+-----------------+\n| 1 IS TRUE | 0 IS FALSE | NULL IS UNKNOWN |\n+-----------+------------+-----------------+\n| 1 | 1 | 1 |\n+-----------+------------+-----------------+\n \nDifference between = and IS TRUE:\n \nSELECT 2 = TRUE, 2 IS TRUE;\n+----------+-----------+\n| 2 = TRUE | 2 IS TRUE |\n+----------+-----------+\n| 0 | 1 |\n+----------+-----------+\n \n\n\nURL: https://mariadb.com/kb/en/library/is/','','https://mariadb.com/kb/en/library/is/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (234,18,'IS NOT','Syntax\n------ \nIS NOT boolean_value\n \nDescription\n----------- \nTests a value against a boolean value, where boolean_value\ncan be\nTRUE, FALSE, or UNKNOWN. \n \nExamples\n-------- \nSELECT 1 IS NOT UNKNOWN, 0 IS NOT UNKNOWN, NULL IS NOT\nUNKNOWN;\n+------------------+------------------+---------------------+\n| 1 IS NOT UNKNOWN | 0 IS NOT UNKNOWN | NULL IS NOT UNKNOWN\n|\n+------------------+------------------+---------------------+\n| 1 | 1 | 0 |\n+------------------+------------------+---------------------+\n \nSELECT NULL IS NOT TRUE, NULL IS NOT FALSE;\n+------------------+-------------------+\n| NULL IS NOT TRUE | NULL IS NOT FALSE |\n+------------------+-------------------+\n| 1 | 1 |\n+------------------+-------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/is-not/','','https://mariadb.com/kb/en/library/is-not/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (235,18,'IS NOT NULL','Syntax\n------ \nIS NOT NULL\n \nDescription\n----------- \nTests whether a value is not NULL. See also NULL Values in\nMariaDB.\n \nExamples\n-------- \nSELECT 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;\n+---------------+---------------+------------------+\n| 1 IS NOT NULL | 0 IS NOT NULL | NULL IS NOT NULL |\n+---------------+---------------+------------------+\n| 1 | 1 | 0 |\n+---------------+---------------+------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/is-not-null/','','https://mariadb.com/kb/en/library/is-not-null/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (236,18,'IS NULL','Syntax\n------ \nIS NULL\n \nDescription\n----------- \nTests whether a value is NULL. See also NULL Values in\nMariaDB.\n \nExamples\n-------- \nSELECT 1 IS NULL, 0 IS NULL, NULL IS NULL;\n+-----------+-----------+--------------+\n| 1 IS NULL | 0 IS NULL | NULL IS NULL |\n+-----------+-----------+--------------+\n| 0 | 0 | 1 |\n+-----------+-----------+--------------+\n \nCompatibility\n \nSome ODBC applications use the syntax auto_increment_field\nIS NOT NULL to find the latest row that was inserted with an\nautogenerated key value. If your applications need this, you\ncan set the sql_auto_is_null variable to 1.\n \nSET @@sql_auto_is_null=1;\nCREATE TABLE t1 (auto_increment_column INT NOT NULL\nAUTO_INCREMENT PRIMARY KEY);\nINSERT INTO t1 VALUES (NULL);\nSELECT * FROM t1 WHERE auto_increment_column IS NULL;\n \n+-----------------------+\n| auto_increment_column |\n+-----------------------+\n| 1 |\n+-----------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/is-null/','','https://mariadb.com/kb/en/library/is-null/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (237,18,'ISNULL','Syntax\n------ \nISNULL(expr)\n \nDescription\n----------- \nIf expr is NULL, ISNULL() returns 1, otherwise it returns 0.\n \nSee also NULL Values in MariaDB.\n \nExamples\n-------- \nSELECT ISNULL(1+1);\n+-------------+\n| ISNULL(1+1) |\n+-------------+\n| 0 |\n+-------------+\n \nSELECT ISNULL(1/0);\n+-------------+\n| ISNULL(1/0) |\n+-------------+\n| 1 |\n+-------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/isnull/','','https://mariadb.com/kb/en/library/isnull/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (238,18,'LEAST','Syntax\n------ \nLEAST(value1,value2,...)\n \nDescription\n----------- \nWith two or more arguments, returns the smallest\n(minimum-valued)\nargument. The arguments are compared using the following\nrules:\nIf the return value is used in an INTEGER context or all\narguments are integer-valued, they are compared as integers.\nIf the return value is used in a REAL context or all\narguments are real-valued, they are compared as reals.\nIf any argument is a case-sensitive string, the arguments\nare compared as case-sensitive strings.\nIn all other cases, the arguments are compared as\ncase-insensitive strings.\n \nLEAST() returns NULL if any argument is NULL.\n \nExamples\n-------- \nSELECT LEAST(2,0);\n+------------+\n| LEAST(2,0) |\n+------------+\n| 0 |\n+------------+\n \nSELECT LEAST(34.0,3.0,5.0,767.0);\n+---------------------------+\n| LEAST(34.0,3.0,5.0,767.0) |\n+---------------------------+\n| 3.0 |\n+---------------------------+\n \nSELECT LEAST(\'B\',\'A\',\'C\');\n+--------------------+\n| LEAST(\'B\',\'A\',\'C\') |\n+--------------------+\n| A |\n+--------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/least/','','https://mariadb.com/kb/en/library/least/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (239,18,'NOT BETWEEN','Syntax\n------ \nexpr NOT BETWEEN min AND max\n \nDescription\n----------- \nThis is the same as NOT (expr BETWEEN min AND max).\n \nNote that the meaning of the alternative form NOT expr\nBETWEEN min AND max is affected by the HIGH_NOT_PRECEDENCE\nSQL_MODE flag.\n \nExamples\n-------- \nSELECT 1 NOT BETWEEN 2 AND 3;\n+-----------------------+\n| 1 NOT BETWEEN 2 AND 3 |\n+-----------------------+\n| 1 |\n+-----------------------+\n \nSELECT \'b\' NOT BETWEEN \'a\' AND \'c\';\n+-----------------------------+\n| \'b\' NOT BETWEEN \'a\' AND \'c\' |\n+-----------------------------+\n| 0 |\n+-----------------------------+\n \nNULL:\n \nSELECT 1 NOT BETWEEN 1 AND NULL;\n+--------------------------+\n| 1 NOT BETWEEN 1 AND NULL |\n+--------------------------+\n| NULL |\n+--------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/not-between/','','https://mariadb.com/kb/en/library/not-between/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (240,18,'NOT IN','Syntax\n------ \nexpr NOT IN (value,...)\n \nDescription\n----------- \nThis is the same as NOT (expr IN (value,...)).\n \nExamples\n-------- \nSELECT 2 NOT IN (0,3,5,7);\n+--------------------+\n| 2 NOT IN (0,3,5,7) |\n+--------------------+\n| 1 |\n+--------------------+\n \nSELECT \'wefwf\' NOT IN (\'wee\',\'wefwf\',\'weg\');\n+--------------------------------------+\n| \'wefwf\' NOT IN (\'wee\',\'wefwf\',\'weg\') |\n+--------------------------------------+\n| 0 |\n+--------------------------------------+\n \nSELECT 1 NOT IN (\'1\', \'2\', \'3\');\n+--------------------------+\n| 1 NOT IN (\'1\', \'2\', \'3\') |\n+--------------------------+\n| 0 |\n+--------------------------+\n \nNULL:\n \nSELECT NULL NOT IN (1, 2, 3);\n+-----------------------+\n| NULL NOT IN (1, 2, 3) |\n+-----------------------+\n| NULL |\n+-----------------------+\n \nSELECT 1 NOT IN (1, 2, NULL);\n+-----------------------+\n| 1 NOT IN (1, 2, NULL) |\n+-----------------------+\n| 0 |\n+-----------------------+\n \nSELECT 5 NOT IN (1, 2, NULL);\n+-----------------------+\n| 5 NOT IN (1, 2, NULL) |\n+-----------------------+\n| NULL |\n+-----------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/not-in/','','https://mariadb.com/kb/en/library/not-in/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (241,19,'Operator Precedence','The precedence is the order in which the SQL operators are\nevaluated.\n \nThe following list shows the SQL operator precedence.\nOperators that appear first in the list have a higher\nprecedence. Operators which are listed together have the\nsame precedence.\nINTERVAL\nBINARY, COLLATE\n!\n- (unary minus), [[bitwise-not|]] (unary bit inversion)\n|| (string concatenation)\n^\n*, /, DIV, %, MOD\n-, +\n \n&\n|\n= (comparison), , >=, >, \n\nURL: https://mariadb.com/kb/en/library/operator-precedence/','','https://mariadb.com/kb/en/library/operator-precedence/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (242,19,'&amp;','Syntax\n------ \n&\n \nDescription\n----------- \nBitwise AND. Converts the values to binary and compares\nbits. Only if both the corresponding bits are 1 is the\nresulting bit also 1.\n \nSee also bitwise OR.\n \nExamples\n-------- \nSELECT 2&1;\n+-----+\n| 2&1 |\n+-----+\n| 0 |\n+-----+\n \nSELECT 3&1;\n+-----+\n| 3&1 |\n+-----+\n| 1 |\n+-----+\n \nSELECT 29 & 15;\n+---------+\n| 29 & 15 |\n+---------+\n| 13 |\n+---------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/bitwise_and/','','https://mariadb.com/kb/en/library/bitwise_and/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (243,19,'&lt;&lt;','Syntax\n------ \nvalue1 \n\nURL: https://mariadb.com/kb/en/library/shift-left/','','https://mariadb.com/kb/en/library/shift-left/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (244,19,'&gt;&gt;','Syntax\n------ \nvalue1 >> value2\n \nDescription\n----------- \nConverts a longlong (BIGINT) number (value1) to binary and\nshifts value2 units to the right.\n \nExamples\n-------- \nSELECT 4 >> 2;\n+--------+\n| 4 >> 2 |\n+--------+\n| 1 |\n+--------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/shift-right/','','https://mariadb.com/kb/en/library/shift-right/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (245,19,'BIT_COUNT','Syntax\n------ \nBIT_COUNT(N)\n \nDescription\n----------- \nReturns the number of bits that are set in the argument N.\n \nExamples\n-------- \nSELECT BIT_COUNT(29), BIT_COUNT(b\'101010\');\n+---------------+----------------------+\n| BIT_COUNT(29) | BIT_COUNT(b\'101010\') |\n+---------------+----------------------+\n| 4 | 3 |\n+---------------+----------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/bit_count/','','https://mariadb.com/kb/en/library/bit_count/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (246,19,'^','Syntax\n------ \n^\n \nDescription\n----------- \nBitwise XOR. Converts the values to binary and compares\nbits. If one (and only one) of the corresponding bits is 1\nis the resulting bit also 1.\n \nExamples\n-------- \nSELECT 1 ^ 1;\n+-------+\n| 1 ^ 1 |\n+-------+\n| 0 |\n+-------+\n \nSELECT 1 ^ 0;\n+-------+\n| 1 ^ 0 |\n+-------+\n| 1 |\n+-------+\n \nSELECT 11 ^ 3;\n+--------+\n| 11 ^ 3 |\n+--------+\n| 8 |\n+--------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/bitwise-xor/','','https://mariadb.com/kb/en/library/bitwise-xor/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (247,19,'|','Syntax\n------ \n|\n \nDescription\n----------- \nBitwise OR. Converts the values to binary and compares bits.\nIf either of the corresponding bits has a value of 1, the\nresulting bit is also 1.\n \nSee also bitwise AND.\n \nExamples\n-------- \nSELECT 2|1;\n+-----+\n| 2|1 |\n+-----+\n| 3 |\n+-----+\n \nSELECT 29 | 15;\n+---------+\n| 29 | 15 |\n+---------+\n| 31 |\n+---------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/bitwise-or/','','https://mariadb.com/kb/en/library/bitwise-or/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (248,19,'~','Syntax\n------ \n~\n \nDescription\n----------- \nBitwise NOT. Converts the value to 4 bytes binary and\ninverts all bits.\n \nExamples\n-------- \nSELECT 3 & ~1;\n+--------+\n| 3 & ~1 |\n+--------+\n| 2 |\n+--------+\n \nSELECT 5 & ~1;\n+--------+\n| 5 & ~1 |\n+--------+\n| 4 |\n+--------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/bitwise-not/','','https://mariadb.com/kb/en/library/bitwise-not/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (249,19,'Parentheses','Parentheses are sometimes called precedence operators - this\nmeans that they can be used to change the other operator\'s\nprecedence in an expression. The expressions that are\nwritten between parentheses are computed before the\nexpressions that are written outside. Parentheses must\nalways contain an expression (that is, they cannot be\nempty), and can be nested.\n \nFor example, the following expressions could return\ndifferent results:\nNOT a OR b\nNOT (a OR b)\n \nIn the first case, NOT applies to a, so if a is FALSE or b\nis TRUE, the expression returns TRUE. In the second case,\nNOT applies to the result of a OR b, so if at least one of a\nor b is TRUE, the expression is TRUE.\n \nWhen the precedence of operators is not intuitive, you can\nuse parentheses to make it immediately clear for whoever\nreads the statement.\n \nThe precedence of the NOT operator can also be affected by\nthe HIGH_NOT_PRECEDENCE SQL_MODE flag.\n \nOther uses\n \nParentheses must always be used to enclose subqueries.\n \nParentheses can also be used in a JOIN statement between\nmultiple tables to determine which tables must be joined\nfirst.\n \nAlso, parentheses are used to enclose the list of parameters\nto be passed to built-in functions, user-defined functions\nand stored routines. However, when no parameter is passed to\na stored procedure, parentheses are optional. For builtin\nfunctions and user-defined functions, spaces are not allowed\nbetween the function name and the open parenthesis, unless\nthe IGNORE_SPACE SQL_MODE is set. For stored routines (and\nfor functions if IGNORE_SPACE is set) spaces are allowed\nbefore the open parenthesis, including tab characters and\nnew line characters.\n \nSyntax errors\n \nIf there are more open parentheses than closed parentheses,\nthe error usually looks like this:\n \nERROR 1064 (42000): You have an error in your SQL syntax;\ncheck the manual that\ncorresponds to your MariaDB server version for the right\nsyntax to use near \'\' a\nt line 1\n \nNote the empty string.\n \nIf there are more closed parentheses than open parentheses,\nthe error usually looks like this:\n \nERROR 1064 (42000): You have an error in your SQL syntax;\ncheck the manual that\ncorresponds to your MariaDB server version for the right\nsyntax to use near \')\'\nat line 1\n \nNote the quoted closed parenthesis.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/parentheses/','','https://mariadb.com/kb/en/library/parentheses/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (250,19,'TRUE FALSE','Description\n----------- \nThe constants TRUE and FALSE evaluate to 1 and 0,\nrespectively. The\nconstant names can be written in any lettercase.\n \nExamples\n-------- \nSELECT TRUE, true, FALSE, false;\n \n+------+------+-------+-------+\n| TRUE | TRUE | FALSE | FALSE |\n+------+------+-------+-------+\n| 1 | 1 | 0 | 0 |\n+------+------+-------+-------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/true-false/','','https://mariadb.com/kb/en/library/true-false/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (251,20,'ANALYZE TABLE','Syntax\n------ \nANALYZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name\n[,tbl_name ...] \n [PERSISTENT FOR [ALL|COLUMNS ([col_name [,col_name ...]])] \n [INDEXES ([index_name [,index_name ...]])]] \n \nDescription\n----------- \nANALYZE TABLE analyzes and stores the key distribution for a\ntable (index statistics). During the analysis, the table is\nlocked with a read lock. This statement works with MyISAM,\nAria and InnoDB tables. For MyISAM tables, this statement is\nequivalent\nto using myisamchk --analyze.\n \nFor more information on how the analysis works within\nInnoDB, see\nInnoDB Limitations.\n \nMariaDB uses the stored key distribution to decide the order\nin which\ntables should be joined when you perform a join on something\nother than\na constant. In addition, key distributions can be used when\ndeciding\nwhich indexes to use for a specific table within a query.\n \nThis statement requires SELECT and INSERT privileges for the\ntable.\n \nBy default, ANALYZE TABLE statements are written to the\nbinary log and will be replicated. The NO_WRITE_TO_BINLOG\nkeyword (LOCAL is an alias) will ensure the statement is not\nwritten to the binary log. \n \nANALYZE TABLE is also supported for partitioned tables. You\ncan use ALTER TABLE ... ANALYZE PARTITION to analyze one or\nmore partitions.\n \nEngine-Independent Statistics\n \nMariaDB 10.0.1 extended ANALYZE TABLE to support\nengine-independent statistics.\n \nEngine-independent statistics are collected by doing full\ntable and full index scans, and collecting can be quite\nexpensive. \n \nANALYZE TABLE behavior depends on the value of the\nuse_stat_tables system variable.\n \nIf use_stat_tables is set to never (default in = MariaDB\n10.4.1), ANALYZE TABLE t will collect storage engine\nstatistics, and not engine-independent statistics.\n \nIf use_stat_tables is set to complementary or preferably,\nANALYZE TABLE t will collect engine-independent statistics. \n \nIn order to collect engine-independent statistics when\nuse_stat_tables is not set to one of the above two values\n(it is not by default), the extended form of ANALYZE TABLE,\nusing PERSISTENT FOR, must be used. This also allows one to\ncollect statistics only for particular columns or indexes.\nNote that engine-independent statistics are used by default\nfrom MariaDB 10.4 (use_stat_tables=preferably_for_queries),\nso you will probably want to use PERSISTENT FOR.\n \nIt is recommended to collect engine-independent statistics\non as-needed basis, so typically one will not have\nengine-independent statistics for all indexes/all columns. \n \nNote that statistics for blob and text columns are not\ncollected. If explicitly specified, a warning is returned.\n \n-- update all engine-independent statistics for all columns\nand indexes\nANALYZE TABLE tbl PERSISTENT FOR ALL;\n \n-- update specific columns and indexes:\nANALYZE TABLE tbl PERSISTENT FOR COLUMNS (col1,col2,...)\nINDEXES (idx1,idx2,...);\n \n-- empty lists are allowed:\nANALYZE TABLE tbl PERSISTENT FOR COLUMNS (col1,col2,...)\nINDEXES ();\nANALYZE TABLE tbl PERSISTENT FOR COLUMNS () INDEXES\n(idx1,idx2,...);\n \n-- the following will only update mysql.table_stat fields:\nANALYZE TABLE tbl PERSISTENT FOR COLUMNS () INDEXES ();\n \n-- with use_stat_tables = COMPLEMENTARY, a simple ANALYZE\nTABLE \n-- collects engine-independent statistics for all columns\nand indexes.\nSET SESSION use_stat_tables=\'COMPLEMENTARY\';\n \nANALYZE TABLE tbl;\n \nThe PERSISTENT FOR is required to update the\nengine-independent statistics even if the table has the\noption STATS_PERSISTENT=1 (which refers to InnoDB Persistent\nStatistics).\n \nThe Aria storage engine supports progress reporting for the\nANALYZE TABLE statement.\n \n\n\nURL: https://mariadb.com/kb/en/library/analyze-table/','','https://mariadb.com/kb/en/library/analyze-table/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (252,20,'CHECK TABLE','Syntax\n------ \nCHECK TABLE tbl_name [, tbl_name] ... [option] ...\n \noption = {FOR UPGRADE | QUICK | FAST | MEDIUM | EXTENDED |\nCHANGED}\n \nDescription\n----------- \nCHECK TABLE checks a table or tables for errors. CHECK TABLE\nworks for\nArchive, Aria, CSV, InnoDB, and MyISAM tables. For Aria and\nMyISAM tables, the\nkey statistics are updated as well. For CSV, see also\nChecking and Repairing CSV Tables.\n \nAs an alternative, myisamchk is a commandline tool for\nchecking MyISAM tables when the tables are not being\naccessed.\n \nFor checking dynamic columns integrity, COLUMN_CHECK() can\nbe used.\n \nCHECK TABLE can also check views for problems, such as\ntables\nthat are referenced in the view definition that no longer\nexist.\n \nCHECK TABLE is also supported for partitioned tables. You\ncan\nuse ALTER TABLE ... CHECK PARTITION \nto check one or more partitions.\n \nThe meaning of the different options are as follows - note\nthat this can vary a bit between\nstorage engines:\n \nFOR UPGRADE | Do a very quick check if the storage format\nfor the table has changed so that one needs to do a REPAIR.\nThis is only needed when one upgrades between major versions\nof MariaDB or MySQL. This is usually done by running\nmysql_upgrade. | \n \nFAST | Only check tables that has not been closed properly\nor are marked as corrupt. Only supported by the MyISAM and\nAria engines. For other engines the table is checked\nnormally | \n \nCHANGED | Check only tables that has changed since last\nREPAIR / CHECK. Only supported by the MyISAM and Aria\nengines. For other engines the table is checked normally. | \n \nQUICK | Do a fast check. For MyISAM and Aria engine this\nmeans we skip checking the delete link chain which may take\nsome time. | \n \nMEDIUM | Scan also the data files. Checks integrity between\ndata and index files with checksums. In most cases this\nshould find all possible errors. | \n \nEXTENDED | Does a full check to verify every possible error.\nFor MyISAM and Aria we verify for each row that all it keys\nexists and points to the row. This may take a long time on\nbig tables! | \n \nFor most cases running CHECK TABLE without options or MEDIUM\nshould be\ngood enough.\n \nSince MariaDB 5.3, the Aria storage engine supports progress\nreporting for this statement.\n \nIf you want to know if two tables are identical, take a look\nat CHECKSUM TABLE.\n \nXtraDB/InnoDB\n \nIf CHECK TABLE finds an error in an InnoDB table, MariaDB\nmight shutdown to prevent the error propagation. In this\ncase, the problem will be reported in the error log.\nOtherwise, since MariaDB 5.5, the table or an index might be\nmarked as corrupted, to prevent use. This does not happen\nwith some minor problems, like a wrong number of entries in\na secondary index. Those problems are reported in the output\nof CHECK TABLE.\n \nEach tablespace contains a header with metadata. This header\nis not checked by this statement.\n \nDuring the execution of CHECK TABLE, other threads may be\nblocked.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/sql-commands-check-table/','','https://mariadb.com/kb/en/library/sql-commands-check-table/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (253,20,'CHECK VIEW','CHECK VIEW was introduced in MariaDB 10.0.18.\n \nSyntax\n------ \nCHECK VIEW view_name\n \nDescription\n----------- \nThe CHECK VIEW statement was introduced in MariaDB 10.0.18\nto assist with fixing MDEV-6916, an issue introduced in\nMariaDB 5.2 where the view algorithms were swapped. It\nchecks whether the view algorithm is correct. It is run as\npart of mysql_upgrade, and should not normally be required\nin regular use.\n \n\n\nURL: https://mariadb.com/kb/en/library/check-view/','','https://mariadb.com/kb/en/library/check-view/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (254,20,'CHECKSUM TABLE','Syntax\n------ \nCHECKSUM TABLE tbl_name [, tbl_name] ... [ QUICK | EXTENDED\n]\n \nDescription\n----------- \nCHECKSUM TABLE reports a table checksum. This is very\nuseful if you want to know if two tables are the same (for\nexample on a master\nand slave).\n \nWith QUICK, the live table checksum is reported if it is\navailable, or NULL otherwise. This is very fast. A live\nchecksum is enabled by specifying the CHECKSUM=1 table\noption when you create the table; currently, this is\nsupported\nonly for Aria and MyISAM tables.\n \nWith EXTENDED, the entire table is read row by row and the\nchecksum is calculated. This can be very slow for large\ntables.\n \nIf neither QUICK nor EXTENDED is\nspecified, MariaDB returns a live checksum if the table\nstorage engine supports\nit and scans the table otherwise.\n \nCHECKSUM TABLE requires the SELECT privilege for the table.\n \nFor a nonexistent table, CHECKSUM TABLE returns\nNULL and generates a warning.\n \nThe table row format affects the checksum value. If the row\nformat changes, the checksum will change. This means that\nwhen a table created with a MariaDB/MySQL version is\nupgraded to another version, the checksum value will\nprobably change.\n \nTwo identical tables should always match to the same\nchecksum value; however, also for non-identical tables there\nis a very slight chance that they will return the same value\nas the hashing algorithm is not completely collision-free.\n \nDifferences Between MariaDB and MySQL\n \nCHECKSUM TABLE may give a different result as MariaDB\ndoesn\'t\nignore NULLs in the columns as MySQL 5.1 does (Later MySQL\nversions should calculate checksums the same way as\nMariaDB). You can get the\n\'old style\' checksum in MariaDB by starting mysqld with\nthe\n--old option. Note however that that the MyISAM and Aria\nstorage engines in MariaDB are using the new checksum\ninternally, so if you are\nusing --old, the CHECKSUM command will be\nslower as it needs to calculate the checksum row by row.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/checksum-table/','','https://mariadb.com/kb/en/library/checksum-table/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (255,20,'OPTIMIZE TABLE','Syntax\n------ \nOPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n [WAIT n | NOWAIT]\n \nDescription\n----------- \nOPTIMIZE TABLE has two main functions. It can either be used\nto defragment tables, or to update the InnoDB fulltext\nindex.\n \nWAIT/NOWAIT\n \nSet the lock wait timeout. See WAIT and NOWAIT.\n \nDefragmenting\n \nOPTIMIZE TABLE works for InnoDB (before MariaDB 10.1.1, only\nif the innodb_file_per_table server system variable is set),\nAria, MyISAM and ARCHIVE tables, and should be used if you\nhave deleted a large part of a table or if you have made\nmany changes to a table with variable-length\nrows (tables that have VARCHAR, VARBINARY, BLOB, or TEXT\ncolumns). Deleted rows are maintained in a\nlinked list and subsequent INSERT operations reuse old row\npositions.\n \nThis statement requires SELECT and INSERT privileges for the\ntable.\n \nBy default, OPTIMIZE TABLE statements are written to the\nbinary log and will be replicated. The NO_WRITE_TO_BINLOG\nkeyword (LOCAL is an alias) will ensure the statement is not\nwritten to the binary log. \n \nOPTIMIZE TABLE is also supported for partitioned tables. You\ncan use \nALTER TABLE ... OPTIMIZE PARTITION \nto optimize one or more partitions.\n \nYou can use OPTIMIZE TABLE to reclaim the unused\nspace and to defragment the data file. With other storage\nengines, OPTIMIZE TABLE does nothing by default, and returns\nthis message: \" The storage engine for the table doesn\'t\nsupport optimize\". However, if the server has been started\nwith the --skip-new option, OPTIMIZE TABLE is linked to\nALTER TABLE, and recreates the table. This operation frees\nthe unused space and updates index statistics.\n \nSince MariaDB 5.3, the Aria storage engine supports progress\nreporting for this statement.\n \nIf a MyISAM table is fragmented, concurrent inserts will not\nbe performed until an OPTIMIZE TABLE statement is executed\non that table, unless the concurrent_insert server system\nvariable is set to ALWAYS.\n \nUpdating an InnoDB fulltext index\n \nWhen rows are added or deleted to an InnoDB fulltext index,\nthe index is not immediately re-organized, as this can be an\nexpensive operation. Change statistics are stored in a\nseparate location . The fulltext index is only fully\nre-organized when an OPTIMIZE TABLE statement is run.\n \nBy default, an OPTIMIZE TABLE will defragment a table. In\norder to use it to update fulltext index statistics, the\ninnodb_optimize_fulltext_only system variable must be set to\n1. This is intended to be a temporary setting, and should be\nreset to 0 once the fulltext index has been re-organized.\n \nSince fulltext re-organization can take a long time, the\ninnodb_ft_num_word_optimize variable limits the\nre-organization to a number of words (2000 by default). You\ncan run multiple OPTIMIZE statements to fully re-organize\nthe index.\n \nDefragmenting InnoDB tablespaces\n \nMariaDB 10.1.1 merged the Facebook/Kakao defragmentation\npatch \n \nMariaDB 10.1.1 merged the Facebook/Kakao defragmentation\npatch, allowing one to use OPTIMIZE TABLE to defragment\nInnoDB tablespaces. For this functionality to be enabled,\nthe innodb_defragment system variable must be enabled. No\nnew tables are created and there is no need to copy data\nfrom old tables to new tables. Instead, this feature loads n\npages (determined by innodb-defragment-n-pages) and tries to\nmove records so that pages would be full of records and then\nfrees pages that are fully empty after the operation. Note\nthat tablespace files (including ibdata1) will not shrink as\nthe result of defragmentation, but one will get better\nmemory utilization in the InnoDB buffer pool as there are\nfewer data pages in use.\n \nSee Defragmenting InnoDB Tablespaces for more details.\n \n\n\nURL: https://mariadb.com/kb/en/library/optimize-table/','','https://mariadb.com/kb/en/library/optimize-table/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (256,20,'REPAIR TABLE','Syntax\n------ \nREPAIR [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n [QUICK] [EXTENDED] [USE_FRM]\n \nDescription\n----------- \nREPAIR TABLE repairs a possibly corrupted table. By default,\nit has the same effect as\n \nmyisamchk --recover tbl_name\n \nor\n \naria_chk --recover tbl_name\n \nSee aria_chk and myisamchk for more.\n \nREPAIR TABLE works for Archive, Aria, CSV and MyISAM tables.\nFor XtraDB/InnoDB, see recovery modes. For CSV, see also\nChecking and Repairing CSV Tables. For Archive, this\nstatement also improves compression. If the storage engine\ndoes not support this statement, a warning is issued.\n \nThis statement requires SELECT and INSERT privileges for the\ntable.\n \nBy default, REPAIR TABLE statements are written to the\nbinary log and will be replicated. The NO_WRITE_TO_BINLOG\nkeyword (LOCAL is an alias) will ensure the statement is not\nwritten to the binary log.\n \nWhen an index is recreated, the storage engine may use a\nconfigurable buffer in the process. Incrementing the buffer\nspeeds up the index creation. Aria and MyISAM allocate a\nbuffer whose size is defined by aria_sort_buffer_size or\nmyisam_sort_buffer_size, also used for ALTER TABLE.\n \nREPAIR TABLE is also supported for partitioned tables.\nHowever, the USE_FRM option cannot be used with this\nstatement\non a partitioned table.\n \n ALTER TABLE ... REPAIR PARTITION can be used\nto repair one or more partitions.\n \nThe Aria storage engine supports progress reporting for this\nstatement.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/repair-table/','','https://mariadb.com/kb/en/library/repair-table/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (257,20,'REPAIR VIEW','REPAIR VIEW was introduced in MariaDB 10.0.18 and MariaDB\n5.5.43.\n \nSyntax\n------ \nREPAIR [NO_WRITE_TO_BINLOG | LOCAL] VIEW view_name[,\nview_name] ... [FROM MYSQL]\n \nDescription\n----------- \nThe REPAIR VIEW statement was introduced to assist with\nfixing MDEV-6916, an issue introduced in MariaDB 5.2 where\nthe view algorithms were swapped compared to their MySQL on\ndisk representation. It checks whether the view algorithm is\ncorrect. It is run as part of mysql_upgrade, and should not\nnormally be required in regular use.\n \nBy default it corrects the checksum and if necessary adds\nthe mariadb-version field. If the optional FROM MYSQL clause\nis used, and no mariadb-version field is present, the MERGE\nand TEMPTABLE algorithms are toggled.\n \nBy default, REPAIR VIEW statements are written to the binary\nlog and will be replicated. The NO_WRITE_TO_BINLOG keyword\n(LOCAL is an alias) will ensure the statement is not written\nto the binary log.\n \nNote that REPAIR VIEW in MariaDB 10.0.18 and MariaDB 5.5.43\ncould crash the server (see MDEV-8115). Upgrade to a later\nversion.\n \n\n\nURL: https://mariadb.com/kb/en/library/repair-view/','','https://mariadb.com/kb/en/library/repair-view/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (258,21,'CREATE FUNCTION UDF','Syntax\n------ \nCREATE [OR REPLACE] [AGGREGATE] FUNCTION [IF NOT EXISTS]\nfunction_name\n RETURNS {STRING|INTEGER|REAL|DECIMAL}\n SONAME shared_library_name\n \nDescription\n----------- \nA user-defined function (UDF) is a way to extend MariaDB\nwith a new function\nthat works like a native (built-in) MariaDB function such as\nABS() or\nCONCAT().\n \nfunction_name is the name that should be used in SQL\nstatements to invoke\nthe function. \n \nTo create a function, you must have the INSERT privilege for\nthe\nmysql database. This is necessary because CREATE FUNCTION\nadds a row to the\nmysql.func system table that records the function\'s name,\ntype, and shared library name. If you do not have this\ntable, you should run\nthe mysql_upgrade command to create it.\n \nUDFs need to be written in C, C++ or another language that\nuses C calling\nconventions, MariaDB needs to have been dynamically\ncompiled, and your\noperating system must support dynamic loading.\n \nFor an example, see sql/udf_example.cc in the source tree.\nFor a collection of existing UDFs see\nhttp://www.mysqludf.org/.\n \nStatements making use of user-defined functions are not\nsafe for replication.\n \nFor creating a stored function as opposed to a user-defined\nfunction, see\nCREATE FUNCTION.\n \nFor valid identifiers to use as function names, see\nIdentifier Names.\n \nRETURNS\n \nThe RETURNS clause indicates the type of the function\'s\nreturn value, and can be one of STRING, INTEGER, REAL or\nDECIMAL. DECIMAL functions currently return string values\nand should be written like STRING functions.\n \nshared_library_name\n \nshared_library_name is the basename of the shared object\nfile that contains\nthe code that implements the function. The file must be\nlocated in the plugin\ndirectory. This directory is given by the value of the\nplugin_dir system variable. Note that\nbefore MariaDB/MySQL 5.1, the shared object could be located\nin any directory\nthat was searched by your system\'s dynamic linker.\n \nAGGREGATE\n \nAggregate functions are summary functions such as SUM() and\nAVG().\n \nAggregate UDF functions can be used as window functions.\n \nOR REPLACE\n \nThe OR REPLACE clause was added in MariaDB 10.1.3\n \nIf the optional OR REPLACE clause is used, it acts as a\nshortcut for:\n \nDROP FUNCTION IF EXISTS function_name;\n \nCREATE FUNCTION name ...;\n \nIF NOT EXISTS\n \nThe IF NOT EXISTS clause was added in MariaDB 10.1.3\n \nWhen the IF NOT EXISTS clause is used, MariaDB will return a\nwarning instead of an error if the specified function\nalready exists. Cannot be used together with OR REPLACE.\n \nUpgrading a UDF\n \nTo upgrade the UDF\'s shared library, first run a\nDROP FUNCTION statement, then upgrade the shared library and\nfinally run the CREATE FUNCTION statement. If you upgrade\nwithout following\nthis process, you may crash the server.\n \nExamples\n-------- \nCREATE FUNCTION jsoncontains_path RETURNS integer SONAME\n\'ha_connect.so\';\n \nQuery OK, 0 rows affected (0.00 sec)\n \nOR REPLACE and IF NOT EXISTS:\n \nCREATE FUNCTION jsoncontains_path RETURNS integer SONAME\n\'ha_connect.so\';\n \nERROR 1125 (HY000): Function \'jsoncontains_path\' already\nexists\n \nCREATE OR REPLACE FUNCTION jsoncontains_path RETURNS integer\nSONAME \'ha_connect.so\';\n \nQuery OK, 0 rows affected (0.00 sec)\n \nCREATE FUNCTION IF NOT EXISTS jsoncontains_path RETURNS\ninteger SONAME \'ha_connect.so\';\n \nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n \nSHOW WARNINGS;\n \n+-------+------+---------------------------------------------+\n| Level | Code | Message |\n+-------+------+---------------------------------------------+\n| Note | 1125 | Function \'jsoncontains_path\' already\nexists |\n+-------+------+---------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/create-function-udf/','','https://mariadb.com/kb/en/library/create-function-udf/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (259,21,'DROP FUNCTION UDF','Syntax\n------ \nDROP FUNCTION [IF EXISTS] function_name\n \nDescription\n----------- \nThis statement drops the user-defined function (UDF) named\nfunction_name.\n \nTo drop a function, you must have the DELETE privilege for\nthe mysql database. This is because DROP FUNCTION removes\nthe row from the mysql.func system table that records the\nfunction\'s name, type and shared library name.\n \nFor dropping a stored function, see DROP FUNCTION.\n \nUpgrading a UDF\n \nTo upgrade the UDF\'s shared library, first run a DROP\nFUNCTION statement, then upgrade the shared library and\nfinally run the CREATE FUNCTION statement. If you upgrade\nwithout following this process, you may crash the server.\n \nExamples\n-------- \nDROP FUNCTION jsoncontains_path;\n \nIF EXISTS:\n \nDROP FUNCTION jsoncontains_path;\n \nERROR 1305 (42000): FUNCTION test.jsoncontains_path does not\nexist\n \nDROP FUNCTION IF EXISTS jsoncontains_path;\n \nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n \nSHOW WARNINGS;\n \n+-------+------+------------------------------------------------+\n| Level | Code | Message |\n+-------+------+------------------------------------------------+\n| Note | 1305 | FUNCTION test.jsoncontains_path does not\nexist |\n+-------+------+------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/drop-function-udf/','','https://mariadb.com/kb/en/library/drop-function-udf/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (260,21,'Creating User-Defined Functions','User-defined functions allow MariaDB to be extended with a\nnew function that works like a native (built-in) MariaDB\nfunction such as ABS() or CONCAT(). There are alternative\nways to add a new function: writing a native function (which\nrequires modifying and compiling the server source code), or\nwriting a stored function.\n \nStatements making use of user-defined functions are not safe\nfor replication.\n \nFunctions are written in C or C++, and to make use of them,\nthe operating system must support dynamic loading. \n \nEach new SQL function requires corresponding functions\nwritten in C/C++. In the list below, at least the main\nfunction - x() - and one other, are required. x should be\nreplaced by the name of the function you are creating.\n \nAll functions need to be thread-safe, so not global or\nstatic variables that change can be allocated. Memory is\nallocated in x_init()/ and freed in x_deinit(). \n \nSimple Functions\n \nx()\n \nRequired for all UDF\'s, this is where the results are\ncalculated.\n \nC/C++ type | SQL type | \n \nchar * | STRING | \n \nlong long | INTEGER | \n \ndouble | REAL | \n \nDECIMAL functions return string values, and so should be\nwritten accordingly. It is not possible to create ROW\nfunctions.\n \nx_init()\n \nInitialization function for x(). Can be used for the\nfollowing:\nCheck the number of arguments to X() (the SQL equivalent).\nVerify the argument types, or to force arguments to be of a\nparticular type after the function is called.\nSpecify whether the result can be NULL.\nSpecify the maximum result length.\nFor REAL functions, specify the maximum number of decimals\nfor the result.\nAllocate any required memory.\n To verify that the arguments are of a required type or,\nalternatively, to tell MySQL to coerce arguments to the\nrequired types when the main function is called.\n \nx_deinit()\n \nDe-initialization function for x(). Used to de-allocate\nmemory that was allocated in x_init().\n \nDescription\n----------- \nEach time the SQL function X() is called:\nMariaDB will first call the C/C++ initialization function,\nx_init(), assuming it exists. All setup will be performed,\nand if it returns an error, the SQL statement is aborted and\nno further functions are called.\nIf there is no x_init() function, or it has been called and\ndid not return an error, x() is then called once per row.\nAfter all rows have finished processing, x_deinit() is\ncalled, if present, to clean up by de-allocating any memory\nthat was allocated in x_init().\nSee User-defined Functions Calling Sequences for more\ndetails on the functions.\n \nAggregate Functions\n \nThe following functions are required for aggregate\nfunctions, such as AVG() and SUM(). \n \nx_clear()\n \nUsed to reset the current aggregate, but without inserting\nthe argument as the initial aggregate value for the new\ngroup.\n \nx_add()\n \nUsed to add the argument to the current aggregate. \n \nx_remove()\n \nStaring from MariaDB 10.4 it improves the support of window\nfunctions (so it is not obligatory to add it) and should\nremove the argument from the current aggregate.\n \nDescription\n----------- \nEach time the aggregate SQL function X() is called:\nMariaDB will first call the C/C++ initialization function,\nx_init(), assuming it exists. All setup will be performed,\nand if it returns an error, the SQL statement is aborted and\nno further functions are called.\nIf there is no x_init() function, or it has been called and\ndid not return an error, x() is then called once per row.\nAfter all rows have finished processing, x_deinit() is\ncalled, if present, to clean up by de-allocating any memory\nthat was allocated in x_init().\n \nMariaDB will first call the C/C++ initialization function,\nx_init(), assuming it exists. All setup will be performed,\nand if it returns an error, the SQL statement is aborted and\nno further functions are called.\nThe table is sorted according to the GROUP BY expression.\nx_clear() is called for the first row of each new group.\nx_add() is called once per row for each row in the same\ngroup.\nx() is called when the group changes, or after the last row,\nto get the aggregate result. \nThe latter three steps are repeated until all rows have been\nprocessed.\nAfter all rows have finished processing, x_deinit() is\ncalled, if present, to clean up by de-allocating any memory\nthat was allocated in x_init().\n \nExamples\n-------- \nFor an example, see sql/udf_example.cc in the source tree.\nFor a collection of existing UDFs see\nhttps://github.com/mysqludf.\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/creating-user-defined-functions/','','https://mariadb.com/kb/en/library/creating-user-defined-functions/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (261,21,'User-Defined Functions Calling Sequences','The functions described in Creating User-defined Functions\nare expanded on this page. They are declared as follows:\n \nSimple Functions\n \nx()\n \nIf x() returns an integer, it is declared as follows:\n \nlong long x(UDF_INIT *initid, UDF_ARGS *args,\n char *is_null, char *error);\n \nIf x() returns a string (DECIMAL functions also return\nstring values), it is declared as follows:\n \nchar *x(UDF_INIT *initid, UDF_ARGS *args,\n char *result, unsigned long *length,\n char *is_null, char *error);\n \nIf x() returns a real, it is declared as follows:\n \ndouble x(UDF_INIT *initid, UDF_ARGS *args,\n char *is_null, char *error);\n \nx_init()\n \nmy_bool x_init(UDF_INIT *initid, UDF_ARGS *args, char\n*message);\n \nx_deinit()\n \nvoid x_deinit(UDF_INIT *initid);\n \nDescription\n----------- \ninitid is a parameter passed to all three functions that\npoints to a UDF_INIT structure, used for communicating\ninformation between the functions. Its structure members\nare:\nmy_bool maybe_null\nmaybe_null should be set to 1 if x_init can return a NULL\nvalue, Defaults to 1 if any arguments are declared\nmaybe_null.\n \nunsigned int decimals\nNumber of decimals after the decimal point. The default, if\nan explicit number of decimals is passed in the arguments to\nthe main function, is the maximum number of decimals, so if\n9.5, 9.55 and 9.555 are passed to the function, the default\nwould be three (based on 9.555, the maximum). If there are\nno explicit number of decimals, the default is set to 31, or\none more than the maximum for the DOUBLE, FLOAT and DECIMAL\ntypes. This default can be changed in the function to suit\nthe actual calculation.\n \nunsigned int max_length\nMaximum length of the result. For integers, the default is\n21. For strings, the length of the longest argument. For\nreals, the default is 13 plus the number of decimals\nindicated by initid->decimals. The length includes any signs\nor decimal points. Can also be set to 65KB or 16MB in order\nto return a BLOB. The memory remains unallocated, but this\nis used to decide on the data type to use if the data needs\nto be temporarily stored.\n \nchar *ptr\nA pointer for use as required by the function. Commonly,\ninitid->ptr is used to communicate allocated memory, with\nx_init() allocating the memory and assigning it to this\npointer, x() using it, and x_deinit() de-allocating it.\n \nmy_bool const_item\nShould be set to 1 in x_init() if x() always returns the\nsame value, otherwise 0.\n \n\nAggregate Functions\n \nx_clear()\n \nx_clear() is a required function for aggregate functions,\nand is declared as follows:\n \nvoid x_clear(UDF_INIT *initid, char *is_null, char *error);\n \nIt is called when the summary results need to be reset, that\nis at the beginning of each new group. but also to reset the\nvalues when there were no matching rows.\n \nis_null is set to point to CHAR(0) before calling x_clear().\n \nIn the case of an error, you can store the value to which\nthe error argument points (a single-byte variable, not a\nstring string buffer) in the variable.\n \nx_reset()\n \nx_reset() is declared as follows:\n \nvoid x_reset(UDF_INIT *initid, UDF_ARGS *args,\n char *is_null, char *error);\n \nIt is called on finding the first row in a new group. Should\nreset the summary variables, and then use UDF_ARGS as the\nfirst value in the group\'s internal summary value. The\nfunction is not required if the UDF interface uses\nx_clear().\n \nx_add()\n \nx_add() is declared as follows:\n \nvoid x_add(UDF_INIT *initid, UDF_ARGS *args,\n char *is_null, char *error);\n \nIt is called for all rows belonging to the same group, and\nshould be used to add the value in UDF_ARGS to the internal\nsummary variable.\n \nx_remove()\n \nx_remove() was added in MariaDB 10.4 and is declared as\nfollows (same as x_add()):\n \nvoid x_remove(UDF_INIT* initid, UDF_ARGS* args,\n char* is_null, char *error );\n \nIt adds more efficient support of aggregate UDFs as window\nfunctions. x_remove() should \"subtract\" the row (reverse\nx_add()). In MariaDB 10.4 aggregate UDFs will work as WINDOW\nfunctions without x_remove() but it will not be so\nefficient.\n \nIf x_remove() supported (defined) detected automatically.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/user-defined-functions-calling-sequences/','','https://mariadb.com/kb/en/library/user-defined-functions-calling-sequences/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (262,21,'User-Defined Functions Security','The MariaDB server imposes a number of limitations on\nuser-defined functions for security purposes.\nThe INSERT privilege for the mysql database is required to\nrun CREATE FUNCTION, as a record will be added to the\nmysql.func-table.\nThe DELETE privilege for the mysql database is required to\nrun DROP FUNCTION as the corresponding record will be\nremoved from the mysql.func-table.\nUDF object files can only be placed in the plugin directory,\nas specified by the value of the plugin_dir system variable.\nAt least one symbol, beyond the required x() - corresponding\nto an SQL function X()) - is required. These can be\nx_init(), x_deinit(), xxx_reset(), x_clear() and x_add()\nfunctions (see Creating User-defined Functions). The\nallow-suspicious-udfs mysqld option (by default unset)\nprovides a workaround, permitting only one symbol to be\nused. This is not recommended, as it opens the possibility\nof loading shared objects that are not legitimate\nuser-defined functions.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/user-defined-functions-security/','','https://mariadb.com/kb/en/library/user-defined-functions-security/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (263,21,'mysql.func Table','The mysql.func table stores information about user-defined\nfunctions (UDFs) created with the CREATE FUNCTION UDF\nstatement.\n \nIn MariaDB 10.4 and later, this table uses the Aria storage\nengine.\n \nMariaDB until 10.3\n \nIn MariaDB 10.3 and before, this table uses the MyISAM\nstorage engine.\n \nThe mysql.func table contains the following fields:\n \nField | Type | Null | Key | Default | Description | \n \nname | char(64) | NO | PRI | | UDF name | \n \nret | tinyint(1) | NO | | 0 | | \n \ndl | char(128) | NO | | | Shared library name | \n \ntype | enum(\'function\',\'aggregate\') | NO | | NULL |\nType, either function or aggregate. Aggregate functions are\nsummary functions such as SUM() and AVG(). | \n \nExample\n \nSELECT * FROM mysql.func;\n+------------------------------+-----+--------------+-----------+\n| name | ret | dl | type |\n+------------------------------+-----+--------------+-----------+\n| spider_direct_sql | 2 | ha_spider.so | function |\n| spider_bg_direct_sql | 2 | ha_spider.so | aggregate |\n| spider_ping_table | 2 | ha_spider.so | function |\n| spider_copy_tables | 2 | ha_spider.so | function |\n| spider_flush_table_mon_cache | 2 | ha_spider.so | function\n|\n+------------------------------+-----+--------------+-----------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mysqlfunc-table/','','https://mariadb.com/kb/en/library/mysqlfunc-table/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (264,22,'AUTO_INCREMENT','Description\n----------- \nThe AUTO_INCREMENT attribute can be used to generate a\nunique identity for new rows. When you insert a new record\nto the table, and the auto_increment field is NULL or\nDEFAULT, the value will automatically be incremented. This\nalso applies to 0, unless the NO_AUTO_VALUE_ON_ZERO SQL_MODE\nis enabled.\n \nAUTO_INCREMENT columns start from 1 by default. The\nautomatically generated value can never be lower than 0.\n \nEach table can have only one AUTO_INCREMENT column. It must\ndefined as a key (not necessarily the PRIMARY KEY or UNIQUE\nkey). In some storage engines (including the default\nInnoDB), if the key consists of multiple columns, the\nAUTO_INCREMENT column must be the first column. Storage\nengines that permit the column to be placed elsewhere are\nAria, MyISAM, MERGE, Spider, TokuDB, BLACKHOLE, FederatedX\nand Federated.\n \nCREATE TABLE animals (\n id MEDIUMINT NOT NULL AUTO_INCREMENT,\n name CHAR(30) NOT NULL,\n PRIMARY KEY (id)\n );\n \nINSERT INTO animals (name) VALUES\n (\'dog\'),(\'cat\'),(\'penguin\'),\n (\'fox\'),(\'whale\'),(\'ostrich\');\n \nSELECT * FROM animals;\n \n+----+---------+\n| id | name |\n+----+---------+\n| 1 | dog |\n| 2 | cat |\n| 3 | penguin |\n| 4 | fox |\n| 5 | whale |\n| 6 | ostrich |\n+----+---------+\n \nSERIAL is an alias for BIGINT UNSIGNED NOT NULL\nAUTO_INCREMENT UNIQUE.\n \nCREATE TABLE t (id SERIAL, c CHAR(1)) ENGINE=InnoDB;\n \nSHOW CREATE TABLE t \\G\n*************************** 1. row\n***************************\n Table: t\nCreate Table: CREATE TABLE `t` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `c` char(1) DEFAULT NULL,\n UNIQUE KEY `id` (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n \nSetting or Changing the Auto_Increment Value\n \nYou can use an ALTER TABLE statement to assign a new value\nto the auto_increment table option, or set the insert_id\nserver system variable to change the next AUTO_INCREMENT\nvalue inserted by the current session.\n \nLAST_INSERT_ID() can be used to see the last AUTO_INCREMENT\nvalue inserted by the current session.\n \nALTER TABLE animals AUTO_INCREMENT=8;\n \nINSERT INTO animals (name) VALUES (\'aardvark\');\n \nSELECT * FROM animals;\n \n+----+-----------+\n| id | name |\n+----+-----------+\n| 1 | dog |\n| 2 | cat |\n| 3 | penguin |\n| 4 | fox |\n| 5 | whale |\n| 6 | ostrich |\n| 8 | aardvark |\n+----+-----------+\n \nSET insert_id=12;\n \nINSERT INTO animals (name) VALUES (\'gorilla\');\n \nSELECT * FROM animals;\n \n+----+-----------+\n| id | name |\n+----+-----------+\n| 1 | dog |\n| 2 | cat |\n| 3 | penguin |\n| 4 | fox |\n| 5 | whale |\n| 6 | ostrich |\n| 8 | aardvark |\n| 12 | gorilla |\n+----+-----------+\n \nInnoDB/XtraDB\n \nUntil MariaDB 10.2.3, InnoDB and XtraDB used an\nauto-increment counter that is stored in memory. When the\nserver restarts, the counter is re-initialized to the\nhighest value used in the table, which cancels the effects\nof any AUTO_INCREMENT = N option in the table statements.\n \nFrom MariaDB 10.2.4, this restriction has been lifted and\nAUTO_INCREMENT is persistent.\n \nSee also AUTO_INCREMENT Handling in XtraDB/InnoDB.\n \nSetting Explicit Values\n \nIt is possible to specify a value for an AUTO_INCREMENT\ncolumn. The value must not exist in the key.\n \nIf the new value is higher than the current maximum value,\nthe AUTO_INCREMENT value is updated, so the next value will\nbe higher. If the new value is lower than the current\nmaximum value, the AUTO_INCREMENT value remains unchanged.\n \nThe following example demonstrates these behaviours:\n \nCREATE TABLE t (id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY\nKEY) ENGINE = InnoDB;\n \nINSERT INTO t VALUES (NULL);\nSELECT id FROM t;\n \n+----+\n| id |\n+----+\n| 1 |\n+----+\n \nINSERT INTO t VALUES (10); -- higher value\nSELECT id FROM t;\n \n+----+\n| id |\n+----+\n| 1 |\n| 10 |\n+----+\n \nINSERT INTO t VALUES (2); -- lower value\nINSERT INTO t VALUES (NULL); -- auto value\nSELECT id FROM t;\n \n+----+\n| id |\n+----+\n| 1 |\n| 2 |\n| 10 |\n| 11 |\n+----+\n \nThe ARCHIVE storage engine does not allow to insert a value\nthat is lower than the current maximum.\n \nMissing Values\n \nAn AUTO_INCREMENT column normally has missing values. This\nhappens because if a row is deleted, or an AUTO_INCREMENT\nvalue is explicitly updated, old values are never re-used.\nThe REPLACE statement also deletes a row, and its value is\nwasted. With InnoDB, values can be reserved by a\ntransaction; but if the transaction fails (for example,\nbecause of a ROLLBACK) the reserved value will be lost.\n \nThus AUTO_INCREMENT values can be used to sort results in a\nchronological order, but not to create a numeric sequence.\n \nReplication\n \nTo make master-master or Galera safe to use AUTO_INCREMENT\none should use the system variables \n auto_increment_increment and auto_increment_offset to\ngenerate unique values for each server.\n \nCHECK Constraints, DEFAULT Values and Virtual Columns\n \nFrom MariaDB 10.2.6 auto_increment columns are no longer\npermitted in CHECK constraints, DEFAULT value expressions\nand virtual columns. They were permitted in earlier\nversions, but did not work correctly. See MDEV-11117.\n \n\n\nURL: https://mariadb.com/kb/en/library/auto_increment/','','https://mariadb.com/kb/en/library/auto_increment/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (265,22,'BIGINT','Syntax\n------ \nBIGINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n \nDescription\n----------- \nA large integer. The signed range is -9223372036854775808 to\n9223372036854775807. The unsigned range is 0 to\n18446744073709551615.\n \nIf a column has been set to ZEROFILL, all values will be\nprepended by zeros so that the BIGINT value contains a\nnumber of M digits.\n \nNote: If the ZEROFILL attribute has been specified, the\ncolumn will automatically become UNSIGNED.\n \nFor more details on the attributes, see Numeric Data Type\nOverview.\n \nSERIAL is an alias for:\n \nBIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE\n \nExamples\n-------- \nCREATE TABLE bigints (a BIGINT,b BIGINT UNSIGNED,c BIGINT\nZEROFILL);\n \nINSERT INTO bigints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.08 sec)\nWarning (Code 1264): Out of range value for column \'b\' at\nrow 1\nWarning (Code 1264): Out of range value for column \'c\' at\nrow 1\n \nINSERT INTO bigints VALUES (-10,10,-10);Query OK, 1 row\naffected, 1 warning (0.08 sec)\nWarning (Code 1264): Out of range value for column \'c\' at\nrow 1\n \nINSERT INTO bigints VALUES (-10,10,10);\n \nINSERT INTO bigints VALUES\n(9223372036854775808,9223372036854775808,9223372036854775808);\nQuery OK, 1 row affected, 1 warning (0.07 sec)\nWarning (Code 1264): Out of range value for column \'a\' at\nrow 1\n \nINSERT INTO bigints VALUES\n(9223372036854775807,9223372036854775808,9223372036854775808);\n \nSELECT * FROM bigints;\n+---------------------+---------------------+----------------------+\n| a | b | c |\n+---------------------+---------------------+----------------------+\n| -10 | 0 | 00000000000000000000 |\n| -10 | 10 | 00000000000000000000 |\n| -10 | 10 | 00000000000000000010 |\n| 9223372036854775807 | 9223372036854775808 |\n09223372036854775808 |\n| 9223372036854775807 | 9223372036854775808 |\n09223372036854775808 |\n+---------------------+---------------------+----------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/bigint/','','https://mariadb.com/kb/en/library/bigint/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (266,22,'BINARY','Syntax\n------ \nBINARY(M)\n \nDescription\n----------- \nThe BINARY type is similar to the CHAR type, but stores\nbinary\nbyte strings rather than non-binary character strings. M\nrepresents the\ncolumn length in bytes.\n \nIt contains no character set, and comparison and sorting are\nbased on the numeric value of the bytes.\n \nIf the maximum length is exceeded, and SQL strict mode is\nnot enabled , the extra characters will be dropped with a\nwarning. If strict mode is enabled, an error will occur.\n \nBINARY values are right-padded with 0x00 (the zero byte) to\nthe specified length when inserted. The padding is not\nremoved on select, so this needs to be taken into account\nwhen sorting and comparing, where all bytes are significant.\nThe zero byte, 0x00 is less than a space for comparison\npurposes.\n \nExamples\n-------- \nInserting too many characters, first with strict mode off,\nthen with it on:\n \nCREATE TABLE bins (a BINARY(10));\n \nINSERT INTO bins VALUES(\'12345678901\');\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n \nSELECT * FROM bins;\n \n+------------+\n| a |\n+------------+\n| 1234567890 |\n+------------+\n \nSET sql_mode=\'STRICT_ALL_TABLES\';\n \nINSERT INTO bins VALUES(\'12345678901\');\nERROR 1406 (22001): Data too long for column \'a\' at row 1\n \nSorting is performed with the byte value:\n \nTRUNCATE bins;\n \nINSERT INTO bins VALUES(\'A\'),(\'B\'),(\'a\'),(\'b\');\n \nSELECT * FROM bins ORDER BY a;\n \n+------+\n| a |\n+------+\n| A |\n| B |\n| a |\n| b |\n+------+\n \nUsing CAST to sort as a CHAR instead:\n \nSELECT * FROM bins ORDER BY CAST(a AS CHAR);\n+------+\n| a |\n+------+\n| a |\n| A |\n| b |\n| B |\n+------+\n \nThe field is a BINARY(10), so padding of two \'\\0\'s are\ninserted, causing comparisons that don\'t take this into\naccount to fail:\n \nTRUNCATE bins;\n \nINSERT INTO bins VALUES(\'12345678\');\n \nSELECT a = \'12345678\', a = \'12345678\\0\\0\' from bins;\n \n+----------------+--------------------+\n| a = \'12345678\' | a = \'12345678\\0\\0\' |\n+----------------+--------------------+\n| 0 | 1 |\n+----------------+--------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/binary/','','https://mariadb.com/kb/en/library/binary/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (267,22,'BIT','Syntax\n------ \nBIT[(M)]\n \nDescription\n----------- \nA bit-field type. M indicates the number of bits per value,\nfrom 1 to\n64. The default is 1 if M is omitted.\n \nBit values can be inserted with b\'value\' notation, where\nvalue is the bit value in 0\'s and 1\'s.\n \nBit fields are automatically zero-padded from the left to\nthe full length of the bit, so for example in a BIT(4)\nfield, \'10\' is equivalent to \'0010\'.\n \nBits are returned as binary, so to display them, either add\n0, or use a function such as HEX, OCT or BIN to convert\nthem.\n \nExamples\n-------- \nCREATE TEMPORARY TABLE b ( b1 BIT(8) );\nINSERT INTO b VALUES\n(b\'11111111\'),(b\'01010101\'),(b\'1111111111111\');\nQuery OK, 3 rows affected, 1 warning (0.10 sec)\nRecords: 3 Duplicates: 0 Warnings: 1\n \nSHOW WARNINGS;\n+---------+------+---------------------------------------------+\n| Level | Code | Message |\n+---------+------+---------------------------------------------+\n| Warning | 1264 | Out of range value for column \'b1\' at\nrow 3 |\n+---------+------+---------------------------------------------+\n \nSELECT b1+0, HEX(b1), OCT(b1), BIN(b1) FROM b;\n+------+---------+---------+----------+\n| b1+0 | HEX(b1) | OCT(b1) | BIN(b1) |\n+------+---------+---------+----------+\n| 255 | FF | 377 | 11111111 |\n| 85 | 55 | 125 | 1010101 |\n| 255 | FF | 377 | 11111111 |\n+------+---------+---------+----------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/bit/','','https://mariadb.com/kb/en/library/bit/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (268,22,'BLOB','Syntax\n------ \nBLOB[(M)]\n \nDescription\n----------- \nA BLOB column with a maximum length of 65,535 (216 - 1)\nbytes. Each\nBLOB value is stored using a two-byte length prefix that\nindicates the\nnumber of bytes in the value.\n \nAn optional length M can be given for this type. If this is\ndone,\nMariaDB creates the column as the smallest BLOB type large\nenough to\nhold values M bytes long.\n \nBLOBS can also be used to store dynamic columns.\n \nBefore MariaDB 10.2.1, BLOB and TEXT columns could not be\nassigned a DEFAULT value. This restriction was lifted in\nMariaDB 10.2.1.\n \nIndexing\n \nIn MariaDB 10.4, it is possible to set a Unique index on a\ncolumn that uses the BLOB data type. In previous releases\nthis was not possible, as the index would only guarantee the\nuniqueness of a fixed number of characters.\n \nOracle Mode\n \nIn Oracle mode from MariaDB 10.3, BLOB is a synonym for\nLONGBLOB.\n \n\n\nURL: https://mariadb.com/kb/en/library/blob/','','https://mariadb.com/kb/en/library/blob/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (269,22,'BLOB and TEXT Data Types','Description\n----------- \nA BLOB is a binary large object that can hold a variable\namount of\ndata. The four BLOB types are \nTINYBLOB,\nBLOB, \nMEDIUMBLOB, and\nLONGBLOB.\n \nThese differ only in the maximum length of the values they\ncan hold. \n \nThe TEXT types are \nTINYTEXT,\nTEXT,\nMEDIUMTEXT, and\nLONGTEXT.\nJSON (alias for LONGTEXT)\n \nThese correspond to the four BLOB types and have the same\nmaximum lengths and storage requirements.\n \nStarting from MariaDB 10.2.1, BLOB and TEXT columns can have\na DEFAULT value.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/blob-and-text-data-types/','','https://mariadb.com/kb/en/library/blob-and-text-data-types/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (270,22,'BOOLEAN','Syntax\n------ \nBOOL, BOOLEAN\n \nDescription\n----------- \nThese types are synonyms for TINYINT(1). \nA value of zero is considered false. Non-zero values are\nconsidered true:\n \nmysql> SELECT IF(0, \'true\', \'false\');\n+------------------------+\n| IF(0, \'true\', \'false\') |\n+------------------------+\n| false |\n+------------------------+\n \nmysql> SELECT IF(1, \'true\', \'false\');\n+------------------------+\n| IF(1, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n \nmysql> SELECT IF(2, \'true\', \'false\');\n+------------------------+\n| IF(2, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n \nHowever, the values TRUE and FALSE are merely aliases for 1\nand 0,\nrespectively, as shown here:\n \nmysql> SELECT IF(0 = FALSE, \'true\', \'false\');\n \n+--------------------------------+\n| IF(0 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| true |\n+--------------------------------+\n \nmysql> SELECT IF(1 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(1 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| true |\n+-------------------------------+\n \nmysql> SELECT IF(2 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(2 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| false |\n+-------------------------------+\n \nmysql> SELECT IF(2 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(2 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| false |\n+--------------------------------+\n \nUNKNOWN is an alias for NULL.\n \nThe last two statements display the results shown because 2\nis equal\nto neither 1 nor 0.\n \n\n\nURL: https://mariadb.com/kb/en/library/boolean/','','https://mariadb.com/kb/en/library/boolean/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (271,22,'CHAR','This article covers the CHAR data type. See CHAR Function\nfor the function.\n \nSyntax\n------ \n[NATIONAL] CHAR[(M)] [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n \nDescription\n----------- \nA fixed-length string that is always right-padded with\nspaces to the specified\nlength when stored. M represents the column length in\ncharacters. The range\nof M is 0 to 255. If M is omitted, the length is 1.\n \nCHAR(0) columns can contain 2 values: an empty string or\nNULL. Such columns cannot be part of an index. The CONNECT\nstorage engine does not support CHAR(0).\n \nNote: Trailing spaces are removed when CHAR values are\nretrieved\nunless the PAD_CHAR_TO_FULL_LENGTH SQL mode is enabled.\n \nBefore MariaDB 10.2, all collations were of type PADSPACE,\nmeaning that CHAR (as well as VARCHAR and TEXT) values are\ncompared without regard for trailing spaces. This does not\napply to the LIKE pattern-matching operator, which takes\ninto account trailing spaces.\n \nIf a unique index consists of a column where trailing pad\ncharacters are stripped or ignored, inserts into that column\nwhere values differ only by the number of trailing pad\ncharacters will result in a duplicate-key error.\n \nExamples\n-------- \nTrailing spaces:\n \nCREATE TABLE strtest (c CHAR(10));\nINSERT INTO strtest VALUES(\'Maria \');\n \nSELECT c=\'Maria\',c=\'Maria \' FROM strtest;\n \n+-----------+--------------+\n| c=\'Maria\' | c=\'Maria \' |\n+-----------+--------------+\n| 1 | 1 |\n+-----------+--------------+\n \nSELECT c LIKE \'Maria\',c LIKE \'Maria \' FROM strtest;\n \n+----------------+-------------------+\n| c LIKE \'Maria\' | c LIKE \'Maria \' |\n+----------------+-------------------+\n| 1 | 0 |\n+----------------+-------------------+\n \nNO PAD Collations\n \nNO PAD collations regard trailing spaces as normal\ncharacters. You can get a list of all NO PAD collations by\nquerying the Information Schema Collations table, for\nexample:\n \nSELECT collation_name FROM information_schema.collations \n WHERE collation_name LIKE \"%nopad%\";\n \n+------------------------------+\n| collation_name |\n+------------------------------+\n| big5_chinese_nopad_ci |\n| big5_nopad_bin |\n...\n \n\n\nURL: https://mariadb.com/kb/en/library/char/','','https://mariadb.com/kb/en/library/char/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (272,22,'CHAR BYTE','Description\n----------- \nThe CHAR BYTE data type is an alias for the \nBINARY data type. This is a\ncompatibility feature.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/char-byte/','','https://mariadb.com/kb/en/library/char-byte/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (273,22,'DATE','Syntax\n------ \nDATE\n \nDescription\n----------- \nA date. The supported range is \'1000-01-01\' to\n\'9999-12-31\'. MariaDB\ndisplays DATE values in \'YYYY-MM-DD\' format, but can be\nassigned dates in looser formats, including strings or\nnumbers, as long as they make sense. These include a short\nyear, YY-MM-DD, no delimiters, YYMMDD, or any other\nacceptable delimiter, for example YYYY/MM/DD. For details,\nsee date and time literals.\n \n\'0000-00-00\' is a permitted special value (zero-date),\nunless the NO_ZERO_DATE SQL_MODE is used. Also, individual\ncomponents of a date can be set to 0 (for example:\n\'2015-00-12\'), unless the NO_ZERO_IN_DATE SQL_MODE is\nused. In many cases, the result of en expression involving a\nzero-date, or a date with zero-parts, is NULL. If the\nALLOW_INVALID_DATES SQL_MODE is enabled, if the day part is\nin the range between 1 and 31, the date does not produce any\nerror, even for months that have less than 31 days.\n \nExamples\n-------- \nCREATE TABLE t1 (d DATE);\n \nINSERT INTO t1 VALUES (\"2010-01-12\"), (\"2011-2-28\"),\n(\'120314\'),(\'13*04*21\');\n \nSELECT * FROM t1;\n \n+------------+\n| d |\n+------------+\n| 2010-01-12 |\n| 2011-02-28 |\n| 2012-03-14 |\n| 2013-04-21 |\n+------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/date/','','https://mariadb.com/kb/en/library/date/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (274,22,'DATETIME','Syntax\n------ \nDATETIME [(microsecond precision)]\n \nDescription\n----------- \nA date and time combination. The supported range is\n\'1000-01-01 00:00:00.000000\' to \'9999-12-31\n23:59:59.999999\'.\nMariaDB displays DATETIME values in \'YYYY-MM-DD HH:MM:SS\'\nformat, but\nallows assignment of values to DATETIME columns using either\nstrings or\nnumbers. For details, see date and time literals.\n \nThe microsecond precision can be from 0-6. If not specified\n0 is used.\n \n\'0000-00-00\' is a permitted special value (zero-date),\nunless the NO_ZERO_DATE SQL_MODE is used. Also, individual\ncomponents of a date can be set to 0 (for example:\n\'2015-00-12\'), unless the NO_ZERO_IN_DATE SQL_MODE is\nused. In many cases, the result of en expression involving a\nzero-date, or a date with zero-parts, is NULL. If the\nALLOW_INVALID_DATES SQL_MODE is enabled, if the day part is\nin the range between 1 and 31, the date does not produce any\nerror, even for months that have less than 31 days.\n \nSince MariaDB 10.0.1, DATETIME columns also accept\nCURRENT_TIMESTAMP as the default value.\n \nMariaDB 10.1.2 introduced the --mysql56-temporal-format\noption, on by default, which allows MariaDB to store\nDATETMEs using the same low-level format MySQL 5.6 uses. For\nmore information, see Internal Format, below.\n \nFor storage requirements, see Data Type Storage\nRequirements.\n \nOracle Mode\n \nIn Oracle mode from MariaDB 10.3, DATE with a time portion\nis a synonym for DATETIME.\n \nInternal Format\n \nIn MariaDB 10.1.2 a new temporal format was introduced from\nMySQL 5.6 that alters how the TIME, DATETIME and TIMESTAMP\ncolumns operate at lower levels. These changes allow these\ntemporal data types to have fractional parts and negative\nvalues. You can disable this feature using the\nmysql56_temporal_format system variable.\n \nTables that include TIMESTAMP values that were created on an\nolder version of MariaDB or that were created while the\nmysql56_temporal_format system variable was disabled\ncontinue to store data using the older data type format.\n \nIn order to update table columns from the older format to\nthe newer format, execute an ALTER TABLE... MODIFY COLUMN\nstatement that changes the column to the *same* data type.\nThis change may be needed if you want to export the table\'s\ntablespace and import it onto a server that has\nmysql56_temporal_format=ON set (see MDEV-15225).\n \nFor instance, if you have a DATETIME column in your table: \n \nSHOW VARIABLES LIKE \'mysql56_temporal_format\';\n \n+-------------------------+-------+\n| Variable_name | Value |\n+-------------------------+-------+\n| mysql56_temporal_format | ON |\n+-------------------------+-------+\n \nALTER TABLE example_table MODIFY ts_col DATETIME;\n \nWhen MariaDB executes the ALTER TABLE statement, it converts\nthe data from the older temporal format to the newer one. \n \nIn the event that you have several tables and columns using\ntemporal data types that you want to switch over to the new\nformat, make sure the system variable is enabled, then\nperform a dump and restore using mysqldump. The columns\nusing relevant temporal data types are restored using the\nnew temporal format.\n \nExamples\n-------- \nCREATE TABLE t1 (d DATETIME);\n \nINSERT INTO t1 VALUES (\"2011-03-11\"), (\"2012-04-19\n13:08:22\"),\n (\"2013-07-18 13:44:22.123456\");\n \nSELECT * FROM t1;\n \n+---------------------+\n| d |\n+---------------------+\n| 2011-03-11 00:00:00 |\n| 2012-04-19 13:08:22 |\n| 2013-07-18 13:44:22 |\n+---------------------+\n \nCREATE TABLE t2 (d DATETIME(6));\n \nINSERT INTO t2 VALUES (\"2011-03-11\"), (\"2012-04-19\n13:08:22\"),\n (\"2013-07-18 13:44:22.123456\");\n \nSELECT * FROM t2;\n \n+----------------------------+\n| d |\n+----------------------------+\n| 2011-03-11 00:00:00.000000 |\n| 2012-04-19 13:08:22.000000 |\n| 2013-07-18 13:44:22.123456 |\n+----------------------------++\n \nStrings used in datetime context are automatically converted\nto datetime(6). If you want to have a datetime without\nseconds, you should use CONVERT(..,datetime).\n \nSELECT CONVERT(\'2007-11-30 10:30:19\',datetime);\n+-----------------------------------------+\n| CONVERT(\'2007-11-30 10:30:19\',datetime) |\n+-----------------------------------------+\n| 2007-11-30 10:30:19 |\n+-----------------------------------------+\n \nSELECT CONVERT(\'2007-11-30 10:30:19\',datetime(6));\n+--------------------------------------------+\n| CONVERT(\'2007-11-30 10:30:19\',datetime(6)) |\n+--------------------------------------------+\n| 2007-11-30 10:30:19.000000 |\n+--------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/datetime/','','https://mariadb.com/kb/en/library/datetime/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (275,22,'DECIMAL','Syntax\n------ \nDECIMAL[(M[,D])] [SIGNED | UNSIGNED | ZEROFILL]\n \nDescription\n----------- \nA packed \"exact\" fixed-point number. M is the total number\nof digits (the\nprecision) and D is the number of digits after the decimal\npoint (the\nscale). The decimal point and (for negative numbers) the\n\"-\" sign are not\ncounted in M. If D is 0, values have no decimal point or\nfractional\npart and on INSERT the value will be rounded to the nearest\nDECIMAL. The maximum number of digits (M) for DECIMAL is 65.\nThe maximum number of supported decimals (D) is 30 before\nMariadB 10.2.1 and 38 afterwards. If D is omitted, the\ndefault is 0. If M is omitted, the default is 10.\n \nUNSIGNED, if specified, disallows negative values.\n \nZEROFILL, if specified, pads the number with zeros, up to\nthe total number\nof digits specified by M.\n \nAll basic calculations (+, -, *, /) with DECIMAL columns are\ndone with\na precision of 65 digits.\n \nFor more details on the attributes, see Numeric Data Type\nOverview.\n \nOracle Mode\n \nIn Oracle mode from MariaDB 10.3, NUMBER is a synonym.\n \nExamples\n-------- \nCREATE TABLE t1 (d DECIMAL UNSIGNED ZEROFILL);\n \nINSERT INTO t1 VALUES (1),(2),(3),(4.0),(5.2),(5.7);\nQuery OK, 6 rows affected, 2 warnings (0.16 sec)\nRecords: 6 Duplicates: 0 Warnings: 2\n \nNote (Code 1265): Data truncated for column \'d\' at row 5\nNote (Code 1265): Data truncated for column \'d\' at row 6\n \nSELECT * FROM t1;\n \n+------------+\n| d |\n+------------+\n| 0000000001 |\n| 0000000002 |\n| 0000000003 |\n| 0000000004 |\n| 0000000005 |\n| 0000000006 |\n+------------+\n \nINSERT INTO t1 VALUES (-7);\nERROR 1264 (22003): Out of range value for column \'d\' at\nrow 1\n \n\n\nURL: https://mariadb.com/kb/en/library/decimal/','','https://mariadb.com/kb/en/library/decimal/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (276,22,'ENUM','Syntax\n------ \nENUM(\'value1\',\'value2\',...) [CHARACTER SET charset_name]\n[COLLATE collation_name]\n \nDescription\n----------- \nAn enumeration. A string object that can have only one\nvalue, chosen\nfrom the list of values \'value1\', \'value2\', ..., NULL or\nthe special \n\'\' error value. In theory, an ENUM column can have a\nmaximum of 65,535 distinct\nvalues; in practice, the real maximum depends on many\nfactors. ENUM values are represented internally as integers.\n \nTrailing spaces are automatically stripped from ENUM values\non table creation.\n \nENUMs require relatively little storage space compared to\nstrings, either one or two bytes depending on the number of\nenumeration values.\n \nNULL and empty values\n \nAn ENUM can also contain NULL and empty values. If the ENUM\ncolumn is declared to permit NULL values, NULL becomes a\nvalid value, as well as the default value (see below). If\nstrict SQL Mode is not enabled, and an invalid value is\ninserted into an ENUM, a special empty string, with an index\nvalue of zero (see Numeric index, below), is inserted, with\na warning. This may be confusing, because the empty string\nis also a possible value, and the only difference if that in\nthis case its index is not 0. Inserting will fail with an\nerror if strict mode is active.\n \nIf a DEFAULT clause is missing, the default value will be:\nNULL is the column is nullable;\notherwise, the first value in the enumaration.\n \nNumeric index\n \nENUM values are indexed numerically in the order they are\ndefined, and sorting will be performed in this numeric\norder. We suggest not using ENUM to store numerals, as there\nis little to no storage space benefit, and it is easy to\nconfuse the enum integer with the enum numeral value by\nleaving out the quotes.\n \nAn ENUM defined as ENUM(\'apple\',\'orange\',\'pear\') would\nhave the following index values:\n \nIndex | Value | \n \nNULL | NULL | \n \n0 | \'\' | \n \n1 | \'apple\' | \n \n2 | \'orange\' | \n \n3 | \'pear\' | \n \nExamples\n-------- \nCREATE TABLE fruits (\n id INT NOT NULL auto_increment PRIMARY KEY,\n fruit ENUM(\'apple\',\'orange\',\'pear\'),\n bushels INT);\n \nDESCRIBE fruits;\n \n+---------+-------------------------------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+---------+-------------------------------+------+-----+---------+----------------+\n| id | int(11) | NO | PRI | NULL | auto_increment |\n| fruit | enum(\'apple\',\'orange\',\'pear\') | YES | | NULL\n| |\n| bushels | int(11) | YES | | NULL | |\n+---------+-------------------------------+------+-----+---------+----------------+\n \nINSERT INTO fruits\n (fruit,bushels) VALUES\n (\'pear\',20),\n (\'apple\',100),\n (\'orange\',25);\n \nINSERT INTO fruits\n (fruit,bushels) VALUES\n (\'avocado\',10);\nERROR 1265 (01000): Data truncated for column \'fruit\' at\nrow 1\n \nSELECT * FROM fruits;\n \n+----+--------+---------+\n| id | fruit | bushels |\n+----+--------+---------+\n| 1 | pear | 20 |\n| 2 | apple | 100 |\n| 3 | orange | 25 |\n+----+--------+---------+\n \nSelecting by numeric index:\n \nSELECT * FROM fruits WHERE fruit=2;\n \n+----+--------+---------+\n| id | fruit | bushels |\n+----+--------+---------+\n| 3 | orange | 25 |\n+----+--------+---------+\n \nSorting is according to the index value:\n \nCREATE TABLE enums (a ENUM(\'2\',\'1\'));\n \nINSERT INTO enums VALUES (\'1\'),(\'2\');\n \nSELECT * FROM enums ORDER BY a ASC;\n \n+------+\n| a |\n+------+\n| 2 |\n| 1 |\n+------+\n \nIt\'s easy to get confused between returning the enum\ninteger with the stored value, so we don\'t suggest using\nENUM to store numerals. The first example returns the 1st\nindexed field (\'2\' has an index value of 1, as it\'s\ndefined first), while the second example returns the string\nvalue \'1\'.\n \nSELECT * FROM enums WHERE a=1;\n \n+------+\n| a |\n+------+\n| 2 |\n+------+\n \nSELECT * FROM enums WHERE a=\'1\';\n \n+------+\n| a |\n+------+\n| 1 |\n+------+\n \n\n\nURL: https://mariadb.com/kb/en/library/enum/','','https://mariadb.com/kb/en/library/enum/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (277,22,'DOUBLE','Syntax\n------ \nDOUBLE[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\nDOUBLE PRECISION[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\nREAL[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\n \nDescription\n----------- \nA normal-size (double-precision) floating-point number (see\nFLOAT for a single-precision floating-point number).\n \nAllowable values are:\n-1.7976931348623157E+308 to -2.2250738585072014E-308\n0\n2.2250738585072014E-308 to 1.7976931348623157E+308\n \nThese are the theoretical limits, based on the IEEE\nstandard. The actual range\nmight be slightly smaller depending on your hardware or\noperating system.\n \nM is the total number of digits and D is the number of\ndigits\nfollowing the decimal point. If M and D are omitted, values\nare stored\nto the limits allowed by the hardware. A double-precision\nfloating-point number is accurate to approximately 15\ndecimal places.\n \nUNSIGNED, if specified, disallows negative values.\n \nZEROFILL, if specified, pads the number with zeros, up to\nthe total number\nof digits specified by M.\n \nREAL and DOUBLE PRECISION are synonyms, unless the\nREAL_AS_FLOAT SQL mode is enabled, in which case REAL is a\nsynonym for FLOAT rather than DOUBLE.\n \nSee Floating Point Accuracy for issues when using\nfloating-point numbers.\n \nFor more details on the attributes, see Numeric Data Type\nOverview.\n \nExamples\n-------- \nCREATE TABLE t1 (d DOUBLE(5,0) zerofill);\n \nINSERT INTO t1 VALUES (1),(2),(3),(4);\n \nSELECT * FROM t1;\n \n+-------+\n| d |\n+-------+\n| 00001 |\n| 00002 |\n| 00003 |\n| 00004 |\n+-------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/double/','','https://mariadb.com/kb/en/library/double/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (278,22,'FLOAT','Syntax\n------ \nFLOAT[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\n \nDescription\n----------- \nA small (single-precision) floating-point number (see DOUBLE\nfor a regular-size floating point number). Allowable values\nare:\n-3.402823466E+38 to -1.175494351E-38\n0\n1.175494351E-38 to 3.402823466E+38. \n \nThese are the theoretical limits, based on the IEEE \nstandard. The actual range might be slightly smaller\ndepending on your\nhardware or operating system.\n \nM is the total number of digits and D is the number of\ndigits\nfollowing the decimal point. If M and D are omitted, values\nare stored\nto the limits allowed by the hardware. A single-precision\nfloating-point number is accurate to approximately 7 decimal\nplaces.\n \nUNSIGNED, if specified, disallows negative values.\n \nUsing FLOAT might give you some unexpected problems because\nall\ncalculations in MariaDB are done with double precision. See\nFloating Point Accuracy.\n \nFor more details on the attributes, see Numeric Data Type\nOverview.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/float/','','https://mariadb.com/kb/en/library/float/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (279,22,'Geometry Types','Description\n----------- \nMariaDB provides a standard way of creating spatial columns\nfor geometry types,\nfor example, with CREATE TABLE or ALTER TABLE.\nCurrently, spatial columns are supported for MyISAM, InnoDB,\nNDB, and ARCHIVE\ntables. See also SPATIAL INDEX.\n \nThe basic geometry type is GEOMETRY. But the type can be\nmore specific. The following types are supported:\n \nGeometry Types | \n \nPOINT | \n \nLINESTRING | \n \nPOLYGON | \n \nMULTIPOINT | \n \nMULTILINESTRING | \n \nMULTIPOLYGON | \n \nGEOMETRYCOLLECTION | \n \nGEOMETRY | \n \nExamples\n-------- \nNote: For clarity, only one type is listed per table in the\nexamples below, but a table\nrow can contain multiple types. For example:\n \nCREATE TABLE object (shapeA POLYGON, shapeB LINESTRING);\n \nPOINT\n \nCREATE TABLE gis_point (g POINT);\nSHOW FIELDS FROM gis_point;\n \nINSERT INTO gis_point VALUES\n (PointFromText(\'POINT(10 10)\')),\n (PointFromText(\'POINT(20 10)\')),\n (PointFromText(\'POINT(20 20)\')),\n (PointFromWKB(AsWKB(PointFromText(\'POINT(10 20)\'))));\n \nLINESTRING\n \nCREATE TABLE gis_line (g LINESTRING);\nSHOW FIELDS FROM gis_line;\n \nINSERT INTO gis_line VALUES\n (LineFromText(\'LINESTRING(0 0,0 10,10 0)\')),\n (LineStringFromText(\'LINESTRING(10 10,20 10,20 20,10 20,10\n10)\')),\n (LineStringFromWKB(AsWKB(LineString(Point(10, 10),\nPoint(40, 10)))));\n \nPOLYGON\n \nCREATE TABLE gis_polygon (g POLYGON);\nSHOW FIELDS FROM gis_polygon;\n \nINSERT INTO gis_polygon VALUES\n (PolygonFromText(\'POLYGON((10 10,20 10,20 20,10 20,10\n10))\')),\n (PolyFromText(\'POLYGON((0 0,50 0,50 50,0 50,0 0), (10\n10,20 10,20 20,10 20,10 10))\')),\n (PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0),\nPoint(30, 0), Point(30, 30), Point(0, 0))))));\n \nMULTIPOINT\n \nCREATE TABLE gis_multi_point (g MULTIPOINT);\nSHOW FIELDS FROM gis_multi_point;\n \nINSERT INTO gis_multi_point VALUES\n (MultiPointFromText(\'MULTIPOINT(0 0,10 10,10 20,20\n20)\')),\n (MPointFromText(\'MULTIPOINT(1 1,11 11,11 21,21 21)\')),\n (MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4,\n10)))));\n \nMULTILINESTRING\n \nCREATE TABLE gis_multi_line (g MULTILINESTRING);\nSHOW FIELDS FROM gis_multi_line;\n \nINSERT INTO gis_multi_line VALUES\n (MultiLineStringFromText(\'MULTILINESTRING((10 48,10 21,10\n0),(16 0,16 23,16 48))\')),\n (MLineFromText(\'MULTILINESTRING((10 48,10 21,10 0))\')),\n (MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2),\nPoint(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21,\n7))))));\n \nMULTIPOLYGON\n \nCREATE TABLE gis_multi_polygon (g MULTIPOLYGON);\nSHOW FIELDS FROM gis_multi_polygon;\n \nINSERT INTO gis_multi_polygon VALUES\n (MultiPolygonFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84\n42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67\n13,59 13,59 18)))\')),\n (MPolyFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28\n26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59\n13,59 18)))\')),\n (MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0,\n3), Point(3, 3), Point(3, 0), Point(0, 3)))))));\n \nGEOMETRYCOLLECTION\n \nCREATE TABLE gis_geometrycollection (g GEOMETRYCOLLECTION);\nSHOW FIELDS FROM gis_geometrycollection;\n \nINSERT INTO gis_geometrycollection VALUES\n (GeomCollFromText(\'GEOMETRYCOLLECTION(POINT(0 0),\nLINESTRING(0 0,10 10))\')),\n (GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6),\nLineString(Point(3, 6), Point(7, 9)))))),\n (GeomFromText(\'GeometryCollection()\')),\n (GeomFromText(\'GeometryCollection EMPTY\'));\n \nGEOMETRY\n \nCREATE TABLE gis_geometry (g GEOMETRY);\nSHOW FIELDS FROM gis_geometry;\n \nINSERT into gis_geometry SELECT * FROM gis_point;\n \nINSERT into gis_geometry SELECT * FROM gis_line;\n \nINSERT into gis_geometry SELECT * FROM gis_polygon;\n \nINSERT into gis_geometry SELECT * FROM gis_multi_point;\n \nINSERT into gis_geometry SELECT * FROM gis_multi_line;\n \nINSERT into gis_geometry SELECT * FROM gis_multi_polygon;\n \nINSERT into gis_geometry SELECT * FROM\ngis_geometrycollection;\n \n\n \n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/geometry-types/','','https://mariadb.com/kb/en/library/geometry-types/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (280,22,'JSON Data Type','The JSON alias was added in MariaDB 10.2.7. This was done to\nmake it possible to use JSON columns in statement based\nreplication from MySQL to MariaDB and to make it possible\nfor MariaDB to read mysqldumps from MySQL.\n \nJSON is an alias for LONGTEXT introduced for compatibility\nreasons with MySQL\'s JSON data type. MariaDB implements\nthis as a LONGTEXT rather, as the JSON data type contradicts\nthe SQL standard, and MariaDB\'s benchmarks indicate that\nperformance is at least equivalent.\n \nIn order to ensure that a a valid json document is inserted,\nthe JSON_VALID function can be used as a CHECK constraint.\nThis constraint is automatically included for types using\nthe JSON alias from MariaDB 10.4.3.\n \nExamples\n-------- \nCREATE TABLE t (j JSON);\n \nDESC t;\n+-------+----------+------+-----+---------+-------+\n| Field | Type | Null | Key | Default | Extra |\n+-------+----------+------+-----+---------+-------+\n| j | longtext | YES | | NULL | |\n+-------+----------+------+-----+---------+-------+\n \nWith validation:\n \nCREATE TABLE t2 (\n j JSON \n CHECK (JSON_VALID(j))\n);\n \nINSERT INTO t2 VALUES (\'invalid\');\nERROR 4025 (23000): CONSTRAINT `j` failed for `test`.`t2`\n \nINSERT INTO t2 VALUES (\'{\"id\": 1, \"name\":\n\"Monty\"}\');\nQuery OK, 1 row affected (0.13 sec)\n \nReplicating JSON Data Between MySQL and MariaDB\n \nThe JSON type in MySQL stores the JSON object in a compact\nform, not as LONGTEXT as in MariaDB.\nThis means that row based replication will not work for JSON\ntypes from MySQL to MariaDB.\n \nThere are a a few different ways to solve this:\nUse statement based replication.\nChange the JSON column to type TEXT in MySQL\n \nConverting a MySQL TABLE with JSON Fields to MariaDB\n \nMariaDB can\'t directly access MySQL JSON format.\n \nThere is a a few different ways to move the table to\nMariaDB:\nChange the JSON column to type TEXT in MySQL. After this\nMariaDB can directly use the table without any need for a\ndump and restore.\nUse mysqldump to copy the table.\n \nDifferences Between MySQL JSON Strings and MariaDB JSON\nStrings\n \nIn MySQL, JSON is an object and is compared according to\njson values. In MariaDB JSON strings are normal strings and\ncompared as strings. One exception is when using\nJSON_EXTRACT() in which case strings are unescaped before\ncomparison.\n \n\n\nURL: https://mariadb.com/kb/en/library/json-data-type/','','https://mariadb.com/kb/en/library/json-data-type/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (281,22,'LONGBLOB','Syntax\n------ \nLONGBLOB\n \nDescription\n----------- \nA BLOB column with a \nmaximum length of 4,294,967,295 bytes or 4GB (232 - 1). The\neffective maximum length of LONGBLOB columns depends on the\nconfigured maximum packet size in the client/server protocol\nand\navailable memory. Each LONGBLOB value is stored using a\nfour-byte\nlength prefix that indicates the number of bytes in the\nvalue.\n \nOracle Mode\n \nIn Oracle mode from MariaDB 10.3, BLOB is a synonym for\nLONGBLOB.\n \n\n\nURL: https://mariadb.com/kb/en/library/longblob/','','https://mariadb.com/kb/en/library/longblob/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (282,22,'LONGTEXT','Syntax\n------ \nLONGTEXT [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n \nDescription\n----------- \nA TEXT column with a maximum length of 4,294,967,295 or 4GB\n(232 - 1) characters. The effective maximum length is less\nif the value contains multi-byte characters. The effective\nmaximum length of LONGTEXT columns also depends on the\nconfigured maximum packet size in the client/server protocol\nand available memory. Each LONGTEXT value is stored using a\nfour-byte length prefix that indicates the number of bytes\nin the value.\n \nFrom MariaDB 10.2.7, JSON is an alias for LONGTEXT. See JSON\nData Type for details.\n \nOracle Mode\n \nIn Oracle mode from MariaDB 10.3, CLOB is a synonym for\nLONGTEXT.\n \n\n\nURL: https://mariadb.com/kb/en/library/longtext/','','https://mariadb.com/kb/en/library/longtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (283,22,'MEDIUMBLOB','Syntax\n------ \nMEDIUMBLOB\n \nDescription\n----------- \nA BLOB column with a maximum\nlength of 16,777,215 (224 - 1) bytes.\nEach MEDIUMBLOB value is stored using a three-byte length\nprefix that\nindicates the number of bytes in the value. \n \n\n\nURL: https://mariadb.com/kb/en/library/mediumblob/','','https://mariadb.com/kb/en/library/mediumblob/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (284,22,'MEDIUMINT','Syntax\n------ \nMEDIUMINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n \nDescription\n----------- \nA medium-sized integer. The signed range is -8388608 to\n8388607. The\nunsigned range is 0 to 16777215.\n \nZEROFILL pads the integer with zeroes and assumes UNSIGNED\n(even if UNSIGNED is not specified).\n \nFor details on the attributes, see Numeric Data Type\nOverview.\n \nExamples\n-------- \nCREATE TABLE mediumints (a MEDIUMINT,b MEDIUMINT UNSIGNED,c\nMEDIUMINT ZEROFILL);\n \nDESCRIBE mediumints;\n+-------+--------------------------------+------+-----+---------+-------+\n| Field | Type | Null | Key | Default | Extra |\n+-------+--------------------------------+------+-----+---------+-------+\n| a | mediumint(9) | YES | | NULL | |\n| b | mediumint(8) unsigned | YES | | NULL | |\n| c | mediumint(8) unsigned zerofill | YES | | NULL | |\n+-------+--------------------------------+------+-----+---------+-------+\n \nINSERT INTO mediumints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.05 sec)\nWarning (Code 1264): Out of range value for column \'b\' at\nrow 1\nWarning (Code 1264): Out of range value for column \'c\' at\nrow 1\n \nINSERT INTO mediumints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.08 sec)\nWarning (Code 1264): Out of range value for column \'c\' at\nrow 1\n \nINSERT INTO mediumints VALUES (-10,10,10);\n \nINSERT INTO mediumints VALUES (8388608,8388608,8388608);\nQuery OK, 1 row affected, 1 warning (0.05 sec)\nWarning (Code 1264): Out of range value for column \'a\' at\nrow 1\n \nINSERT INTO mediumints VALUES (8388607,8388608,8388608);\n \nSELECT * FROM mediumints;\n+---------+---------+----------+\n| a | b | c |\n+---------+---------+----------+\n| -10 | 0 | 00000000 |\n| -10 | 0 | 00000000 |\n| -10 | 10 | 00000000 |\n| -10 | 10 | 00000010 |\n| 8388607 | 8388608 | 08388608 |\n| 8388607 | 8388608 | 08388608 |\n+---------+---------+----------+\n \n\n\nURL: https://mariadb.com/kb/en/library/mediumint/','','https://mariadb.com/kb/en/library/mediumint/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (285,22,'MEDIUMTEXT','Syntax\n------ \nMEDIUMTEXT [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n \nDescription\n----------- \nA TEXT column with a \nmaximum length of 16,777,215 (224 - 1)\ncharacters. The effective maximum length is less if the\nvalue\ncontains multi-byte characters. Each MEDIUMTEXT value is\nstored using\na three-byte length prefix that indicates the number of\nbytes in the\nvalue.\n \n\n\nURL: https://mariadb.com/kb/en/library/mediumtext/','','https://mariadb.com/kb/en/library/mediumtext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (286,22,'Numeric Data Type Overview','There are a number of numeric data types:\nTINYINT\nBOOLEAN - Synonym for TINYINT(1)\nSMALLINT\nMEDIUMINT\nINT, INTEGER\nBIGINT\nDECIMAL, DEC, NUMERIC, FIXED\nFLOAT\nDOUBLE, DOUBLE PRECISION, REAL\nBIT\n \nSee the specific articles for detailed information on each.\n \nSIGNED, UNSIGNED and ZEROFILL\n \nMost numeric types can be defined as SIGNED, UNSIGNED or\nZEROFILL, for example:\n \nTINYINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n \nIf SIGNED, or no attribute, is specified, a portion of the\nnumeric type will be reserved for the sign (plus or minus).\nFor example, a TINYINT SIGNED can range from -128 to 127. \n \nIf UNSIGNED is specified, no portion of the numeric type is\nreserved for the sign, so for integer types range can be\nlarger. For example, a TINYINT UNSIGNED can range from 0 to\n255. Floating point and fixed-point types also can be\nUNSIGNED, but this only prevents negative values from being\nstored and doesn\'t alter the range. \n \nIf ZEROFILL is specified, the column will be set to UNSIGNED\nand the spaces used by default to pad the field are replaced\nwith zeros. ZEROFILL is ignored in expressions or as part of\na UNION. ZEROFILL is a non-standard MySQL and MariaDB\nenhancement.\n \nNote that although the preferred syntax indicates that the\nattributes are exclusive, more than one attribute can be\nspecified.\n \nUntil MariaDB 10.2.7 (MDEV-8659), any combination of the\nattributes could be used in any order, with duplicates. In\nthis case:\nthe presence of ZEROFILL makes the column UNSIGNED ZEROFILL.\nthe presence of UNSIGNED makes the column UNSIGNED.\n \nFrom MariaDB 10.2.8, only the following combinations are\nsupported:\nSIGNED\nUNSIGNED\nZEROFILL\nUNSIGNED ZEROFILL\nZEROFILL UNSIGNED\n \nThe latter two should be replaced with simply ZEROFILL, but\nare still accepted by the parser.\n \nExamples\n-------- \nCREATE TABLE zf (\n i1 TINYINT SIGNED,\n i2 TINYINT UNSIGNED,\n i3 TINYINT ZEROFILL\n);\n \nINSERT INTO zf VALUES (2,2,2);\n \nSELECT * FROM zf;\n \n+------+------+------+\n| i1 | i2 | i3 |\n+------+------+------+\n| 2 | 2 | 002 |\n+------+------+------+\n \nRange\n \nWhen attempting to add a value that is out of the valid\nrange for the numeric type, MariaDB will react depending on\nthe strict SQL_MODE setting.\n \nIf strict_mode has been set (the default from MariaDB\n10.2.4), MariaDB will return an error.\n \nIf strict_mode has not been set (the default until MariaDB\n10.2.3), MariaDB will adjust the number to fit in the field,\nreturning a warning.\n \nExamples\n-------- \nWith strict_mode set:\n \nSHOW VARIABLES LIKE \'sql_mode\';\n \n+---------------+-------------------------------------------------------------------------------------------+\n| Variable_name | Value |\n+---------------+-------------------------------------------------------------------------------------------+\n| sql_mode |\nSTRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\n|\n+---------------+-------------------------------------------------------------------------------------------+\n \nCREATE TABLE ranges (i1 TINYINT, i2 SMALLINT, i3 TINYINT\nUNSIGNED);\n \nINSERT INTO ranges VALUES (257,257,257);\nERROR 1264 (22003): Out of range value for column \'i1\' at\nrow 1\n \nSELECT * FROM ranges;\n \nEmpty set (0.10 sec)\n \nWith strict_mode unset:\n \nSHOW VARIABLES LIKE \'sql_mode%\';\n \n+---------------+-------+\n| Variable_name | Value |\n+---------------+-------+\n| sql_mode | |\n+---------------+-------+\n \nCREATE TABLE ranges (i1 TINYINT, i2 SMALLINT, i3 TINYINT\nUNSIGNED);\n \nINSERT INTO ranges VALUES (257,257,257);\nQuery OK, 1 row affected, 2 warnings (0.00 sec)\n \nSHOW WARNINGS;\n \n+---------+------+---------------------------------------------+\n| Level | Code | Message |\n+---------+------+---------------------------------------------+\n| Warning | 1264 | Out of range value for column \'i1\' at\nrow 1 |\n| Warning | 1264 | Out of range value for column \'i3\' at\nrow 1 |\n+---------+------+---------------------------------------------+\n2 rows in set (0.00 sec)\n \nSELECT * FROM ranges;\n \n+------+------+------+\n| i1 | i2 | i3 |\n+------+------+------+\n| 127 | 257 | 255 |\n+------+------+------+\n \nAuto_increment\n \nThe AUTO_INCREMENT attribute can be used to generate a\nunique identity for new rows. For more details, see\nauto_increment.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/numeric-data-type-overview/','','https://mariadb.com/kb/en/library/numeric-data-type-overview/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (287,22,'ROW','The ROW data type was introduced in MariaDB 10.3.0.\n \nSyntax\n------ \nROW ( [{, }... ])\n \nDescription\n----------- \nROW is a data type for stored procedure variables.\n \nFeatures\n \nROW fields as normal variables\n \nROW fields (members) act as normal variables, and are able\nto appear in all\nquery parts where a stored procedure variable is allowed:\nAssignment is using the := operator and the SET command:\n \na.x:= 10;\n \na.x:= b.x;\n \nSET a.x= 10, a.y=20, a.z= b.z;\n \nPassing to functions and operators:\n \nSELECT f1(rec.a), rec.a\n\nURL: https://mariadb.com/kb/en/library/row/','','https://mariadb.com/kb/en/library/row/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (288,22,'SET Data Type','Syntax\n------ \nSET(\'value1\',\'value2\',...) [CHARACTER SET charset_name]\n[COLLATE collation_name]\n \nDescription\n----------- \nA set. A string object that can have zero or more values,\neach of\nwhich must be chosen from the list of values \'value1\',\n\'value2\', ... A\nSET column can have a maximum of 64 members. SET values are\nrepresented internally as integers.\n \n\n\nURL: https://mariadb.com/kb/en/library/set-data-type/','','https://mariadb.com/kb/en/library/set-data-type/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (289,22,'SMALLINT','Syntax\n------ \nSMALLINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n \nDescription\n----------- \nA small integer. The signed range is -32768 to 32767. The\nunsigned range is 0 to 65535.\n \nIf a column has been set to ZEROFILL, all values will be\nprepended by zeros so that the SMALLINT value contains a\nnumber of M digits.\n \nNote: If the ZEROFILL attribute has been specified, the\ncolumn will automatically become UNSIGNED.\n \nFor more details on the attributes, see Numeric Data Type\nOverview.\n \nExamples\n-------- \nCREATE TABLE smallints (a SMALLINT,b SMALLINT UNSIGNED,c\nSMALLINT ZEROFILL);\n \nINSERT INTO smallints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.09 sec)\nWarning (Code 1264): Out of range value for column \'b\' at\nrow 1\nWarning (Code 1264): Out of range value for column \'c\' at\nrow 1\n \nINSERT INTO smallints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.08 sec)\nWarning (Code 1264): Out of range value for column \'c\' at\nrow 1\n \nINSERT INTO smallints VALUES (-10,10,10);\n \nINSERT INTO smallints VALUES (32768,32768,32768);\nQuery OK, 1 row affected, 1 warning (0.04 sec)\nWarning (Code 1264): Out of range value for column \'a\' at\nrow 1\n \nINSERT INTO smallints VALUES (32767,32768,32768);\n \nSELECT * FROM smallints;\n+-------+-------+-------+\n| a | b | c |\n+-------+-------+-------+\n| -10 | 0 | 00000 |\n| -10 | 10 | 00000 |\n| -10 | 10 | 00010 |\n| 32767 | 32768 | 32768 |\n| 32767 | 32768 | 32768 |\n+-------+-------+-------+\n \n\n\nURL: https://mariadb.com/kb/en/library/smallint/','','https://mariadb.com/kb/en/library/smallint/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (290,22,'String Literals','Strings are sequences of characters and are enclosed with\nquotes.\n \nThe syntax is:\n \n[_charset_name]\'string\' [COLLATE collation_name]\n \nFor example:\n \n\'The MariaDB Foundation\'\n_utf8 \'Foundation\' COLLATE utf8_unicode_ci;\n \nStrings can either be enclosed in single quotes or in double\nquotes (the same character must be used to both open and\nclose the string).\n \nThe ANSI SQL-standard does not permit double quotes for\nenclosing strings, and although MariaDB does by default, if\nthe MariaDB server has enabled the ANSI_QUOTES_SQL SQL_MODE,\ndouble quotes will be treated as being used for identifiers\ninstead of strings.\n \nStrings that are next to each other are automatically\nconcatenated. For example:\n \n\'The \' \'MariaDB \' \'Foundation\'\n \nand\n \n\'The MariaDB Foundation\'\n \nare equivalent.\n \nThe \\ (backslash character) is used to escape characters.\nFor example:\n \n\'MariaDB\'s new features\'\n \nis not a valid string because of the single quote in the\nmiddle of the string, which is treated as if it closes the\nstring, but is actually meant as part of the string, an\napostrophe. The backslash character helps in situations like\nthis:\n \n\'MariaDB\\\'s new features\'\n \nis now a valid string, and if displayed, will appear without\nthe backslash.\n \nSELECT \'MariaDB\\\'s new features\';\n+------------------------+\n| MariaDB\'s new features |\n+------------------------+\n| MariaDB\'s new features |\n+------------------------+\n \nAnother way to escape the quoting character is repeating it\ntwice:\n \nSELECT \'I\'\'m here\', \"\"\"Double\"\"\";\n+----------+----------+\n| I\'m here | \"Double\" |\n+----------+----------+\n| I\'m here | \"Double\" |\n+----------+----------+\n \nEscape sequences\n \nThere are other escape sequences also. Here is a full list:\n \nEscape sequence | Character | \n \n\\0 | ASCII NUL (0x00). | \n \n\\\' | Single quote (“\'”). | \n \n\\\" | Double quote (“\"”). | \n \n\\b | Backspace. | \n \n\\n | Newline, or linefeed,. | \n \n\\r | Carriage return. | \n \n\\t | Tab. | \n \n\\Z | ASCII 26 (Control+Z). See note following the table. | \n \n\\\\ | Backslash (“\\”). | \n \n\\% | “%” character. See note following the table. | \n \n\\_ | A “_” character. See note following the table. | \n \nEscaping the % and _ characters can be necessary when using\nthe LIKE operator, which treats them as special characters.\n \nThe ASCII 26 character (\\Z) needs to be escaped when\nincluded in a batch file which needs to be executed in\nWindows. The reason is that ASCII 26, in Windows, is the end\nof file (EOF).\n \nBackslash (\\), if not used as an escape character, must\nalways be escaped. When followed by a character that is not\nin the above table, backslashes will simply be ignored.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/string-literals/','','https://mariadb.com/kb/en/library/string-literals/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (291,22,'TEXT','Syntax\n------ \nTEXT[(M)] [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n \nDescription\n----------- \nA TEXT column with a maximum length of 65,535 (216 - 1)\ncharacters. The effective maximum length is less if the\nvalue contains\nmulti-byte characters. Each TEXT value is stored using a\ntwo-byte length\nprefix that indicates the number of bytes in the value. If\nyou need a bigger storage, consider using MEDIUMTEXT\ninstead.\n \nAn optional length M can be given for this type. If this is\ndone, MariaDB\ncreates the column as the smallest TEXT type large enough to\nhold values\nM characters long.\n \nBefore MariaDB 10.2, all MariaDB collations were of type\nPADSPACE, meaning that TEXT (as well as VARCHAR and CHAR\nvalues) are compared without regard for trailing spaces.\nThis does not apply to the LIKE pattern-matching operator,\nwhich takes into account trailing spaces.\n \nBefore MariaDB 10.2.1, BLOB and TEXT columns could not be\nassigned a DEFAULT value. This restriction was lifted in\nMariaDB 10.2.1.\n \nExamples\n-------- \nTrailing spaces:\n \nCREATE TABLE strtest (d TEXT(10));\nINSERT INTO strtest VALUES(\'Maria \');\n \nSELECT d=\'Maria\',d=\'Maria \' FROM strtest;\n+-----------+--------------+\n| d=\'Maria\' | d=\'Maria \' |\n+-----------+--------------+\n| 1 | 1 |\n+-----------+--------------+\n \nSELECT d LIKE \'Maria\',d LIKE \'Maria \' FROM strtest;\n+----------------+-------------------+\n| d LIKE \'Maria\' | d LIKE \'Maria \' |\n+----------------+-------------------+\n| 0 | 1 |\n+----------------+-------------------+\n \nDifference between VARCHAR and TEXT\n \nVARCHAR columns can be fully indexed. TEXT columns can only\nbe indexed over a specified length.\nUsing TEXT or BLOB in a SELECT query that uses temporary\ntables for storing intermediate results will force the\ntemporary table to be disk based (using the Aria storage\nengine instead of the memory storage engine, which is a bit\nslower. This is not that bad as the Aria storage engine\ncaches the rows in memory. To get the benefit of this, one\nshould ensure that the aria_pagecache_buffer_size variable\nis big enough to hold most of the row and index data for\ntemporary tables.\n \nFor Storage Engine Developers\n \nInternally the full length of the VARCHAR column is\nallocated inside each TABLE objects record[] structure. As\nthere are three such buffers, each open table will allocate\n3 times max-length-to-store-varchar bytes of memory.\nTEXT and BLOB columns are stored with a pointer (4 or 8\nbytes) + a 1-4 bytes length. The TEXT data is only stored\nonce. This means that internally TEXT uses less memory for\neach open table but instead has the additional overhead that\neach TEXT object needs to be allocated and freed for each\nrow access (with some caching in between).\n \n\n\nURL: https://mariadb.com/kb/en/library/text/','','https://mariadb.com/kb/en/library/text/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (292,22,'TIME','Syntax\n------ \nTIME [()]\n \nDescription\n----------- \nA time. The range is \'-838:59:59.999999\' to\n\'838:59:59.999999\'. Microsecond precision can be from 0-6;\nif not specified 0 is used. Microseconds have been available\nsince MariaDB 5.3. \n \nMariaDB displays TIME values in \'HH:MM:SS.ssssss\' format,\nbut allows assignment of times in looser formats, including\n\'D HH:MM:SS\', \'HH:MM:SS\', \'HH:MM\', \'D HH:MM\', \'D\nHH\', \'SS\', or \'HHMMSS\', as well as permitting dropping\nof any leading zeros when a delimiter is provided, for\nexample \'3:9:10\'. For details, see date and time literals.\n \nMariaDB 10.1.2 introduced the --mysql56-temporal-format\noption, on by default, which allows MariaDB to store TIMEs\nusing the same low-level format MySQL 5.6 uses.\n \nInternal Format\n \nIn MariaDB 10.1.2 a new temporal format was introduced from\nMySQL 5.6 that alters how the TIME, DATETIME and TIMESTAMP\ncolumns operate at lower levels. These changes allow these\ntemporal data types to have fractional parts and negative\nvalues. You can disable this feature using the\nmysql56_temporal_format system variable.\n \nTables that include TIMESTAMP values that were created on an\nolder version of MariaDB or that were created while the\nmysql56_temporal_format system variable was disabled\ncontinue to store data using the older data type format.\n \nIn order to update table columns from the older format to\nthe newer format, execute an ALTER TABLE... MODIFY COLUMN\nstatement that changes the column to the *same* data type.\nThis change may be needed if you want to export the table\'s\ntablespace and import it onto a server that has\nmysql56_temporal_format=ON set (see MDEV-15225).\n \nFor instance, if you have a TIME column in your table: \n \nSHOW VARIABLES LIKE \'mysql56_temporal_format\';\n \n+-------------------------+-------+\n| Variable_name | Value |\n+-------------------------+-------+\n| mysql56_temporal_format | ON |\n+-------------------------+-------+\n \nALTER TABLE example_table MODIFY ts_col TIME;\n \nWhen MariaDB executes the ALTER TABLE statement, it converts\nthe data from the older temporal format to the newer one. \n \nIn the event that you have several tables and columns using\ntemporal data types that you want to switch over to the new\nformat, make sure the system variable is enabled, then\nperform a dump and restore using mysqldump. The columns\nusing relevant temporal data types are restored using the\nnew temporal format.\n \nExamples\n-------- \nINSERT INTO time VALUES (\'90:00:00\'), (\'800:00:00\'),\n(800), (22), (151413), (\'9:6:3\'), (\'12 09\');\n \nSELECT * FROM time;\n+-----------+\n| t |\n+-----------+\n| 90:00:00 |\n| 800:00:00 |\n| 00:08:00 |\n| 00:00:22 |\n| 15:14:13 |\n| 09:06:03 |\n| 297:00:00 |\n+-----------+\n \n\n\nURL: https://mariadb.com/kb/en/library/time/','','https://mariadb.com/kb/en/library/time/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (293,22,'TIMESTAMP','Syntax\n------ \nTIMESTAMP [(\n\nURL: https://mariadb.com/kb/en/library/timestamp/','','https://mariadb.com/kb/en/library/timestamp/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (294,22,'TINYBLOB','Syntax\n------ \nTINYBLOB\n \nDescription\n----------- \nA BLOB column with a maximum length of \n255 (28 - 1) bytes. Each\nTINYBLOB value is stored using a one-byte length prefix that\nindicates\nthe number of bytes in the value.\n \n\n\nURL: https://mariadb.com/kb/en/library/tinyblob/','','https://mariadb.com/kb/en/library/tinyblob/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (295,22,'TINYINT','Syntax\n------ \nTINYINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n \nDescription\n----------- \nA very small integer. The signed range is -128 to 127. The\nunsigned range is 0 to 255. For details on the attributes,\nsee Numeric Data Type Overview.\n \nExamples\n-------- \nCREATE TABLE tinyints (a TINYINT,b TINYINT UNSIGNED,c\nTINYINT ZEROFILL);\nQuery OK, 0 rows affected (0.43 sec)\n \nINSERT INTO tinyints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.08 sec)\nWarning (Code 1264): Out of range value for column \'b\' at\nrow 1\nWarning (Code 1264): Out of range value for column \'c\' at\nrow 1\n \nINSERT INTO tinyints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.11 sec)\nWarning (Code 1264): Out of range value for column \'c\' at\nrow 1\n \nINSERT INTO tinyints VALUES (-10,10,10);\n \nSELECT * FROM tinyints;\n+------+------+------+\n| a | b | c |\n+------+------+------+\n| -10 | 0 | 000 |\n| -10 | 10 | 000 |\n| -10 | 10 | 010 |\n+------+------+------+\n \nINSERT INTO tinyints VALUES (128,128,128);\nQuery OK, 1 row affected, 1 warning (0.19 sec)\nWarning (Code 1264): Out of range value for column \'a\' at\nrow 1\n \nINSERT INTO tinyints VALUES (127,128,128);\n \nSELECT * FROM tinyints;\n+------+------+------+\n| a | b | c |\n+------+------+------+\n| -10 | 0 | 000 |\n| -10 | 10 | 000 |\n| -10 | 10 | 010 |\n| 127 | 128 | 128 |\n| 127 | 128 | 128 |\n+------+------+------+\n \n\n\nURL: https://mariadb.com/kb/en/library/tinyint/','','https://mariadb.com/kb/en/library/tinyint/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (296,22,'TINYTEXT','Syntax\n------ \nTINYTEXT [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n \nDescription\n----------- \nA TEXT column with a maximum length of 255 (28 - 1)\ncharacters. The effective maximum length is less if the\nvalue contains multi-byte characters. Each TINYTEXT value is\nstored using a one-byte length prefix that indicates the\nnumber of bytes in the value.\n \n\n\nURL: https://mariadb.com/kb/en/library/tinytext/','','https://mariadb.com/kb/en/library/tinytext/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (297,22,'VARBINARY','Syntax\n------ \nVARBINARY(M)\n \nDescription\n----------- \nThe VARBINARY type is similar to the VARCHAR type, but\nstores binary byte strings rather than non-binary character\nstrings. M represents the maximum column length in bytes. \n \nIt contains no character set, and comparison and sorting are\nbased on the numeric value of the bytes.\n \nIf the maximum length is exceeded, and SQL strict mode is\nnot enabled , the extra characters will be dropped with a\nwarning. If strict mode is enabled, an error will occur.\n \nUnlike BINARY values, VARBINARYs are not right-padded when\ninserting.\n \nOracle Mode\n \nIn Oracle mode from MariaDB 10.3, RAW is a synonym for\nVARBINARY.\n \nExamples\n-------- \nInserting too many characters, first with strict mode off,\nthen with it on:\n \nCREATE TABLE varbins (a VARBINARY(10));\n \nINSERT INTO varbins VALUES(\'12345678901\');\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n \nSELECT * FROM varbins;\n \n+------------+\n| a |\n+------------+\n| 1234567890 |\n+------------+\n \nSET sql_mode=\'STRICT_ALL_TABLES\';\n \nINSERT INTO varbins VALUES(\'12345678901\');\nERROR 1406 (22001): Data too long for column \'a\' at row 1\n \nSorting is performed with the byte value:\n \nTRUNCATE varbins;\n \nINSERT INTO varbins VALUES(\'A\'),(\'B\'),(\'a\'),(\'b\');\n \nSELECT * FROM varbins ORDER BY a;\n \n+------+\n| a |\n+------+\n| A |\n| B |\n| a |\n| b |\n+------+\n \nUsing CAST to sort as a CHAR instead:\n \nSELECT * FROM varbins ORDER BY CAST(a AS CHAR);\n+------+\n| a |\n+------+\n| a |\n| A |\n| b |\n| B |\n+------+\n \n\n\nURL: https://mariadb.com/kb/en/library/varbinary/','','https://mariadb.com/kb/en/library/varbinary/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (298,22,'VARCHAR','Syntax\n------ \n[NATIONAL] VARCHAR(M) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n \nDescription\n----------- \nA variable-length string. M represents the maximum column\nlength in\ncharacters. The range of M is 0 to 65,532. The effective\nmaximum\nlength of a VARCHAR is subject to the maximum row size and\nthe character set used. For\nexample, utf8 characters can require up to three bytes per\ncharacter,\nso a VARCHAR column that uses the utf8 character set can be\ndeclared\nto be a maximum of 21,844 characters.\n \nMariaDB stores VARCHAR values as a one-byte or two-byte\nlength prefix\nplus data. The length prefix indicates the number of bytes\nin the\nvalue. A VARCHAR column uses one length byte if values\nrequire no more\nthan 255 bytes, two length bytes if values may require more\nthan 255\nbytes.\n \nNote: MariaDB 5.1 and later follow the standard SQL\nspecification, \nand do not remove trailing spaces from VARCHAR values.\n \nVARCHAR(0) columns can contain 2 values: an empty string or\nNULL. Such columns cannot be part of an index. The CONNECT\nstorage engine does not support VARCHAR(0).\n \nVARCHAR is shorthand for CHARACTER VARYING. NATIONAL VARCHAR\nis the\nstandard SQL way to define that a VARCHAR column should use\nsome\npredefined character set. MariaDB uses utf8 as this\npredefined character set, as does MySQL 4.1 and up.\nNVARCHAR is shorthand for NATIONAL VARCHAR.\n \nBefore MariaDB 10.2, all MariaDB collations were of type\nPADSPACE, meaning that VARCHAR (as well as CHAR and TEXT\nvalues) are compared without regard for trailing spaces.\nThis does not apply to the LIKE pattern-matching operator,\nwhich takes into account trailing spaces. From MariaDB 10.2,\na number of NO PAD collations are available.\n \nIf a unique index consists of a column where trailing pad\ncharacters are stripped or ignored, inserts into that column\nwhere values differ only by the number of trailing pad\ncharacters will result in a duplicate-key error.\n \nExamples\n-------- \nThe following are equivalent:\n \nVARCHAR(30) CHARACTER SET utf8\nNATIONAL VARCHAR(30)\nNVARCHAR(30)\nNCHAR VARCHAR(30)\nNATIONAL CHARACTER VARYING(30)\nNATIONAL CHAR VARYING(30)\n \nTrailing spaces:\n \nCREATE TABLE strtest (v VARCHAR(10));\nINSERT INTO strtest VALUES(\'Maria \');\n \nSELECT v=\'Maria\',v=\'Maria \' FROM strtest;\n+-----------+--------------+\n| v=\'Maria\' | v=\'Maria \' |\n+-----------+--------------+\n| 1 | 1 |\n+-----------+--------------+\n \nSELECT v LIKE \'Maria\',v LIKE \'Maria \' FROM strtest;\n+----------------+-------------------+\n| v LIKE \'Maria\' | v LIKE \'Maria \' |\n+----------------+-------------------+\n| 0 | 1 |\n+----------------+-------------------+\n \nTruncation\n \nDepending on whether or not strict sql mode is set, you will\neither get a warning or an error if you try to insert a\nstring that is too long into a VARCHAR column. If the extra\ncharacters are spaces, the spaces that can\'t fit will be\nremoved and you will always get a warning, regardless of the\nsql mode setting.\n \nDifference Between VARCHAR and TEXT\n \nVARCHAR columns can be fully indexed. TEXT columns can only\nbe indexed over a specified length.\nUsing TEXT or BLOB in a SELECT query that uses temporary\ntables for storing intermediate results will force the\ntemporary table to be disk based (using the Aria storage\nengine instead of the memory storage engine, which is a bit\nslower. This is not that bad as the Aria storage engine\ncaches the rows in memory. To get the benefit of this, one\nshould ensure that the aria_pagecache_buffer_size variable\nis big enough to hold most of the row and index data for\ntemporary tables.\n \nOracle Mode\n \nIn Oracle mode from MariaDB 10.3, VARCHAR2 is a synonym.\n \nFor Storage Engine Developers\n \nInternally the full length of the VARCHAR column is\nallocated inside each TABLE objects record[] structure. As\nthere are three such buffers, each open table will allocate\n3 times max-length-to-store-varchar bytes of memory.\nTEXT and BLOB columns are stored with a pointer (4 or 8\nbytes) + a 1-4 bytes length. The TEXT data is only stored\nonce. This means that internally TEXT uses less memory for\neach open table but instead has the additional overhead that\neach TEXT object needs to be allocated and freed for each\nrow access (with some caching in between).\n \n\n\nURL: https://mariadb.com/kb/en/library/varchar/','','https://mariadb.com/kb/en/library/varchar/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (299,22,'YEAR Data Type','Syntax\n------ \nYEAR[(4)]\n \nDescription\n----------- \nA year in two-digit or four-digit format. The default is\nfour-digit format. Note that the two-digit format has been\ndeprecated since 5.5.27. \n \nIn four-digit format, the allowable values are 1901 to 2155,\nand 0000. In two-digit format, the allowable values are 70\nto 69,\nrepresenting years from 1970 to 2069. MariaDB displays YEAR\nvalues in\nYYYY format, but allows you to assign values to YEAR columns\nusing\neither strings or numbers.\n \nInserting numeric zero has a different result for YEAR(4)\nand YEAR(2). For YEAR(2), the value 00 reflects the year\n2000. For YEAR(4), the value 0000 reflects the year zero.\nThis only applies to numeric zero. String zero always\nreflects the year 2000.\n \nExamples\n-------- \nAccepting a string or a number:\n \nCREATE TABLE y(y YEAR);\n \nINSERT INTO y VALUES (1990),(\'2012\');\n \nSELECT * FROM y;\n+------+\n| y |\n+------+\n| 1990 |\n| 2012 |\n+------+\n \nOut of range:\n \nINSERT INTO y VALUES (1005),(\'3080\');\nQuery OK, 2 rows affected, 2 warnings (0.05 sec)\nRecords: 2 Duplicates: 0 Warnings: 2\n \nSHOW WARNINGS;\n+---------+------+--------------------------------------------+\n| Level | Code | Message |\n+---------+------+--------------------------------------------+\n| Warning | 1264 | Out of range value for column \'y\' at\nrow 1 |\n| Warning | 1264 | Out of range value for column \'y\' at\nrow 2 |\n+---------+------+--------------------------------------------+\n \nSELECT * FROM y;\n+------+\n| y |\n+------+\n| 1990 |\n| 2012 |\n| 0000 |\n| 0000 |\n+------+\n \nTruncating:\n \nINSERT INTO y VALUES (\'2013-12-12\');\nQuery OK, 1 row affected, 1 warning (0.05 sec)\n \nSHOW WARNINGS;\n+---------+------+----------------------------------------+\n| Level | Code | Message |\n+---------+------+----------------------------------------+\n| Warning | 1265 | Data truncated for column \'y\' at row 1\n|\n+---------+------+----------------------------------------+\n \nSELECT * FROM y;\n+------+\n| y |\n+------+\n| 1990 |\n| 2012 |\n| 0000 |\n| 0000 |\n| 2013 |\n+------+\n \nDifference between YEAR(2) and YEAR(4), and string and\nnumeric zero:\n \nCREATE TABLE y2(y YEAR(4), y2 YEAR(2));\nQuery OK, 0 rows affected, 1 warning (0.40 sec)\n \nNote (Code 1287): \'YEAR(2)\' is deprecated and will be\nremoved in a future release. Please use YEAR(4) instead\n \nINSERT INTO y2 VALUES(0,0),(\'0\',\'0\');\n \nSELECT YEAR(y),YEAR(y2) FROM y;\n+---------+----------+\n| YEAR(y) | YEAR(y2) |\n+---------+----------+\n| 0 | 2000 |\n| 2000 | 2000 |\n+---------+----------+\n \n\n\nURL: https://mariadb.com/kb/en/library/year-data-type/','','https://mariadb.com/kb/en/library/year-data-type/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (300,23,'BEGIN END','Syntax\n------ \n[begin_label:] BEGIN [NOT ATOMIC]\n [statement_list]\nEND [end_label]\n \nNOT ATOMIC is required when used outside of a stored\nprocedure. Inside stored procedures or within an anonymous\nblock, BEGIN alone starts a new anonymous block.\n \nDescription\n----------- \nBEGIN ... END syntax is used for writing compound\nstatements. A compound statement can contain multiple\nstatements, enclosed by the BEGIN and END keywords.\nstatement_list represents a list of one or more statements,\neach\nterminated by a semicolon (i.e., ;) statement delimiter.\nstatement_list is\noptional, which means that the empty compound statement\n(BEGIN END) is\nlegal.\n \nNote that END will perform a commit. If you are running in\nautocommit mode, every statement will be committed\nseparately. If you are not running in autocommit mode, you\nmust execute a COMMIT or ROLLBACK after END to get the\ndatabase up to date.\n \nUse of multiple statements requires that a client is able to\nsend statement strings containing the ; statement delimiter.\nThis is handled in the mysql command-line client with the\nDELIMITER command.\nChanging the ; end-of-statement delimiter (for example, to\n//) allows ; to be used in a program body.\n \nA compound statement within a stored program can be\nlabeled. end_label cannot be given unless begin_label also\nis present. If both are present, they must be the same.\n \nBEGIN ... END constructs can be nested. Each block can\ndefine its own variables, a CONDITION, a HANDLER and a\nCURSOR, which don\'t exist in the outer blocks. The most\nlocal declarations override the outer objects which use the\nsame name (see example below).\n \nThe declarations order is the following:\nDECLARE local variables;\nDECLARE CONDITIONs;\nDECLARE CURSORs;\nDECLARE HANDLERs;\n \nNote that DECLARE HANDLER contains another BEGIN ... END\nconstruct.\n \nHere is an example of a very simple, anonymous block:\n \nBEGIN NOT ATOMIC\nSET @a=1;\n \nCREATE TABLE test.t1(a INT);\nEND|\n \nBelow is an example of nested blocks in a stored procedure:\n \nCREATE PROCEDURE t( )\nBEGIN\n DECLARE x TINYINT UNSIGNED DEFAULT 1;\n \n BEGIN\n DECLARE x CHAR(2) DEFAULT \'02\';\n \n DECLARE y TINYINT UNSIGNED DEFAULT 10;\n \n SELECT x, y;\n \n END;\n \n SELECT x;\n \nEND;\n \nIn this example, a TINYINT variable, x is declared in the\noutter block. But in the inner block x is re-declared as a\nCHAR and an y variable is declared. The inner SELECT shows\nthe \"new\" value of x, and the value of y. But when x is\nselected in the outer block, the \"old\" value is returned.\nThe final SELECT doesn\'t try to read y, because it doesn\'t\nexist in that context.\n \n\n\nURL: https://mariadb.com/kb/en/library/begin-end/','','https://mariadb.com/kb/en/library/begin-end/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (301,23,'CASE Statement','Syntax\n------ \nCASE case_value\n WHEN when_value THEN statement_list\n [WHEN when_value THEN statement_list] ...\n [ELSE statement_list]\nEND CASE\n \nOr:\n \nCASE\n WHEN search_condition THEN statement_list\n [WHEN search_condition THEN statement_list] ...\n [ELSE statement_list] \nEND CASE\n \nDescription\n----------- \nThe CASE statement for stored programs implements a complex\nconditional\nconstruct. If a search_condition evaluates to true, the\ncorresponding SQL\nstatement list is executed. If no search condition matches,\nthe statement list\nin the ELSE clause is executed. Each statement_list consists\nof one or\nmore statements.\n \nIf no when_value or search_condition matches the value\ntested and the CASE\nstatement contains no ELSE clause, a Case not found for CASE\nstatement\nerror results.\n \nEach statement_list consists of one or more statements; an\nempty\nstatement_list is not allowed. To handle situations where no\nvalue is\nmatched by any WHEN clause, use an ELSE containing an\nempty BEGIN ... END block, as shown in this example:\n \nDELIMITER |\nCREATE PROCEDURE p()\nBEGIN\n DECLARE v INT DEFAULT 1;\n \n CASE v\n WHEN 2 THEN SELECT v;\n \n WHEN 3 THEN SELECT 0;\n \n ELSE BEGIN END;\n \n END CASE;\n \nEND;\n \n|\n \nThe indentation used here in the ELSE clause is for purposes\nof clarity only,\nand is not otherwise significant. See Delimiters in the\nmysql client for more on the use of the delimiter command.\n \nNote: The syntax of the CASE statement used inside stored\nprograms\ndiffers slightly from that of the SQL CASE expression\ndescribed in\nCASE OPERATOR.\nThe CASE statement cannot have an ELSE NULL clause, and it\nis\nterminated with END CASE instead of END.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/case-statement/','','https://mariadb.com/kb/en/library/case-statement/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (302,23,'CLOSE','Syntax\n------ \nCLOSE cursor_name\n \nDescription\n----------- \nThis statement closes a previously opened cursor. The cursor\nmust have been previously opened or else an error occurs.\n \nIf not closed explicitly, a cursor is closed at the end of\nthe\ncompound statement in which it was declared.\n \nSee Cursor Overview for an example.\n \n\n\nURL: https://mariadb.com/kb/en/library/close/','','https://mariadb.com/kb/en/library/close/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (303,23,'DECLARE CONDITION','Syntax\n------ \nDECLARE condition_name CONDITION FOR condition_value\n \ncondition_value:\n SQLSTATE [VALUE] sqlstate_value\n | mysql_error_code\n \nDescription\n----------- \nThe DECLARE ... CONDITION statement defines a named error\ncondition.\nIt specifies a condition that needs specific handling and\nassociates a\nname with that condition. Later, the name can be used in a\nDECLARE ... HANDLER, SIGNAL or RESIGNAL statement (as long\nas the statement is located in the same BEGIN ... END\nblock).\n \nConditions must be declared after local variables, but\nbefore CURSORs and HANDLERs.\n \nA condition_value for DECLARE ... CONDITION can be an\nSQLSTATE value (a\n5-character string literal) or a MySQL error code (a\nnumber). You should not\nuse SQLSTATE value \'00000\' or MySQL error code 0, because\nthose indicate sucess\nrather than an error condition. If you try, or if you\nspecify an invalid SQLSTATE value, an error like this is\nproduced:\n \nERROR 1407 (42000): Bad SQLSTATE: \'00000\'\n \nFor a list of SQLSTATE values and MariaDB error\ncodes, see MariaDB Error Codes.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/declare-condition/','','https://mariadb.com/kb/en/library/declare-condition/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (304,23,'DECLARE CURSOR','Syntax\n------ \n\n\nURL: https://mariadb.com/kb/en/library/declare-cursor/','','https://mariadb.com/kb/en/library/declare-cursor/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (305,23,'DECLARE HANDLER','Syntax\n------ \nDECLARE handler_type HANDLER\n FOR condition_value [, condition_value] ...\n statement\n \nhandler_type:\n CONTINUE\n | EXIT \n | UNDO\n \ncondition_value:\n SQLSTATE [VALUE] sqlstate_value\n | condition_name\n | SQLWARNING\n | NOT FOUND\n | SQLEXCEPTION\n | mariadb_error_code\n \nDescription\n----------- \nThe DECLARE ... HANDLER statement specifies handlers that\neach may\ndeal with one or more conditions. If one of these conditions\noccurs,\nthe specified statement is executed. statement can be a\nsimple\nstatement (for example, SET var_name = value), or it can be\na compound\nstatement written using BEGIN and END.\n \nHandlers must be declared after local variables, a CONDITION\nand a CURSOR.\n \nFor a CONTINUE handler, execution of the current program\ncontinues\nafter execution of the handler statement. For an EXIT\nhandler,\nexecution terminates for the BEGIN ... END compound\nstatement in which\nthe handler is declared. (This is true even if the condition\noccurs in\nan inner block.) The UNDO handler type statement is not\nsupported.\n \nIf a condition occurs for which no handler has been\ndeclared, the\ndefault action is EXIT.\n \nA condition_value for DECLARE ... HANDLER can be any of the\nfollowing\nvalues:\nAn SQLSTATE value (a 5-character string literal) or a\nMariaDB error\ncode (a number). You should not use SQLSTATE value \'00000\'\nor MariaDB\nerror code 0, because those indicate sucess rather than an\nerror\ncondition. For a list of SQLSTATE values and MariaDB error\ncodes, see\nMariaDB Error Codes.\nA condition name previously specified with DECLARE ...\nCONDITION. It must be in the same stored program. See\nDECLARE CONDITION.\nSQLWARNING is shorthand for the class of SQLSTATE values\nthat begin\nwith \'01\'.\nNOT FOUND is shorthand for the class of SQLSTATE values that\nbegin\nwith \'02\'. This is relevant only the context of cursors\nand is used to\ncontrol what happens when a cursor reaches the end of a data\nset. If\nno more rows are available, a No Data condition occurs with\nSQLSTATE\nvalue 02000. To detect this condition, you can set up a\nhandler for it\n(or for a NOT FOUND condition). An example is shown in\nCursor Overview. This condition also occurs for SELECT ...\nINTO var_list statements that retrieve no\nrows.\nSQLEXCEPTION is shorthand for the class of SQLSTATE values\nthat do\nnot begin with \'00\', \'01\', or \'02\'.\n \nWhen an error raises, in some cases it could be handled by\nmultiple HANDLERs. For example, there may be an handler for\n1050 error, a separate handler for the 42S01 SQLSTATE, and\nanother separate handler for the SQLEXCEPTION class: in\ntheory all occurrences of HANDLER may catch the 1050 error,\nbut MariaDB chooses the HANDLER with the highest precedence.\nHere are the precedence rules:\nHandlers which refer to an error code have the highest\nprecedence.\nHandlers which refer to a SQLSTATE come next.\nHandlers which refer to an error class have the lowest\nprecedence.\n \nIn some cases, a statement could produce multiple errors. If\nthis happens, in some cases multiple handlers could have the\nhighest precedence. In such cases, the choice of the handler\nis indeterminate.\n \nNote that if an error occurs within a CONTINUE HANDLER\nblock, it can be handled by another HANDLER. However, a\nHANDLER which is already in the stack (that is, it has been\ncalled to handle an error and its execution didn\'t finish\nyet) cannot handle new errors—this prevents endless loops.\nFor example, suppose that a stored procedure contains a\nCONTINUE HANDLER for SQLWARNING and another CONTINUE HANDLER\nfor NOT FOUND. At some point, a NOT FOUND error occurs, and\nthe execution enters the NOT FOUND HANDLER. But within that\nhandler, a warning occurs, and the execution enters the\nSQLWARNING HANDLER. If another NOT FOUND error occurs, it\ncannot be handled again by the NOT FOUND HANDLER, because\nits execution is not finished.\n \nWhen a DECLARE HANDLER block can handle more than one error\ncondition, it may be useful to know which errors occurred.\nTo do so, you can use the GET DIAGNOSTICS statement.\n \nAn error that is handled by a DECLARE HANDLER construct can\nbe issued again using the RESIGNAL statement.\n \nBelow is an example using DECLARE HANDLER:\n \nCREATE TABLE test.t (s1 INT, PRIMARY KEY (s1));\n \nDELIMITER //\n \nCREATE PROCEDURE handlerdemo ( )\n BEGIN\n DECLARE CONTINUE HANDLER FOR SQLSTATE \'23000\' SET @x2 =\n1;\n \n SET @x = 1;\n \n INSERT INTO test.t VALUES (1);\n SET @x = 2;\n \n INSERT INTO test.t VALUES (1);\n SET @x = 3;\n \n END;\n \n //\n \nDELIMITER ;\n \nCALL handlerdemo( );\n \nSELECT @x;\n \n+------+\n| @x |\n+------+\n| 3 |\n+------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/declare-handler/','','https://mariadb.com/kb/en/library/declare-handler/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (306,23,'DECLARE Variable','Syntax\n------ \nDECLARE var_name [, var_name] ... [[ROW] TYPE OF]] type\n[DEFAULT value]\n \nDescription\n----------- \nThis statement is used to declare local variables within\nstored programs. To\nprovide a default value for the variable, include a DEFAULT\nclause. The\nvalue can be specified as an expression (even subqueries are\npermitted); it need not be a constant. If the\nDEFAULT clause is missing, the initial value is NULL.\n \nLocal variables are treated like stored routine parameters\nwith respect to data\ntype and overflow checking. See CREATE PROCEDURE.\n \nLocal variables must be declared before CONDITIONs, CURSORs\nand HANDLERs.\n \nLocal variable names are not case sensitive.\n \nThe scope of a local variable is within the BEGIN ... END\nblock where it is\ndeclared. The variable can be referred to in blocks nested\nwithin the declaring\nblock, except those blocks that declare a variable with the\nsame name.\n \nTYPE OF / ROW TYPE OF\n \nTYPE OF and ROW TYPE OF anchored data types for stored\nroutines were introduced in MariaDB 10.3.\n \nAnchored data types allow a data type to be defined based on\nanother object, such as a table row, rather than\nspecifically set in the declaration. If the anchor object\nchanges, so will the anchored data type. This can lead to\nroutines being easier to maintain, so that if the data type\nin the table is changed, it will automatically be changed in\nthe routine as well.\n \nVariables declared with ROW TYPE OF will have the same\nfeatures as implicit ROW variables. It is not possible to\nuse ROW TYPE OF variables in a LIMIT clause.\n \nThe real data type of TYPE OF and ROW TYPE OF table_name\nwill become known at the very beginning of the stored\nroutine call. ALTER TABLE or DROP TABLE statements performed\ninside the current routine on the tables that appear in\nanchors won\'t affect the data type of the anchored\nvariables, even if the variable is declared after an ALTER\nTABLE or DROP TABLE statement.\n \nThe real data type of a ROW TYPE OF cursor_name variable\nwill become known when execution enters into the block where\nthe variable is declared. Data type instantiation will\nhappen only once. In a cursor ROW TYPE OF variable that is\ndeclared inside a loop, its data type will become known on\nthe very first iteration and won\'t change on further loop\niterations.\n \nThe tables referenced in TYPE OF and ROW TYPE OF\ndeclarations will be checked for existence at the beginning\nof the stored routine call. CREATE PROCEDURE or CREATE\nFUNCTION will not check the referenced tables for existence.\n \nExamples\n-------- \nTYPE OF and ROW TYPE OF from MariaDB 10.3:\n \nDECLARE tmp TYPE OF t1.a;\n -- Get the data type from the column {{a}} in the table\n{{t1}}\n \nDECLARE rec1 ROW TYPE OF t1;\n -- Get the row data type from the table {{t1}}\n \nDECLARE rec2 ROW TYPE OF cur1;\n -- Get the row data type from the cursor {{cur1}}\n \n\n\nURL: https://mariadb.com/kb/en/library/declare-variable/','','https://mariadb.com/kb/en/library/declare-variable/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (307,23,'FETCH','Syntax\n------ \nFETCH cursor_name INTO var_name [, var_name] ...\n \nDescription\n----------- \nThis statement fetches the next row (if a row exists) using\nthe\nspecified open cursor, and advances the cursor pointer.\n \nvar_name can be a local variable, but not a user-defined\nvariable.\n \nIf no more rows are available, a No Data condition occurs\nwith\nSQLSTATE value 02000. To detect this condition, you can set\nup a\nhandler for it (or for a NOT FOUND condition).\n \nSee Cursor Overview for an example.\n \n\n\nURL: https://mariadb.com/kb/en/library/fetch/','','https://mariadb.com/kb/en/library/fetch/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (308,23,'FOR','FOR loops were introduced in MariaDB 10.3.\n \nSyntax\n------ \nInteger range FOR loop:\n \n[begin_label:]\nFOR var_name IN [ REVERSE ] lower_bound .. upper_bound\nDO statement_list\nEND FOR [ end_label ]\n \nExplicit cursor FOR loop\n \n[begin_label:]\nFOR record_name IN cursor_name [ (\ncursor_actual_parameter_list)]\nDO statement_list\nEND FOR [ end_label ]\n \nExplicit cursor FOR loop (Oracle mode)\n \n[begin_label:]\nFOR record_name IN cursor_name [ (\ncursor_actual_parameter_list)]\nLOOP\n statement_list\nEND LOOP [ end_label ]\n \nImplicit cursor FOR loop\n \n[begin_label:]\nFOR record_name IN ( select_statement )\nDO statement_list\nEND FOR [ end_label ]\n \nDescription\n----------- \nFOR loops allow code to be executed a fixed number of times.\n \nIn an integer range FOR loop, MariaDB will compare the lower\nbound and upper bound values, and assign the lower bound\nvalue to a counter. If REVERSE is not specified, and the\nupper bound value is greater than or equal to the counter,\nthe counter will be incremented and the statement will\ncontinue, after which the loop is entered again. If the\nupper bound value is greater than the counter, the loop will\nbe exited.\n \nIf REVERSE is specified, the counter is decremented, and the\nupper bound value needs to be less than or equal for the\nloop to continue.\n \nExamples\n-------- \nIntger range FOR loop:\n \nCREATE TABLE t1 (a INT);\n \nDELIMITER //\n \nFOR i IN 1..3\nDO\n INSERT INTO t1 VALUES (i);\nEND FOR;\n \n//\n \nDELIMITER ;\n \nSELECT * FROM t1;\n \n+------+\n| a |\n+------+\n| 1 |\n| 2 |\n| 3 |\n+------+\n \nREVERSE integer range FOR loop:\n \nCREATE OR REPLACE TABLE t1 (a INT);\n \nDELIMITER //\nFOR i IN REVERSE 12..4\n DO\n INSERT INTO t1 VALUES (i);\nEND FOR;\n \n//\nQuery OK, 9 rows affected (0.422 sec)\n \nDELIMITER ;\n \nSELECT * FROM t1;\n \n+------+\n| a |\n+------+\n| 12 |\n| 11 |\n| 10 |\n| 9 |\n| 8 |\n| 7 |\n| 6 |\n| 5 |\n| 4 |\n+------+\n \nExplicit cursor in Oracle mode:\n \nSET sql_mode=ORACLE;\n \nCREATE OR REPLACE TABLE t1 (a INT, b VARCHAR(32));\n \nINSERT INTO t1 VALUES (10,\'b0\');\nINSERT INTO t1 VALUES (11,\'b1\');\nINSERT INTO t1 VALUES (12,\'b2\');\n \nDELIMITER //\n \nCREATE OR REPLACE PROCEDURE p1(pa INT) AS \n CURSOR cur(va INT) IS\n SELECT a, b FROM t1 WHERE a=va;\n \nBEGIN\n FOR rec IN cur(pa)\n LOOP\n SELECT rec.a, rec.b;\n \n END LOOP;\n \nEND;\n \n//\n \nDELIMITER ;\n \nCALL p1(10);\n+-------+-------+\n| rec.a | rec.b |\n+-------+-------+\n| 10 | b0 |\n+-------+-------+\n \nCALL p1(11);\n+-------+-------+\n| rec.a | rec.b |\n+-------+-------+\n| 11 | b1 |\n+-------+-------+\n \nCALL p1(12);\n+-------+-------+\n| rec.a | rec.b |\n+-------+-------+\n| 12 | b2 |\n+-------+-------+\n \nCALL p1(13);\nQuery OK, 0 rows affected (0.000 sec)\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/for/','','https://mariadb.com/kb/en/library/for/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (309,23,'GOTO','The GOTO statement was introduced in MariaDB 10.3 for Oracle\ncompatibility.\n \nSyntax\n------ \nGOTO label\n \nDescription\n----------- \nThe GOTO statement causes the code to jump to the specified\nlabel, and continue operating from there. It is only\naccepted when in Oracle mode.\n \nExample\n \nSET sql_mode=ORACLE;\n \nDELIMITER //\n \nCREATE OR REPLACE PROCEDURE p1 AS\n \nBEGIN\n \n SELECT 1;\n \n GOTO label;\n \n SELECT 2;\n \n SELECT 3;\n \nEND;\n \n//\n \nDELIMITER \n \ncall p1();\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n1 row in set (0.000 sec)\n \n+---+\n| 3 |\n+---+\n| 3 |\n+---+\n1 row in set (0.000 sec)\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/goto/','','https://mariadb.com/kb/en/library/goto/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (310,23,'IF','Syntax\n------ \nIF search_condition THEN statement_list\n [ELSEIF search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND IF;\n \nDescription\n----------- \nIF implements a basic conditional construct. If the\nsearch_condition\nevaluates to true, the corresponding SQL statement list is\nexecuted.\nIf no search_condition matches, the statement list in the\nELSE clause\nis executed. Each statement_list consists of one or more\nstatements.\n \n\n\nURL: https://mariadb.com/kb/en/library/if/','','https://mariadb.com/kb/en/library/if/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (311,23,'ITERATE','Syntax\n------ \nITERATE label\n \nITERATE can appear only within LOOP, REPEAT, and WHILE\nstatements.\nITERATE means \"do the loop again\", and uses the\nstatement\'s label to determine which statements to repeat.\nThe label must be in the same stored program, not in a\ncaller procedure.\n \nIf you try to use ITERATE with a non-existing label, or if\nthe label is associated to a construct which is not a loop,\nthe following error will be produced:\n \nERROR 1308 (42000): ITERATE with no matching label: \n \nBelow is an example of how ITERATE might be used:\n \nCREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n SET p1 = p1 + 1;\n \n IF p1 \n\nURL: https://mariadb.com/kb/en/library/iterate/','','https://mariadb.com/kb/en/library/iterate/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (312,23,'Labels','Syntax\n------ \nlabel: \n[label]\n \nLabels are MariaDB identifiers which can be used to identify\na BEGIN ... END construct or a loop. They have a maximum\nlength of 16 characters and can be quoted with backticks\n(i.e.., `).\n \nLabels have a start part and an end part. The start part\nmust precede the portion of code it refers to, must be\nfollowed by a colon (:) and can be on the same or different\nline. The end part is optional and adds nothing, but can\nmake the code more readable. If used, the end part must\nprecede the construct\'s delimiter (;). Constructs\nidentified by a label can be nested. Each construct can be\nidentified by only one label.\n \nLabels need not be unique in the stored program they belong\nto. However, a label for an inner loop cannot be identical\nto a label for an outer loop. In this case, the following\nerror would be produced:\n \nERROR 1309 (42000): Redefining label \n \nLEAVE and ITERATE statements can be used to exit or repeat a\nportion of code identified by a label. They must be in the\nsame Stored Routine, Trigger or Event which contains the\ntarget label.\n \nBelow is an example using a simple label that is used to\nexit a LOOP:\n \nCREATE PROCEDURE `test_sp`()\nBEGIN\n `my_label`:\n LOOP\n SELECT \'looping\';\n \n LEAVE `my_label`;\n \n END LOOP;\n \n SELECT \'out of loop\';\n \nEND;\n \nThe following label is used to exit a procedure, and has an\nend part:\n \nCREATE PROCEDURE `test_sp`()\n`my_label`:\nBEGIN\n IF @var = 1 THEN\n LEAVE `my_label`;\n \n END IF;\n \n DO something();\nEND `my_label`;\n \n\n \n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/labels/','','https://mariadb.com/kb/en/library/labels/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (313,23,'LEAVE','Syntax\n------ \nLEAVE label\n \nThis statement is used to exit the flow control construct\nthat has the\ngiven label. The label must be in the same stored program,\nnot in a caller procedure. LEAVE can be used within BEGIN\n... END or loop constructs\n(LOOP, REPEAT, WHILE). In Stored Procedures, Triggers and\nEvents, LEAVE can refer to the outmost BEGIN ... END\nconstruct; in that case, the program exits the procedure. In\nStored Functions, RETURN can be used instead.\n \nNote that LEAVE cannot be used to exit a DECLARE HANDLER\nblock.\n \nIf you try to LEAVE a non-existing label, or if you try to\nLEAVE a HANDLER block, the following error will be produced:\n \nERROR 1308 (42000): LEAVE with no matching label: \n \nThe following example uses LEAVE to exit the procedure if a\ncondition is true:\n \nCREATE PROCEDURE proc(IN p TINYINT)\nCONTAINS SQL\n`whole_proc`:\nBEGIN\n SELECT 1;\n \n IF p \n\nURL: https://mariadb.com/kb/en/library/leave/','','https://mariadb.com/kb/en/library/leave/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (314,23,'LOOP','Syntax\n------ \n[begin_label:] LOOP\n statement_list\nEND LOOP [end_label]\n \nDescription\n----------- \nLOOP implements a simple loop construct, enabling repeated\nexecution\nof the statement list, which consists of one or more\nstatements, each\nterminated by a semicolon (i.e., ;) statement delimiter. The\nstatements\nwithin the loop are repeated until the loop is exited;\nusually this is\naccomplished with a LEAVE statement.\n \nA LOOP statement can be labeled. end_label cannot be given\nunless\nbegin_label also is present. If both are present, they must\nbe the\nsame.\n \nSee Delimiters in the mysql client for more on delimiter\nusage in the client.\n \n\n\nURL: https://mariadb.com/kb/en/library/loop/','','https://mariadb.com/kb/en/library/loop/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (315,23,'OPEN','Syntax\n------ \n\n\nURL: https://mariadb.com/kb/en/library/open/','','https://mariadb.com/kb/en/library/open/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (316,23,'REPEAT LOOP','Syntax\n------ \n[begin_label:] REPEAT\n statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n \nThe statement list within a REPEAT statement is repeated\nuntil the\nsearch_condition is true. Thus, a REPEAT always enters the\nloop at\nleast once. statement_list consists of one or more\nstatements, each\nterminated by a semicolon (i.e., ;) statement delimiter.\n \nA REPEAT statement can be labeled. end_label cannot be given\nunless\nbegin_label also is present. If both are present, they must\nbe the\nsame.\n \nSee Delimiters in the mysql client for more on client\ndelimiter usage.\n \nDELIMITER //\n \nCREATE PROCEDURE dorepeat(p1 INT)\n BEGIN\n SET @x = 0;\n \n REPEAT SET @x = @x + 1;\n UNTIL @x > p1 END REPEAT;\n \n END\n//\n \nCALL dorepeat(1000)//\n \nSELECT @x//\n+------+\n| @x |\n+------+\n| 1001 |\n+------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/repeat-loop/','','https://mariadb.com/kb/en/library/repeat-loop/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (317,23,'RESIGNAL','SIGNAL and RESIGNAL were both introduced in MariaDB 5.5.\n \nSyntax\n------ \nRESIGNAL [error_condition]\n [SET error_property\n [, error_property] ...]\n \nerror_condition:\n SQLSTATE [VALUE] \'sqlstate_value\'\n | condition_name\n \nerror_property:\n error_property_name = \n \nerror_property_name:\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n \nDescription\n----------- \nThe syntax of RESIGNAL and its semantics are very similar to\nSIGNAL. This statement can only be used within an error\nHANDLER. It produces an error, like SIGNAL. RESIGNAL clauses\nare the same as SIGNAL, except that they all are optional,\neven SQLSTATE. All the properties which are not specified in\nRESIGNAL, will be identical to the properties of the error\nthat was received by the error HANDLER. For a description of\nthe clauses, see diagnostics area.\n \nNote that RESIGNAL does not empty the diagnostics area: it\njust appends another error condition.\n \nRESIGNAL, without any clauses, produces an error which is\nidentical to the error that was received by HANDLER.\n \nIf used out of a HANDLER construct, RESIGNAL produces the\nfollowing error:\n \nERROR 1645 (0K000): RESIGNAL when handler not active\n \nIn MariaDB 5.5, if a HANDLER contained a CALL to another\nprocedure, that procedure could use RESIGNAL. Since MariaDB\n10.0, trying to do this raises the above error.\n \nFor a list of SQLSTATE values and MariaDB error codes, see\nMariaDB Error Codes.\n \nThe following procedure tries to query two tables which\ndon\'t exist, producing a 1146 error in both cases. Those\nerrors will trigger the HANDLER. The first time the error\nwill be ignored and the client will not receive it, but the\nsecond time, the error is re-signaled, so the client will\nreceive it.\n \nCREATE PROCEDURE test_error( )\nBEGIN\n DECLARE CONTINUE HANDLER\n FOR 1146\n BEGIN\n IF @hide_errors IS FALSE THEN\n RESIGNAL;\n \n END IF;\n \n END;\n \n SET @hide_errors = TRUE;\n \n SELECT \'Next error will be ignored\' AS msg;\n \n SELECT `c` FROM `temptab_one`;\n \n SELECT \'Next error won\'\'t be ignored\' AS msg;\n \n SET @hide_errors = FALSE;\n \n SELECT `c` FROM `temptab_two`;\n \nEND;\n \nCALL test_error( );\n \n+----------------------------+\n| msg |\n+----------------------------+\n| Next error will be ignored |\n+----------------------------+\n \n+-----------------------------+\n| msg |\n+-----------------------------+\n| Next error won\'t be ignored |\n+-----------------------------+\n \nERROR 1146 (42S02): Table \'test.temptab_two\' doesn\'t\nexist\n \nThe following procedure re-signals an error, modifying only\nthe error message to clarify the cause of the problem.\n \nCREATE PROCEDURE test_error()\nBEGIN\n DECLARE CONTINUE HANDLER\n FOR 1146\n BEGIN\n RESIGNAL SET\n MESSAGE_TEXT = \'`temptab` does not exist\';\n \n END;\n \n SELECT `c` FROM `temptab`;\n \nEND;\n \nCALL test_error( );\nERROR 1146 (42S02): `temptab` does not exist\n \nAs explained above, this works on MariaDB 5.5, but produces\na 1645 error since 10.0.\n \nCREATE PROCEDURE handle_error()\nBEGIN\n RESIGNAL;\n \nEND;\n \nCREATE PROCEDURE p()\nBEGIN\n DECLARE EXIT HANDLER FOR SQLEXCEPTION CALL p();\n SIGNAL SQLSTATE \'45000\';\n \nEND;\n \n\n\nURL: https://mariadb.com/kb/en/library/resignal/','','https://mariadb.com/kb/en/library/resignal/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (318,23,'RETURN','Syntax\n------ \nRETURN expr \n \nThe RETURN statement terminates execution of a stored\nfunction and\nreturns the value expr to the function caller. There must be\nat least\none RETURN statement in a stored function. If the function\nhas multiple exit points, all exit points must have a\nRETURN.\n \nThis statement is not used in stored procedures, triggers,\nor events. LEAVE can be used instead.\n \nThe following example shows that RETURN can return the\nresult of a scalar subquery:\n \nCREATE FUNCTION users_count() RETURNS BOOL\n READS SQL DATA\nBEGIN\n RETURN (SELECT COUNT(DISTINCT User) FROM mysql.user);\nEND;\n \n\n \n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/return/','','https://mariadb.com/kb/en/library/return/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (319,23,'SELECT INTO','Syntax\n------ \nSELECT col_name [, col_name] ...\n INTO var_name [, var_name] ...\n table_expr\n \nDescription\n----------- \nSELECT ... INTO enables selected columns to be stored\ndirectly\ninto variables. No resultset is produced. The query should\nreturn a single row. If the query\nreturns no rows, a warning with error code 1329 occurs (No\ndata), and\nthe variable values remain unchanged. If the query returns\nmultiple\nrows, error 1172 occurs (Result consisted of more than one\nrow). If it\nis possible that the statement may retrieve multiple rows,\nyou can use\nLIMIT 1 to limit the result set to a single row.\n \nThe INTO clause can also be specified at the end of the\nstatement.\n \nIn the context of such statements that occur as part of\nevents\nexecuted by the Event Scheduler, diagnostics messages (not\nonly\nerrors, but also warnings) are written to the error log,\nand, on\nWindows, to the application event log.\n \nThis statement can be used with both local variables and\nuser-defined variables.\n \nFor the complete syntax, see SELECT.\n \nAnother way to set a variable\'s value is the SET statement.\n \nSELECT ... INTO results are not stored in the query cache\neven if SQL_CACHE is specified.\n \nExamples\n-------- \nSELECT id, data INTO @x,@y \nFROM test.t1 LIMIT 1;\n \n\n\nURL: https://mariadb.com/kb/en/library/selectinto/','','https://mariadb.com/kb/en/library/selectinto/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (320,23,'SIGNAL','SIGNAL and RESIGNAL were both introduced in MariaDB 5.5.\n \nSyntax\n------ \nSIGNAL error_condition\n [SET error_property\n [, error_property] ...]\n \nerror_condition:\n SQLSTATE [VALUE] \'sqlstate_value\'\n | condition_name\n \nerror_property:\n error_property_name = \n \nerror_property_name:\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n \nSIGNAL empties the diagnostics area and produces a custom\nerror. This statement can be used anywhere, but is generally\nuseful when used inside a stored program. When the error is\nproduced, it can be caught by a HANDLER. If not, the current\nstored program, or the current statement, will terminate\nwith the specified error.\n \nSometimes an error HANDLER just needs to SIGNAL the same\nerror it received, optionally with some changes. Usually the\nRESIGNAL statement is the most convenient way to do this.\n \nerror_condition can be an SQLSTATE value or a named error\ncondition defined via DECLARE CONDITION. SQLSTATE must be a\nconstant string consisting of five characters. These codes\nare standard to ODBC and ANSI SQL. For customized errors,\nthe recommended SQLSTATE is \'45000\'. For a list of\nSQLSTATE values used by MariaDB, see the MariaDB Error Codes\npage. The SQLSTATE can be read via the API method\nmysql_sqlstate( ). \n \nTo specify error properties user-defined variables and local\nvariables can be used, as well as character set conversions\n(but you can\'t set a collation).\n \nThe error properties, their type and their default values\nare explained in the diagnostics area page.\n \nErrors\n \nIf the SQLSTATE is not valid, the following error like this\nwill be produced:\n \nERROR 1407 (42000): Bad SQLSTATE: \'123456\'\n \nIf a property is specified more than once, an error like\nthis will be produced:\n \nERROR 1641 (42000): Duplicate condition information item\n\'MESSAGE_TEXT\'\n \nIf you specify a condition name which is not declared, an\nerror like this will be produced:\n \nERROR 1319 (42000): Undefined CONDITION: cond_name\n \nIf MYSQL_ERRNO is out of range, you will get an error like\nthis:\n \nERROR 1231 (42000): Variable \'MYSQL_ERRNO\' can\'t be set\nto the value of \'0\'\n \nExamples\n-------- \nHere\'s what happens if SIGNAL is used in the client to\ngenerate errors:\n \nSIGNAL SQLSTATE \'01000\';\n \nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n \nSHOW WARNINGS;\n \n+---------+------+------------------------------------------+\n| Level | Code | Message |\n+---------+------+------------------------------------------+\n| Warning | 1642 | Unhandled user-defined warning condition\n|\n+---------+------+------------------------------------------+\n1 row in set (0.06 sec)\n \nSIGNAL SQLSTATE \'02000\';\n \nERROR 1643 (02000): Unhandled user-defined not found\ncondition\n \nHow to specify MYSQL_ERRNO and MESSAGE_TEXT properties:\n \nSIGNAL SQLSTATE \'45000\' SET MYSQL_ERRNO=30001,\nMESSAGE_TEXT=\'H\nello, world!\';\n \nERROR 30001 (45000): Hello, world!\n \nThe following code shows how to use user variables, local\nvariables and character set conversion with SIGNAL:\n \nCREATE PROCEDURE test_error(x INT)\nBEGIN\n DECLARE errno SMALLINT UNSIGNED DEFAULT 31001;\n \n SET @errmsg = \'Hello, world!\';\n \n IF x = 1 THEN\n SIGNAL SQLSTATE \'45000\' SET\n MYSQL_ERRNO = errno,\n MESSAGE_TEXT = @errmsg;\n \n ELSE\n SIGNAL SQLSTATE \'45000\' SET\n MYSQL_ERRNO = errno,\n MESSAGE_TEXT = _utf8\'Hello, world!\';\n \n END IF;\n \nEND;\n \nHow to use named error conditions:\n \nCREATE PROCEDURE test_error(n INT)\nBEGIN\n DECLARE `too_big` CONDITION FOR SQLSTATE \'45000\';\n \n IF n > 10 THEN\n SIGNAL `too_big`;\n \n END IF;\n \nEND;\n \nIn this example, we\'ll define a HANDLER for an error code.\nWhen the error occurs, we SIGNAL a more informative error\nwhich makes sense for our procedure:\n \nCREATE PROCEDURE test_error()\nBEGIN\n DECLARE EXIT HANDLER\n FOR 1146\n BEGIN\n SIGNAL SQLSTATE \'45000\' SET\n MESSAGE_TEXT = \'Temporary tables not found; did you call\ninit() procedure?\';\n \n END;\n \n -- this will produce a 1146 error\n SELECT `c` FROM `temptab`;\n \nEND;\n \n\n\nURL: https://mariadb.com/kb/en/library/signal/','','https://mariadb.com/kb/en/library/signal/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (321,23,'WHILE','Syntax\n------ \n[begin_label:] WHILE search_condition DO\n statement_list\nEND WHILE [end_label]\n \nDescription\n----------- \nThe statement list within a WHILE statement is repeated as\nlong as the\nsearch_condition is true. statement_list consists of one or\nmore\nstatements. If the loop must be executed at least once,\nREPEAT ... LOOP can be used instead.\n \nA WHILE statement can be labeled. end_label cannot be given\nunless\nbegin_label also is present. If both are present, they must\nbe the\nsame.\n \nExamples\n-------- \nCREATE PROCEDURE dowhile()\nBEGIN\n DECLARE v1 INT DEFAULT 5;\n \n WHILE v1 > 0 DO\n ...\n SET v1 = v1 - 1;\n \n END WHILE;\n \nEND\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/while/','','https://mariadb.com/kb/en/library/while/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (322,24,'BUFFER','A synonym for ST_BUFFER.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/buffer/','','https://mariadb.com/kb/en/library/buffer/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (323,24,'CONVEXHULL','A synonym for ST_CONVEXHULL.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/convexhull/','','https://mariadb.com/kb/en/library/convexhull/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (324,24,'GEOMETRYCOLLECTION','Syntax\n------ \nGeometryCollection(g1,g2,...)\n \nDescription\n----------- \nConstructs a WKB GeometryCollection. If any argument is not\na well-formed WKB representation of a geometry, the return\nvalue is NULL.\n \nExamples\n-------- \nCREATE TABLE gis_geometrycollection (g GEOMETRYCOLLECTION);\nSHOW FIELDS FROM gis_geometrycollection;\n \nINSERT INTO gis_geometrycollection VALUES\n (GeomCollFromText(\'GEOMETRYCOLLECTION(POINT(0 0),\nLINESTRING(0 0,10 10))\')),\n (GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6),\nLineString(Point(3, 6), Point(7, 9)))))),\n (GeomFromText(\'GeometryCollection()\')),\n (GeomFromText(\'GeometryCollection EMPTY\'));\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/geometrycollection/','','https://mariadb.com/kb/en/library/geometrycollection/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (325,24,'LINESTRING','Syntax\n------ \nLineString(pt1,pt2,...)\n \nDescription\n----------- \nConstructs a WKB LineString value from a number of WKB Point\narguments. If any argument is not a WKB Point, the return\nvalue is\nNULL. If the number of Point arguments is less than two, the\nreturn value is NULL.\n \nExamples\n-------- \nSET @ls = \'LineString(1 1,2 2,3 3)\';\n \nSELECT AsText(EndPoint(GeomFromText(@ls)));\n+-------------------------------------+\n| AsText(EndPoint(GeomFromText(@ls))) |\n+-------------------------------------+\n| POINT(3 3) |\n+-------------------------------------+\n \nCREATE TABLE gis_line (g LINESTRING);\nINSERT INTO gis_line VALUES\n (LineFromText(\'LINESTRING(0 0,0 10,10 0)\')),\n (LineStringFromText(\'LINESTRING(10 10,20 10,20 20,10 20,10\n10)\')),\n (LineStringFromWKB(AsWKB(LineString(Point(10, 10),\nPoint(40, 10)))));\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/linestring/','','https://mariadb.com/kb/en/library/linestring/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (326,24,'MULTILINESTRING','Syntax\n------ \nMultiLineString(ls1,ls2,...)\n \nDescription\n----------- \nConstructs a WKB MultiLineString value using WKB LineString\narguments. If any argument is not a WKB LineString, the\nreturn value is\nNULL.\n \nExample\n \nCREATE TABLE gis_multi_line (g MULTILINESTRING);\nINSERT INTO gis_multi_line VALUES\n (MultiLineStringFromText(\'MULTILINESTRING((10 48,10 21,10\n0),(16 0,16 23,16 48))\')),\n (MLineFromText(\'MULTILINESTRING((10 48,10 21,10 0))\')),\n (MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2),\nPoint(3, 5)), LineString(Point(2, 5),Point(5, 8),Point(21,\n7))))));\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/multilinestring/','','https://mariadb.com/kb/en/library/multilinestring/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (327,24,'MULTIPOINT','Syntax\n------ \nMultiPoint(pt1,pt2,...)\n \nDescription\n----------- \nConstructs a WKB MultiPoint value using WKB Point arguments.\nIf any argument is not a WKB Point, the return value is\nNULL.\n \nExamples\n-------- \nSET @g = ST_GEOMFROMTEXT(\'MultiPoint( 1 1, 2 2, 5 3, 7 2, 9\n3, 8 4, 6 6, 6 9, 4 9, 1 5 )\');\n \nCREATE TABLE gis_multi_point (g MULTIPOINT);\nINSERT INTO gis_multi_point VALUES\n (MultiPointFromText(\'MULTIPOINT(0 0,10 10,10 20,20\n20)\')),\n (MPointFromText(\'MULTIPOINT(1 1,11 11,11 21,21 21)\')),\n (MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4,\n10)))));\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/multipoint/','','https://mariadb.com/kb/en/library/multipoint/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (328,24,'MULTIPOLYGON','Syntax\n------ \nMultiPolygon(poly1,poly2,...)\n \nDescription\n----------- \nConstructs a WKB MultiPolygon value from a set of WKB\nPolygon arguments. If any argument is not a WKB Polygon, the\nreturn value is NULL.\n \nExample\n \nCREATE TABLE gis_multi_polygon (g MULTIPOLYGON);\nINSERT INTO gis_multi_polygon VALUES\n (MultiPolygonFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84\n42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67\n13,59 13,59 18)))\')),\n (MPolyFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28\n26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59\n13,59 18)))\')),\n (MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0,\n3), Point(3, 3), Point(3, 0), Point(0, 3)))))));\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/multipolygon/','','https://mariadb.com/kb/en/library/multipolygon/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (329,24,'POINT','Syntax\n------ \nPoint(x,y)\n \nDescription\n----------- \nConstructs a WKB Point using the given coordinates.\n \nExamples\n-------- \nSET @g = ST_GEOMFROMTEXT(\'Point(1 1)\');\n \nCREATE TABLE gis_point (g POINT);\nINSERT INTO gis_point VALUES\n (PointFromText(\'POINT(10 10)\')),\n (PointFromText(\'POINT(20 10)\')),\n (PointFromText(\'POINT(20 20)\')),\n (PointFromWKB(AsWKB(PointFromText(\'POINT(10 20)\'))));\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/point/','','https://mariadb.com/kb/en/library/point/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (330,24,'PointOnSurface','A synonym for ST_PointOnSurface.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/pointonsurface/','','https://mariadb.com/kb/en/library/pointonsurface/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (331,24,'POLYGON','Syntax\n------ \nPolygon(ls1,ls2,...)\n \nDescription\n----------- \nConstructs a WKB Polygon value from a number of WKB\nLineString\narguments. If any argument does not represent the WKB of a\nLinearRing (that is,\nnot a closed and simple LineString) the return value is\nNULL.\n \nNote that according to the OpenGIS standard, a POLYGON\nshould have exactly one ExteriorRing and all other rings\nshould lie within that ExteriorRing and thus be the\nInteriorRings. Practically, however, some systems, including\nMariaDB\'s, permit polygons to have several\n\'ExteriorRings\'. In the case of there being multiple,\nnon-overlapping exterior rings ST_NUMINTERIORRINGS() will\nreturn 1.\n \nExamples\n-------- \nSET @g = ST_GEOMFROMTEXT(\'POLYGON((1 1,1 5,4 9,6 9,9 3,7\n2,1 1))\');\n \nCREATE TABLE gis_polygon (g POLYGON);\nINSERT INTO gis_polygon VALUES\n (PolygonFromText(\'POLYGON((10 10,20 10,20 20,10 20,10\n10))\')),\n (PolyFromText(\'POLYGON((0 0,50 0,50 50,0 50,0 0), (10\n10,20 10,20 20,10 20,10 10))\')),\n (PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0),\nPoint(30, 0), Point(30, 30), Point(0, 0))))));\n \nNon-overlapping \'polygon\':\n \nSELECT ST_NumInteriorRings(ST_PolyFromText(\'POLYGON((0 0,10\n0,10 10,0 10,0 0),\n (-1 -1,-5 -1,-5 -5,-1 -5,-1 -1))\')) AS NumInteriorRings;\n \n+------------------+\n| NumInteriorRings |\n+------------------+\n| 1 |\n+------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/polygon/','','https://mariadb.com/kb/en/library/polygon/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (332,24,'ST_BUFFER','Syntax\n------ \nST_BUFFER(g1,r)\nBUFFER(g1,r)\n \nDescription\n----------- \nReturns a geometry that represents all points whose distance\nfrom geometry g1 is less than or equal to distance, or\nradius, r.\n \nUses for this function could include creating for example a\nnew geometry representing a buffer zone around an island.\n \nBUFFER() is a synonym.\n \nExamples\n-------- \nDetermining whether a point is within a buffer zone:\n \nSET @g1 = ST_GEOMFROMTEXT(\'POLYGON((10 10, 10 20, 20 20, 20\n10, 10 10))\');\n \nSET @g2 = ST_GEOMFROMTEXT(\'POINT(8 8)\');\n \nSELECT ST_WITHIN(@g2,ST_BUFFER(@g1,5));\n+---------------------------------+\n| ST_WITHIN(@g2,ST_BUFFER(@g1,5)) |\n+---------------------------------+\n| 1 |\n+---------------------------------+\n \nSELECT ST_WITHIN(@g2,ST_BUFFER(@g1,1));\n+---------------------------------+\n| ST_WITHIN(@g2,ST_BUFFER(@g1,1)) |\n+---------------------------------+\n| 0 |\n+---------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_buffer/','','https://mariadb.com/kb/en/library/st_buffer/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (333,24,'ST_CONVEXHULL','ST_ConvexHull() was introduced in MariaDB 10.1.2\n \nSyntax\n------ \nST_ConvexHull(g)\nConvexHull(g)\n \nDescription\n----------- \nGiven a geometry, returns a geometry that is the minimum\nconvex geometry enclosing all geometries within the set.\nReturns NULL if the geometry value is NULL or an empty\nvalue.\n \nST_ConvexHull() and ConvexHull() are synonyms.\n \nExamples\n-------- \nThe ConvexHull of a single point is simply the single point:\n \nSET @g = ST_GEOMFROMTEXT(\'Point(0 0)\');\n \nSELECT ST_ASTEXT(ST_CONVEXHULL(@g));\n+------------------------------+\n| ST_ASTEXT(ST_CONVEXHULL(@g)) |\n+------------------------------+\n| POINT(0 0) |\n+------------------------------+\n \nSET @g = ST_GEOMFROMTEXT(\'MultiPoint(0 0, 1 2, 2 3)\');\n \nSELECT ST_ASTEXT(ST_CONVEXHULL(@g));\n+------------------------------+\n| ST_ASTEXT(ST_CONVEXHULL(@g)) |\n+------------------------------+\n| POLYGON((0 0,1 2,2 3,0 0)) |\n+------------------------------+\n \nSET @g = ST_GEOMFROMTEXT(\'MultiPoint( 1 1, 2 2, 5 3, 7 2, 9\n3, 8 4, 6 6, 6 9, 4 9, 1 5 )\');\n \nSELECT ST_ASTEXT(ST_CONVEXHULL(@g));\n+----------------------------------------+\n| ST_ASTEXT(ST_CONVEXHULL(@g)) |\n+----------------------------------------+\n| POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1 1)) |\n+----------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_convexhull/','','https://mariadb.com/kb/en/library/st_convexhull/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (334,24,'ST_INTERSECTION','Syntax\n------ \nST_INTERSECTION(g1,g2)\n \nDescription\n----------- \nReturns a geometry that is the intersection, or shared\nportion, of geometry g1 and geometry g2.\n \nExamples\n-------- \nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 1)\');\n \nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 1, 0 2)\');\n \nSELECT ASTEXT(ST_INTERSECTION(@g1,@g2));\n+----------------------------------+\n| ASTEXT(ST_INTERSECTION(@g1,@g2)) |\n+----------------------------------+\n| POINT(2 1) |\n+----------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_intersection/','','https://mariadb.com/kb/en/library/st_intersection/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (335,24,'ST_POINTONSURFACE','ST_POINTONSURFACE() was introduced in MariaDB 10.1.2\n \nSyntax\n------ \nST_PointOnSurface(g)\nPointOnSurface(g)\n \nDescription\n----------- \nGiven a geometry, returns a POINT guaranteed to intersect a\nsurface. However, see MDEV-7514.\n \nST_PointOnSurface() and PointOnSurface() are synonyms.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_pointonsurface/','','https://mariadb.com/kb/en/library/st_pointonsurface/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (336,24,'ST_SYMDIFFERENCE','Syntax\n------ \nST_SYMDIFFERENCE(g1,g2)\n \nDescription\n----------- \nReturns a geometry that represents the portions of geometry\ng1 and geometry g2 that don\'t intersect.\n \nExamples\n-------- \nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(10 20, 10 40)\');\n \nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(10 15, 10 25)\');\n \nSELECT ASTEXT(ST_SYMDIFFERENCE(@g1,@g2));\n+----------------------------------------------+\n| ASTEXT(ST_SYMDIFFERENCE(@g1,@g2)) |\n+----------------------------------------------+\n| MULTILINESTRING((10 15,10 20),(10 25,10 40)) |\n+----------------------------------------------+\n \nSET @g2 = ST_GeomFromText(\'LINESTRING(10 20, 10 41)\');\n \nSELECT ASTEXT(ST_SYMDIFFERENCE(@g1,@g2));\n+-----------------------------------+\n| ASTEXT(ST_SYMDIFFERENCE(@g1,@g2)) |\n+-----------------------------------+\n| LINESTRING(10 40,10 41) |\n+-----------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_symdifference/','','https://mariadb.com/kb/en/library/st_symdifference/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (337,24,'ST_UNION','Syntax\n------ \nST_UNION(g1,g2)\n \nDescription\n----------- \nReturns a geometry that is the union of the geometry g1 and\ngeometry g2.\n \nExamples\n-------- \nSET @g1 = GEOMFROMTEXT(\'POINT (0 2)\');\n \nSET @g2 = GEOMFROMTEXT(\'POINT (2 0)\');\n \nSELECT ASTEXT(ST_UNION(@g1,@g2));\n+---------------------------+\n| ASTEXT(ST_UNION(@g1,@g2)) |\n+---------------------------+\n| MULTIPOINT(2 0,0 2) |\n+---------------------------+\n \nSET @g1 = GEOMFROMTEXT(\'POLYGON((0 0,0 3,3 3,3 0,0 0))\');\n \nSET @g2 = GEOMFROMTEXT(\'POLYGON((2 2,4 2,4 4,2 4,2 2))\');\n \nSELECT ASTEXT(ST_UNION(@g1,@g2));\n+------------------------------------------------+\n| ASTEXT(ST_UNION(@g1,@g2)) |\n+------------------------------------------------+\n| POLYGON((0 0,0 3,2 3,2 4,4 4,4 2,3 2,3 0,0 0)) |\n+------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_union/','','https://mariadb.com/kb/en/library/st_union/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (338,26,'BINLOG','Syntax\n------ \nBINLOG \'str\'\n \nDescription\n----------- \nBINLOG is an internal-use statement. It is generated by the\nmysqlbinlog program as the printable representation of\ncertain events\nin binary log files. The \'str\' value is a base 64-encoded\nstring the that server decodes to determine the data change\nindicated by the\ncorresponding event. This statement requires the SUPER\nprivilege. It was added in MySQL 5.1.5.\n \n\n\nURL: https://mariadb.com/kb/en/library/binlog/','','https://mariadb.com/kb/en/library/binlog/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (339,26,'CACHE INDEX','Syntax\n------ \nCACHE INDEX \n tbl_index_list [, tbl_index_list] ...\n IN key_cache_name \n \ntbl_index_list:\n tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]\n \nDescription\n----------- \nThe CACHE INDEX statement assigns table indexes to a\nspecific key\ncache. It is used only for MyISAM tables.\n \nA default key cache exists and cannot be destroyed. To\ncreate more key caches, the key_buffer_size server system\nvariable.\n \nThe associations between tables indexes and key caches are\nlost on server restart. To recreate them automatically, it\nis necessary to configure caches in a configuration file and\ninclude some CACHE INDEX (and optionally LOAD INDEX)\nstatements in the init file.\n \nExamples\n-------- \nThe following statement assigns indexes from the tables t1,\nt2, and t3\nto the key cache named hot_cache:\n \nCACHE INDEX t1, t2, t3 IN hot_cache;\n+---------+--------------------+----------+----------+\n| Table | Op | Msg_type | Msg_text |\n+---------+--------------------+----------+----------+\n| test.t1 | assign_to_keycache | status | OK |\n| test.t2 | assign_to_keycache | status | OK |\n| test.t3 | assign_to_keycache | status | OK |\n+---------+--------------------+----------+----------+\n \nImplementation (for MyISAM)\n \nNormally CACHE INDEX should not take a long time to execute.\nInternally it\'s implemented the following way:\nFind the right key cache (under\nLOCK_global_system_variables)\nOpen the table with a TL_READ_NO_INSERT lock.\nFlush the original key cache for the given file (under key\ncache lock)\nFlush the new key cache for the given file (safety)\nMove the file to the new key cache (under file share lock)\n \nThe only possible long operations are getting the locks for\nthe table and flushing the original key cache, if there were\nmany key blocks for the file in it.\n \nWe plan to also add CACHE INDEX for Aria tables if there is\na need for this.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/cache-index/','','https://mariadb.com/kb/en/library/cache-index/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (340,26,'FLUSH','Syntax\n------ \nFLUSH [NO_WRITE_TO_BINLOG | LOCAL]\n flush_option [, flush_option] ...\n \nor when flushing tables:\n \nFLUSH [NO_WRITE_TO_BINLOG | LOCAL] TABLES [table_list]\n[table_flush_option]\n \nwhere table_list is a list of tables separated by , (comma).\n \nDescription\n----------- \nThe FLUSH statement clears or reloads various internal\ncaches used by\nMariaDB. To execute FLUSH, you must have the RELOAD\nprivilege. See GRANT.\n \nThe RESET statement is similar to FLUSH. See\nRESET.\n \nYou cannot issue a FLUSH statement from within a stored\nfunction or a trigger. Doing so within a stored procedure is\npermitted, as long as it is not called by a stored function\nor trigger. See Stored Routine Limitations, Stored Function\nLimitations and Trigger Limitations.\n \nIf a listed table is a view, an error like the following\nwill be produced:\n \nERROR 1347 (HY000): \'test.v\' is not BASE TABLE\n \nBy default, FLUSH statements are written to the binary log\nand will be replicated. The NO_WRITE_TO_BINLOG keyword\n(LOCAL is an alias) will ensure the statement is not written\nto the binary log. \n \nThe different flush options are:\n \nOption | Description | \n \nCHANGED_PAGE_BITMAPS | Internal command used for backup\npurposes. See the Information Schema CHANGED_PAGE_BITMAPS\nTable. | \n \nCLIENT_STATISTICS | Reset client statistics (see SHOW\nCLIENT_STATISTICS). | \n \nDES_KEY_FILE | Reloads the DES key file (Specified with the\n--des-key-file startup option). | \n \nHOSTS | Flush the hostname cache (used for converting ip to\nhost names and for unblocking blocked hosts. See\nmax_connect_errors) | \n \nINDEX_STATISTICS | Reset index statistics (see SHOW\nINDEX_STATISTICS). | \n \n[ERROR | ENGINE | GENERAL | SLOW | BINARY | RELAY] LOGS |\nClose and reopen the specified log type, or all log types if\nnone are specified. FLUSH RELAY LOGS [connection-name] can\nbe used to flush the relay logs for a specific connection.\nOnly one connection can be specified per FLUSH command. See\nMulti-source replication. FLUSH ENGINE LOGS will delete all\nunneeded Aria redo logs. | \n \nMASTER | Deprecated option, use RESET MASTER instead. | \n \nPRIVILEGES | Reload all privileges from the privilege tables\nin the mysql database. If the server is started with\n--skip-grant-table option, this will activate the privilege\ntables again. | \n \nQUERY CACHE | Defragment the query cache to better utilize\nits memory. If you want to reset the query cache, you can do\nit with RESET QUERY CACHE. | \n \nQUERY_RESPONSE_TIME | See the QUERY_RESPONSE_TIME plugin. | \n \nSLAVE | Deprecated option, use RESET SLAVE instead. | \n \nSSL | Used to dynamically reinitialize the server\'s TLS\ncontext by reloading the files defined by several TLS system\nvariables. See FLUSH SSL for more information. This command\nwas first added in MariaDB 10.4.1. | \n \nSTATUS | Resets all server status variables that can be\nreset to 0. Not all global status variables support this, so\nnot all global values are reset. See FLUSH STATUS for more\ninformation. | \n \nTABLE | Close tables given as options or all open tables if\nno table list was used. From MariaDB 10.4.1, using without\nany table list will only close tables not in use, and tables\nnot locked by the FLUSH TABLES connection. If there are no\nlocked tables, FLUSH TABLES will be instant and will not\ncause any waits, as it no longer waits for tables in use.\nWhen a table list is provided, from MariaDB 10.4.1, the\nserver will wait for the end of any transactions that are\nusing the tables. Previously, FLUSH TABLES only waited for\nthe statements to complete. | \n \nTABLES | Same as FLUSH TABLE. | \n \nTABLES ... FOR EXPORT | For InnoDB tables, flushes table\nchanges to disk to permit binary table copies while the\nserver is running. Introduced in MariaDB 10.0.8. See FLUSH\nTABLES ... FOR EXPORT for more. | \n \nTABLES WITH READ LOCK | Closes all open tables. New tables\nare only allowed to be opened with read locks until an\nUNLOCK TABLES is given. | \n \nTABLES WITH READ LOCK AND DISABLE CHECKPOINT | As TABLES\nWITH READ LOCK but also disable all checkpoint writes by\ntransactional table engines. This is useful when doing a\ndisk snapshot of all tables. | \n \nTABLE_STATISTICS | Reset table statistics (see SHOW\nTABLE_STATISTICS). | \n \nUSER_RESOURCES | Resets all per hour user resources. This\nenables clients that have exhausted their resources to\nconnect again. | \n \nUSER_STATISTICS | Reset user statistics (see SHOW\nUSER_STATISTICS). | \n \nYou can also use the mysqladmin client to flush things. Use\nmysqladmin --help to examine what flush commands it\nsupports.\n \nFLUSH STATUS\n \nServer status variables can be reset by executing the\nfollowing:\n \nFLUSH STATUS;\n \nGlobal Status Variables that Support FLUSH STATUS\n \nNot all global status variables support being reset by FLUSH\nSTATUS. Currently, the following status variables are reset\nby FLUSH STATUS:\nAborted_clients\nAborted_connects\nAria_pagecache_blocks_not_flushed\nAria_pagecache_blocks_unused\nAria_pagecache_blocks_used\nBinlog_cache_disk_use\nBinlog_cache_use\nBinlog_stmt_cache_disk_use\nBinlog_stmt_cache_use\nConnection_errors_accept\nConnection_errors_internal\nConnection_errors_max_connections\nConnection_errors_peer_address\nConnection_errors_select\nConnection_errors_tcpwrap\nCreated_tmp_files\nDelayed_errors\nDelayed_writes\nFeature_check_constraint\nFeature_delay_key_write\nMax_used_connections\nOpened_plugin_libraries\nPerformance_schema_accounts_lost\nPerformance_schema_cond_instances_lost\nPerformance_schema_digest_lost\nPerformance_schema_file_handles_lost\nPerformance_schema_file_instances_lost\nPerformance_schema_hosts_lost\nPerformance_schema_locker_lost\nPerformance_schema_mutex_instances_lost\nPerformance_schema_rwlock_instances_lost\nPerformance_schema_session_connect_attrs_lost\nPerformance_schema_socket_instances_lost\nPerformance_schema_stage_classes_lost\nPerformance_schema_statement_classes_lost\nPerformance_schema_table_handles_lost\nPerformance_schema_table_instances_lost\nPerformance_schema_thread_instances_lost\nPerformance_schema_users_lost\nQcache_hits\nQcache_inserts\nQcache_lowmem_prunes\nQcache_not_cached\nRpl_semi_sync_master_no_times\nRpl_semi_sync_master_no_tx\nRpl_semi_sync_master_timefunc_failures\nRpl_semi_sync_master_wait_pos_backtraverse\nRpl_semi_sync_master_yes_tx\nRpl_transactions_multi_engine\nServer_audit_writes_failed\nSlave_retried_transactions\nSlow_launch_threads\nSsl_accept_renegotiates\nSsl_accepts\nSsl_callback_cache_hits\nSsl_client_connects\nSsl_connect_renegotiates\nSsl_ctx_verify_depth\nSsl_ctx_verify_mode\nSsl_finished_accepts\nSsl_finished_connects\nSsl_session_cache_hits\nSsl_session_cache_misses\nSsl_session_cache_overflows\nSsl_session_cache_size\nSsl_session_cache_timeouts\nSsl_sessions_reused\nSsl_used_session_cache_entries\nSubquery_cache_hit\nSubquery_cache_miss\nTable_locks_immediate\nTable_locks_waited\nTc_log_max_pages_used\nTc_log_page_waits\nTransactions_gtid_foreign_engine\nTransactions_multi_engine\n \nFLUSH SSL\n \nThe FLUSH SSL command was first added in MariaDB 10.4.\n \nIn MariaDB 10.4 and later, the FLUSH SSL command can be used\nto dynamically reinitialize the server\'s TLS context. This\nis most useful if you need to replace a certificate that is\nabout to expire without restarting the server.\n \nThis operation is performed by reloading the files defined\nby the following TLS system variables:\nssl_cert\nssl_key\nssl_ca\nssl_capath\nssl_crl\nssl_crlpath\n \nThese TLS system variables are not dynamic, so their values\ncan not be changed without restarting the server.\n \nIf you want to dynamically reinitialize the server\'s TLS\ncontext, then you need to change the certificate and key\nfiles at the relevant paths defined by these TLS system\nvariables, without actually changing the values of the\nvariables. See MDEV-19341 for more information.\n \nReducing Memory Usage\n \nTo flush some of the global caches that take up memory, you\ncould execute the following command:\n \nFLUSH LOCAL HOSTS,\n QUERY CACHE, \n TABLE_STATISTICS, \n INDEX_STATISTICS, \n USER_STATISTICS;\n \n\n \n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/flush/','','https://mariadb.com/kb/en/library/flush/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (341,26,'FLUSH QUERY CACHE','Description\n----------- \nYou can defragment the query cache to better utilize its\nmemory with\nthe FLUSH QUERY CACHE statement. The statement does not\nremove any queries from the cache.\n \nThe RESET QUERY CACHE statement removes all query results\nfrom the query cache.\nThe FLUSH TABLES statement also does this.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/flush-query-cache/','','https://mariadb.com/kb/en/library/flush-query-cache/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (342,26,'FLUSH TABLES FOR EXPORT','FLUSH TABLES ... FOR EXPORT was introduced in MariaDB\n10.0.8.\n \nSyntax\n------ \nFLUSH TABLES table_name [, table_name] FOR EXPORT\n \nDescription\n----------- \nFLUSH TABLES ... FOR EXPORT flushes changes to the specified\ntables to disk so that binary copies can be made while the\nserver is still running. This works for Archive, Aria, CSV,\nInnoDB, MyISAM, MERGE, and XtraDB tables.\n \nThe table is read locked until one has issued UNLOCK TABLES.\n \nIf a storage engine does not support FLUSH TABLES FOR\nEXPORT, a 1031 error (SQLSTATE \'HY000\') is produced.\n \nIf FLUSH TABLES ... FOR EXPORT is in effect in the session,\nthe following statements will produce an error if attempted:\nFLUSH TABLES WITH READ LOCK\nFLUSH TABLES ... WITH READ LOCK\nFLUSH TABLES ... FOR EXPORT\nAny statement trying to update any table\n \nIf any of the following statements is in effect in the\nsession, attempting FLUSH TABLES ... FOR EXPORT will\nproduce an error.\nFLUSH TABLES ... WITH READ LOCK\nFLUSH TABLES ... FOR EXPORT\nLOCK TABLES ... READ\nLOCK TABLES ... WRITE\n \nFLUSH FOR EXPORT is not written to the binary log.\n \nThis statement requires the RELOAD and the LOCK TABLES\nprivileges.\n \nIf one of the specified tables cannot be locked, none of the\ntables will be locked.\n \nIf a table does not exist, an error like the following will\nbe produced:\n \nERROR 1146 (42S02): Table \'test.xxx\' doesn\'t exist\n \nIf a table is a view, an error like the following will be\nproduced:\n \nERROR 1347 (HY000): \'test.v\' is not BASE TABLE\n \nExample\n \nFLUSH TABLES test.t1 FOR EXPORT;\n# Copy files related to the table (see below)\nUNLOCK TABLES;\n \nFor a full description, please see copying MariaDB tables.\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/flush-tables-for-export/','','https://mariadb.com/kb/en/library/flush-tables-for-export/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (343,26,'HELP Command','Syntax\n------ \nHELP search_string\n \nDescription\n----------- \nThe HELP command can be used in any MariaDB client, such as\nthe mysql command-line client, to get basic syntax help and\na short description for most commands and functions. \n \nIf you provide an argument to the HELP command, the mysql\nclient uses it as a search string to access server-side\nhelp. The proper operation of this command requires that the\nhelp tables in the mysql database be initialized with help\ntopic information.\n \nIf there is no match for the search string, the search\nfails. Use help contents to see a list of the help\ncategories:\n \nHELP contents\nYou asked for help about help category: \"Contents\"\nFor more information, type \'help \', where is one of the\nfollowing\ncategories:\n \n Account Management\n Administration\n Compound Statements\n Data Definition\n Data Manipulation\n Data Types\n Functions\n Functions and Modifiers for Use with GROUP BY\n Geographic Features\n Language Structure\n Plugins\n Table Maintenance\n Transactions\n User-Defined Functions\n Utility\n \nIf a search string matches multiple items, MariaDB shows a\nlist of matching topics:\n \nHELP create\nMany help items for your request exist.\nTo make a more specific request, please type \'help \',\nwhere is one of the following\ntopics:\n CREATE DATABASE\n CREATE EVENT\n CREATE FUNCTION\n CREATE FUNCTION UDF\n CREATE INDEX\n CREATE PROCEDURE\n CREATE SERVER\n CREATE TABLE\n CREATE TABLESPACE\n CREATE TRIGGER\n CREATE USER\n CREATE VIEW\n SHOW\n SHOW CREATE DATABASE\n SHOW CREATE EVENT\n SHOW CREATE FUNCTION\n SHOW CREATE PROCEDURE\n SHOW CREATE TABLE\n SPATIAL\n \nThen you can enter a topic as the search string to see the\nhelp entry for that topic.\n \nThe help is provided with the MariaDB server and makes use\nof four help tables found in the mysql database:\nhelp_relation, help_topic, help_category and help_keyword.\nThese tables are populated by the mysql_install_db or\nfill_help_table.sql scripts which currently contain data\ngenerated from an old version of MySQL.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/help-command/','','https://mariadb.com/kb/en/library/help-command/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (344,26,'KILL [CONNECTION | QUERY]','Syntax\n------ \nKILL [HARD | SOFT] [CONNECTION | QUERY [ID] ] [thread_id |\nUSER user_name | query_id]\n \nMariaDB 5.3.2\n \nThe options HARD | SOFT and USER username were introduced in\nMariaDB 5.3.2\n \nMariaDB 10.0.5\n \nKILL QUERY ID query_id, which permits killing a query by\nquery id rather than thread id, was introduced in MariaDB\n10.0.5.\n \nDescription\n----------- \nEach connection to mysqld runs in a separate thread. You can\nsee which threads\nare running with the SHOW PROCESSLIST statement and kill a\nthread with the KILL thread_id statement. \nKILL allows the optional CONNECTION or\nQUERY modifier:\nKILL CONNECTION is the same as KILL with no\n modifier: It terminates the connection associated with the\ngiven thread or query id.\nKILL QUERY terminates the statement that the connection\nthread_id is\n currently executing, but leaves the connection itself\nintact.\nKILL QUERY ID (introduced in MariaDB 10.0.5) terminates the\nquery by query_id, leaving the connection intact.\n \nIf a connection is terminated that has an active\ntransaction, the transaction will be rolled back. If only a\nquery is killed, the current transaction will stay active.\nSee also idle_transaction_timeout.\n \nIf you have the PROCESS privilege, you can see all threads.\nIf\nyou have the SUPER privilege, you can kill all threads and\nstatements. Otherwise, you can see and kill only your own\nthreads and\nstatements.\n \nKilling queries that repair or create indexes on MyISAM and\nAria tables may result in corrupted tables. Use the SOFT\noption to avoid this!\n \nThe HARD option (default) kills a command as soon as\npossible. If you use\nSOFT, then critical operations that may leave a table in an\ninconsistent state will not be interrupted. Such operations\ninclude REPAIR and INDEX creation for MyISAM and Aria tables\n(REPAIR TABLE, OPTIMIZE TABLE).\n \nKILL ... USER username will kill all connections/queries for\na\ngiven user. USER can be specified one of the following ways:\nusername (Kill without regard to hostname)\nusername@hostname\nCURRENT_USER or CURRENT_USER()\n \nIf you specify a thread id and that thread does not exist,\nyou get the following error:\n \nERROR 1094 (HY000): Unknown thread id: \n \nIf you specify a query id that doesn\'t exist, you get the\nfollowing error:\n \nERROR 1957 (HY000): Unknown query id: \n \nHowever, if you specify a user name, no error is issued for\nnon-connected (or even non-existing) users. To check if the\nconnection/query has been killed, you can use the\nROW_COUNT() function.\n \nA client whose connection is killed receives the following\nerror:\n \nERROR 1317 (70100): Query execution was interrupted\n \nTo obtain a list of existing sessions, use the SHOW\nPROCESSLIST statement or query the Information Schema\nPROCESSLIST table.\n \nNote: You cannot use KILL with the Embedded MySQL Server\nlibrary because the embedded server merely runs inside the\nthreads of the host\napplication. It does not create any connection threads of\nits own.\n \nNote: You can also use \nmysqladmin kill thread_id [,thread_id...]\nto kill connections. To get a list of running queries,\nuse mysqladmin processlist. See mysqladmin.\n \nPercona Toolkit contains a program, pt-kill that can be used\nto automatically kill connections that match certain\ncriteria. For example, it can be used to terminate idle\nconnections, or connections that have been busy for more\nthan 60 seconds.\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/data-manipulation-kill-connection-query/','','https://mariadb.com/kb/en/library/data-manipulation-kill-connection-query/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (345,26,'LOAD INDEX','Syntax\n------ \nLOAD INDEX INTO CACHE\n tbl_index_list [, tbl_index_list] ...\n \ntbl_index_list:\n tbl_name\n [[INDEX|KEY] (index_name[, index_name] ...)]\n [IGNORE LEAVES]\n \nDescription\n----------- \nThe LOAD INDEX INTO CACHE statement preloads a table index\ninto the key\ncache to which it has been assigned by an explicit CACHE\nINDEX\nstatement, or into the default key cache otherwise. \nLOAD INDEX INTO CACHE is used only for MyISAM or Aria\ntables. Until MariaDB 5.3, it was not supported for tables\nhaving user-defined partitioning, but this limitation was\nremoved in MariaDB 5.5.\n \nThe IGNORE LEAVES modifier causes only blocks for the\nnonleaf nodes of\nthe index to be preloaded.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/load-index/','','https://mariadb.com/kb/en/library/load-index/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (346,26,'RESET','Syntax\n------ \nRESET reset_option [, reset_option] ...\n \nDescription\n----------- \nThe RESET statement is used to clear the state of various\nserver\noperations. You must have the RELOAD privilege to execute\nRESET.\n \nRESET acts as a stronger version of the FLUSH statement.\n \nThe different RESET options are:\n \nOption | Description | \n \nSLAVE [\"connection_name\"] [ALL] | Deletes all relay logs\nfrom the slave and reset the replication position in the\nmaster binary log. | \n \nMASTER | Deletes all old binary logs, makes the binary index\nfile (--log-bin-index) empty and creates a new binary log\nfile. This is useful when you want to reset the master to an\ninitial state. If you want to just delete old, not used\nbinary logs, you should use the PURGE BINARY LOGS command. |\n\n \nQUERY CACHE | Removes all queries from the query cache. See\nalso FLUSH QUERY CACHE. | \n \n\n \n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/reset/','','https://mariadb.com/kb/en/library/reset/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (347,26,'SET','Syntax\n------ \nSET variable_assignment [, variable_assignment] ...\n \nvariable_assignment:\n user_var_name = expr\n | [GLOBAL | SESSION] system_var_name = expr\n | [@@global. | @@session. | @@]system_var_name = expr\n \nOne can also set a user variable in any expression with this\nsyntax:\n \nuser_var_name:= expr\n \nDescription\n----------- \nThe SET statement assigns values to different types of\nvariables that affect the operation of the server or your\nclient. Older\nversions of MySQL employed SET OPTION, but this syntax was\ndeprecated in favor of SET without OPTION, and was removed\nin MariaDB 10.0.\n \nChanging a system variable by using the SET statement does\nnot make the change permanently. To do so, the change must\nbe made in a configuration file.\n \nFor setting variables on a per-query basis (from MariaDB\n10.1.2), see SET STATEMENT.\n \nSee SHOW VARIABLES for documentation on viewing server\nsystem variables.\n \nSee Server System Variables for a list of all the system\nvariables.\n \nGLOBAL / SESSION\n \nWhen setting a system variable, the scope can be specified\nas either GLOBAL or SESSION.\n \nA global variable change affects all new sessions. It does\nnot affect any currently open sessions, including the one\nthat made the change. \n \nA session variable change affects the current session only.\n \nIf the variable has a session value, not specifying either\nGLOBAL or SESSION will be the same as specifying SESSION. If\nthe variable only has a global value, not specifying GLOBAL\nor SESSION will apply to the change to the global value.\n \nDEFAULT\n \nSetting a global variable to DEFAULT will restore it to the\nserver default, and setting a session variable to DEFAULT\nwill restore it to the current global value.\n \nExamples\n-------- \ninnodb_sync_spin_loops is a global variable.\nskip_parallel_replication is a session variable.\nmax_error_count is both global and session.\n \nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE \n VARIABLE_NAME LIKE \'max_error_count\' OR \n VARIABLE_NAME LIKE \'skip_parallel_replication\' OR \n VARIABLE_NAME LIKE \'innodb_sync_spin_loops\';\n \n+---------------------------+---------------+--------------+\n| VARIABLE_NAME | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT | 64 | 64 |\n| SKIP_PARALLEL_REPLICATION | OFF | NULL |\n| INNODB_SYNC_SPIN_LOOPS | NULL | 30 |\n+---------------------------+---------------+--------------+\n \nSetting the session values:\n \nSET max_error_count=128;\nQuery OK, 0 rows affected (0.000 sec)\n \nSET skip_parallel_replication=ON;\nQuery OK, 0 rows affected (0.000 sec)\n \nSET innodb_sync_spin_loops=60;\n \nERROR 1229 (HY000): Variable \'innodb_sync_spin_loops\' is a\nGLOBAL variable \n and should be set with SET GLOBAL\n \nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE \n VARIABLE_NAME LIKE \'max_error_count\' OR \n VARIABLE_NAME LIKE \'skip_parallel_replication\' OR \n VARIABLE_NAME LIKE \'innodb_sync_spin_loops\';\n \n+---------------------------+---------------+--------------+\n| VARIABLE_NAME | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT | 128 | 64 |\n| SKIP_PARALLEL_REPLICATION | ON | NULL |\n| INNODB_SYNC_SPIN_LOOPS | NULL | 30 |\n+---------------------------+---------------+--------------+\n \nSetting the global values:\n \nSET GLOBAL max_error_count=256;\n \nSET GLOBAL skip_parallel_replication=ON;\n \nERROR 1228 (HY000): Variable \'skip_parallel_replication\'\nis a SESSION variable \n and can\'t be used with SET GLOBAL\n \nSET GLOBAL innodb_sync_spin_loops=120;\n \nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE \n VARIABLE_NAME LIKE \'max_error_count\' OR \n VARIABLE_NAME LIKE \'skip_parallel_replication\' OR \n VARIABLE_NAME LIKE \'innodb_sync_spin_loops\';\n \n+---------------------------+---------------+--------------+\n| VARIABLE_NAME | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT | 128 | 256 |\n| SKIP_PARALLEL_REPLICATION | ON | NULL |\n| INNODB_SYNC_SPIN_LOOPS | NULL | 120 |\n+---------------------------+---------------+--------------+\n \nSHOW VARIABLES will by default return the session value\nunless the variable is global only.\n \nSHOW VARIABLES LIKE \'max_error_count\';\n \n+-----------------+-------+\n| Variable_name | Value |\n+-----------------+-------+\n| max_error_count | 128 |\n+-----------------+-------+\n \nSHOW VARIABLES LIKE \'skip_parallel_replication\';\n \n+---------------------------+-------+\n| Variable_name | Value |\n+---------------------------+-------+\n| skip_parallel_replication | ON |\n+---------------------------+-------+\n \nSHOW VARIABLES LIKE \'innodb_sync_spin_loops\';\n \n+------------------------+-------+\n| Variable_name | Value |\n+------------------------+-------+\n| innodb_sync_spin_loops | 120 |\n+------------------------+-------+\n \nUsing the inplace syntax:\n \nSELECT (@a:=1);\n+---------+\n| (@a:=1) |\n+---------+\n| 1 |\n+---------+\n \nSELECT @a;\n \n+------+\n| @a |\n+------+\n| 1 |\n+------+\n \n\n\nURL: https://mariadb.com/kb/en/library/set/','','https://mariadb.com/kb/en/library/set/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (348,26,'About SHOW','SHOW has many forms that provide information about\ndatabases, tables, columns, or status information about the\nserver. These include:\nSHOW AUTHORS\nSHOW CHARACTER SET [like_or_where]\nSHOW COLLATION [like_or_where]\nSHOW [FULL] COLUMNS FROM tbl_name [FROM db_name]\n[like_or_where]\nSHOW CONTRIBUTORS\nSHOW CREATE DATABASE db_name\nSHOW CREATE EVENT event_name\nSHOW CREATE PACKAGE package_name\nSHOW CREATE PACKAGE BODY package_name\nSHOW CREATE PROCEDURE proc_name\nSHOW CREATE TABLE tbl_name\nSHOW CREATE TRIGGER trigger_name\nSHOW CREATE VIEW view_name\nSHOW DATABASES [like_or_where]\nSHOW ENGINE engine_name {STATUS | MUTEX}\nSHOW [STORAGE] ENGINES\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW [FULL] EVENTS\nSHOW FUNCTION CODE func_name\nSHOW FUNCTION STATUS [like_or_where]\nSHOW GRANTS FOR user\nSHOW INDEX FROM tbl_name [FROM db_name]\nSHOW INNODB STATUS\nSHOW OPEN TABLES [FROM db_name] [like_or_where]\nSHOW PLUGINS\nSHOW PROCEDURE CODE proc_name\nSHOW PROCEDURE STATUS [like_or_where]\nSHOW PRIVILEGES\nSHOW [FULL] PROCESSLIST\nSHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]\nSHOW PROFILES\nSHOW [GLOBAL | SESSION] STATUS [like_or_where]\nSHOW TABLE STATUS [FROM db_name] [like_or_where]\nSHOW TABLES [FROM db_name] [like_or_where]\nSHOW TRIGGERS [FROM db_name] [like_or_where]\nSHOW [GLOBAL | SESSION] VARIABLES [like_or_where]\nSHOW WARNINGS [LIMIT [offset,] row_count]\n \nlike_or_where:\n LIKE \'pattern\'\n | WHERE expr\n \nIf the syntax for a given SHOW statement includes a\nLIKE \'pattern\' part, \'pattern\' is a\nstring that can contain the SQL \"%\" and\n\"_\" wildcard characters. The pattern is useful for\nrestricting statement output to matching values.\n \nSeveral SHOW statements also accept a\nWHERE clause that provides more flexibility in specifying\nwhich rows to display. See Extended Show.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/about-show/','','https://mariadb.com/kb/en/library/about-show/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (349,26,'SHOW AUTHORS','Syntax\n------ \nSHOW AUTHORS\n \nDescription\n----------- \nThe SHOW AUTHORS statement displays information about the\npeople who work on MariaDB. For each author, it displays\nName, Location, and\nComment values. All columns are encoded as latin1.\n \nIn MariaDB 5.5 this is in somewhat random order.\n \nIn MariaDB 10.0.5 and later you have:\nFirst the active people in MariaDB are listed.\nThen the active people in MySQL.\nLast the people that has contributed to MariaDB/MySQL in the\npast.\n \nThe order is somewhat related to importance of the\ncontribution given to the MariaDB project, but this is not\n100% accurate. There is still room for improvements and\ndebate...\n \nExample\n \nSHOW AUTHORS;\n+--------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+\n| Name | Location | Comment |\n+--------------------------------+---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+\n| Michael (Monty) Widenius | Tusby, Finland | Lead developer\nand main author |\n| Sergei Golubchik | Kerpen, Germany | Architect, Full-text\nsearch, precision math, plugin framework, merges etc |\n| Igor Babaev | Bellevue, USA | Optimizer, keycache, core\nwork |\n| Sergey Petrunia | St. Petersburg, Russia | Optimizer |\n| Oleksandr Byelkin | Lugansk, Ukraine | Query Cache (4.0),\nSubqueries (4.1), Views (5.0) |\n| Timour Katchaounov | Sofia , Bulgaria | Optimizer |\n| Kristian Nielsen | Copenhagen, Denmark | Replication,\nAsync client prototocol, General buildbot stuff |\n| Alexander (Bar) Barkov | Izhevsk, Russia | Unicode and\ncharacter sets |\n| Alexey Botchkov (Holyfoot) | Izhevsk, Russia | GIS\nextensions, embedded server, precision math |\n| Daniel Bartholomew | Raleigh, USA | MariaDB documentation\n|\n| Colin Charles | Selangor, Malesia | MariaDB documentation,\ntalks at a LOT of conferences |\n| Sergey Vojtovich | Izhevsk, Russia | initial\nimplementation of plugin architecture, maintained native\nstorage engines (MyISAM, MEMORY, ARCHIVE, etc), rewrite of\ntable cache |\n| Vladislav Vaintroub | Mannheim, Germany | MariaDB Java\nconnector, new thread pool, Windows optimizations |\n| Elena Stepanova | Sankt Petersburg, Russia | QA, test\ncases |\n| Georg Richter | Heidelberg, Germany | New LGPL C\nconnector, PHP connector |\n| Jan Lindström | Ylämylly, Finland | Working on InnoDB |\n| Lixun Peng | Hangzhou, China | Multi Source replication |\n| Percona | CA, USA | XtraDB, microslow patches, extensions\nto slow log \n...\n \nSee Also\n \nSHOW CONTRIBUTORS. This list all members and sponsors of the\nMariaDB Foundation and other sponsors.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-authors/','','https://mariadb.com/kb/en/library/show-authors/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (350,26,'SHOW BINARY LOGS','Syntax\n------ \nSHOW BINARY LOGS\nSHOW MASTER LOGS\n \nDescription\n----------- \nLists the binary log files on the server. This statement is\nused as part of the\nprocedure described in \nPURGE BINARY LOGS, that shows how to\ndetermine which logs can be purged.\n \nExamples\n-------- \nSHOW BINARY LOGS;\n+--------------------+-----------+\n| Log_name | File_size |\n+--------------------+-----------+\n| mariadb-bin.000001 | 19039 |\n| mariadb-bin.000002 | 717389 |\n| mariadb-bin.000003 | 300 |\n| mariadb-bin.000004 | 333 |\n| mariadb-bin.000005 | 899 |\n| mariadb-bin.000006 | 125 |\n| mariadb-bin.000007 | 18907 |\n| mariadb-bin.000008 | 19530 |\n| mariadb-bin.000009 | 151 |\n| mariadb-bin.000010 | 151 |\n| mariadb-bin.000011 | 125 |\n| mariadb-bin.000012 | 151 |\n| mariadb-bin.000013 | 151 |\n| mariadb-bin.000014 | 125 |\n| mariadb-bin.000015 | 151 |\n| mariadb-bin.000016 | 314 |\n+--------------------+-----------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-binary-logs/','','https://mariadb.com/kb/en/library/show-binary-logs/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (351,26,'SHOW BINLOG EVENTS','Syntax\n------ \nSHOW BINLOG EVENTS\n [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\n \nDescription\n----------- \nShows the events in the binary log. If you do not specify\n\'log_name\',\nthe first binary log is displayed.\n \nExample\n \nSHOW BINLOG EVENTS IN \'mysql_sandbox10019-bin.000002\';\n+-------------------------------+-----+-------------------+-----------+-------------+------------------------------------------------+\n| Log_name | Pos | Event_type | Server_id | End_log_pos |\nInfo |\n+-------------------------------+-----+-------------------+-----------+-------------+------------------------------------------------+\n| mysql_sandbox10019-bin.000002 | 4 | Format_desc | 1 | 248\n| Server ver: 10.0.19-MariaDB-log, Binlog ver: 4 |\n| mysql_sandbox10019-bin.000002 | 248 | Gtid_list | 1 | 273\n| [] |\n| mysql_sandbox10019-bin.000002 | 273 | Binlog_checkpoint |\n1 | 325 | mysql_sandbox10019-bin.000002 |\n| mysql_sandbox10019-bin.000002 | 325 | Gtid | 1 | 363 |\nGTID 0-1-1 |\n| mysql_sandbox10019-bin.000002 | 363 | Query | 1 | 446 |\nCREATE DATABASE blog |\n| mysql_sandbox10019-bin.000002 | 446 | Gtid | 1 | 484 |\nGTID 0-1-2 |\n| mysql_sandbox10019-bin.000002 | 484 | Query | 1 | 571 |\nuse `blog`; CREATE TABLE bb (id INT) |\n+-------------------------------+-----+-------------------+-----------+-------------+------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-binlog-events/','','https://mariadb.com/kb/en/library/show-binlog-events/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (352,26,'SHOW CHARACTER SET','Syntax\n------ \nSHOW CHARACTER SET\n [LIKE \'pattern\' | WHERE expr]\n \nDescription\n----------- \nThe SHOW CHARACTER SET statement shows all available\ncharacter sets. The LIKE clause, if present on its own,\nindicates which character\nset names to match. The WHERE and LIKE clauses can be given\nto select rows using more general conditions, as discussed\nin Extended SHOW.\n \nThe same information can be queried from the\ninformation_schema.CHARACTER_SETS table.\n \nSee Setting Character Sets and Collations for details on\nspecifying the character set at the server, database, table\nand column levels.\n \nExamples\n-------- \nSHOW CHARACTER SET LIKE \'latin%\';\n+---------+-----------------------------+-------------------+--------+\n| Charset | Description | Default collation | Maxlen |\n+---------+-----------------------------+-------------------+--------+\n| latin1 | cp1252 West European | latin1_swedish_ci | 1 |\n| latin2 | ISO 8859-2 Central European | latin2_general_ci |\n1 |\n| latin5 | ISO 8859-9 Turkish | latin5_turkish_ci | 1 |\n| latin7 | ISO 8859-13 Baltic | latin7_general_ci | 1 |\n+---------+-----------------------------+-------------------+--------+\n \nSHOW CHARACTER SET WHERE Maxlen LIKE \'2\';\n+---------+---------------------------+-------------------+--------+\n| Charset | Description | Default collation | Maxlen |\n+---------+---------------------------+-------------------+--------+\n| big5 | Big5 Traditional Chinese | big5_chinese_ci | 2 |\n| sjis | Shift-JIS Japanese | sjis_japanese_ci | 2 |\n| euckr | EUC-KR Korean | euckr_korean_ci | 2 |\n| gb2312 | GB2312 Simplified Chinese | gb2312_chinese_ci | 2\n|\n| gbk | GBK Simplified Chinese | gbk_chinese_ci | 2 |\n| ucs2 | UCS-2 Unicode | ucs2_general_ci | 2 |\n| cp932 | SJIS for Windows Japanese | cp932_japanese_ci | 2\n|\n+---------+---------------------------+-------------------+--------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-character-set/','','https://mariadb.com/kb/en/library/show-character-set/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (353,26,'SHOW CLIENT_STATISTICS','MariaDB 5.2 introduced the User Statistics feature.\n \nSyntax\n------ \nSHOW CLIENT_STATISTICS\n \nDescription\n----------- \nThe SHOW CLIENT_STATISTICS statement was introduced in\nMariaDB 5.2 as part of the User Statistics feature. It was\nremoved as a separate statement in MariaDB 10.1.1, but\neffectively replaced by the generic SHOW\ninformation_schema_table statement. The\ninformation_schema.CLIENT_STATISTICS table holds statistics\nabout client connections.\n \nThe userstat system variable must be set to 1 to activate\nthis feature. See the User Statistics and\ninformation_schema.CLIENT_STATISTICS articles for more\ninformation.\n \nExample\n \nFrom MariaDB 10.0:\n \nSHOW CLIENT_STATISTICS\\G\n*************************** 1. row\n***************************\n Client: localhost\n Total_connections: 35\nConcurrent_connections: 0\n Connected_time: 708\n Busy_time: 2.5557979999999985\n Cpu_time: 0.04123740000000002\n Bytes_received: 3883\n Bytes_sent: 21595\n Binlog_bytes_written: 0\n Rows_read: 18\n Rows_sent: 115\n Rows_deleted: 0\n Rows_inserted: 0\n Rows_updated: 0\n Select_commands: 70\n Update_commands: 0\n Other_commands: 0\n Commit_transactions: 1\n Rollback_transactions: 0\n Denied_connections: 0\n Lost_connections: 0\n Access_denied: 0\n Empty_queries: 35\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/show-client-statistics/','','https://mariadb.com/kb/en/library/show-client-statistics/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (354,26,'SHOW COLLATION','Syntax\n------ \nSHOW COLLATION\n [LIKE \'pattern\' | WHERE expr]\n \nDescription\n----------- \nThe output from SHOW COLLATION includes all available\ncollations. The LIKE clause, if present on its own,\nindicates which collation names to match. The WHERE and LIKE\nclauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n \nThe same information can be queried from the\ninformation_schema.COLLATIONS table.\n \nSee Setting Character Sets and Collations for details on\nspecifying the collation at the server, database, table and\ncolumn levels.\n \nExamples\n-------- \nSHOW COLLATION LIKE \'latin1%\';\n+-------------------+---------+----+---------+----------+---------+\n| Collation | Charset | Id | Default | Compiled | Sortlen |\n+-------------------+---------+----+---------+----------+---------+\n| latin1_german1_ci | latin1 | 5 | | Yes | 1 |\n| latin1_swedish_ci | latin1 | 8 | Yes | Yes | 1 |\n| latin1_danish_ci | latin1 | 15 | | Yes | 1 |\n| latin1_german2_ci | latin1 | 31 | | Yes | 2 |\n| latin1_bin | latin1 | 47 | | Yes | 1 |\n| latin1_general_ci | latin1 | 48 | | Yes | 1 |\n| latin1_general_cs | latin1 | 49 | | Yes | 1 |\n| latin1_spanish_ci | latin1 | 94 | | Yes | 1 |\n+-------------------+---------+----+---------+----------+---------+\n \nSHOW COLLATION WHERE Sortlen LIKE \'8\' AND Charset LIKE\n\'utf8\';\n+--------------------+---------+-----+---------+----------+---------+\n| Collation | Charset | Id | Default | Compiled | Sortlen |\n+--------------------+---------+-----+---------+----------+---------+\n| utf8_unicode_ci | utf8 | 192 | | Yes | 8 |\n| utf8_icelandic_ci | utf8 | 193 | | Yes | 8 |\n| utf8_latvian_ci | utf8 | 194 | | Yes | 8 |\n| utf8_romanian_ci | utf8 | 195 | | Yes | 8 |\n| utf8_slovenian_ci | utf8 | 196 | | Yes | 8 |\n| utf8_polish_ci | utf8 | 197 | | Yes | 8 |\n| utf8_estonian_ci | utf8 | 198 | | Yes | 8 |\n| utf8_spanish_ci | utf8 | 199 | | Yes | 8 |\n| utf8_swedish_ci | utf8 | 200 | | Yes | 8 |\n| utf8_turkish_ci | utf8 | 201 | | Yes | 8 |\n| utf8_czech_ci | utf8 | 202 | | Yes | 8 |\n| utf8_danish_ci | utf8 | 203 | | Yes | 8 |\n| utf8_lithuanian_ci | utf8 | 204 | | Yes | 8 |\n| utf8_slovak_ci | utf8 | 205 | | Yes | 8 |\n| utf8_spanish2_ci | utf8 | 206 | | Yes | 8 |\n| utf8_roman_ci | utf8 | 207 | | Yes | 8 |\n| utf8_persian_ci | utf8 | 208 | | Yes | 8 |\n| utf8_esperanto_ci | utf8 | 209 | | Yes | 8 |\n| utf8_hungarian_ci | utf8 | 210 | | Yes | 8 |\n| utf8_sinhala_ci | utf8 | 211 | | Yes | 8 |\n| utf8_croatian_ci | utf8 | 213 | | Yes | 8 |\n+--------------------+---------+-----+---------+----------+---------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-collation/','','https://mariadb.com/kb/en/library/show-collation/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (355,26,'SHOW COLUMNS','Syntax\n------ \nSHOW [FULL] {COLUMNS | FIELDS} FROM tbl_name [FROM db_name]\n [LIKE \'pattern\' | WHERE expr]\n \nDescription\n----------- \nSHOW COLUMNS displays information about the columns in a\ngiven table. It also works for views. The LIKE clause, if\npresent on its own, indicates which column names to match.\nThe WHERE and LIKE clauses can be given to select rows using\nmore general conditions, as discussed in Extended SHOW.\n \nIf the data types differ from what you expect them to be\nbased on a\nCREATE TABLE statement, note that MariaDB sometimes changes\ndata types when you create or alter a table. The conditions\nunder which this\noccurs are described in the Silent Column Changes article.\n \nThe FULL keyword causes the output to include the column\ncollation and comments, as well as the privileges you have\nfor each column.\n \nYou can use db_name.tbl_name as an alternative to the\ntbl_name FROM db_name syntax. In other words, these two\nstatements are equivalent:\n \nSHOW COLUMNS FROM mytable FROM mydb;\nSHOW COLUMNS FROM mydb.mytable;\n \nSHOW COLUMNS displays the following values for each table\ncolumn:\n \nField indicates the column name.\n \nType indicates the column data type.\n \nCollation indicates the collation for non-binary string\ncolumns, or\nNULL for other columns. This value is displayed only if you\nuse the\nFULL keyword.\n \nThe Null field contains YES if NULL values can be stored in\nthe column,\nNO if not.\n \nThe Key field indicates whether the column is indexed:\nIf Key is empty, the column either is not indexed or is\nindexed only as a\n secondary column in a multiple-column, non-unique index.\nIf Key is PRI, the column is a PRIMARY KEY or\n is one of the columns in a multiple-column PRIMARY KEY.\nIf Key is UNI, the column is the first column of a\nunique-valued\n index that cannot contain NULL values.\nIf Key is MUL, multiple occurrences of a given value are\nallowed\n within the column. The column is the first column of a\nnon-unique index or a\n unique-valued index that can contain NULL values.\n \nIf more than one of the Key values applies to a given column\nof a\ntable, Key displays the one with the highest priority, in\nthe order\nPRI, UNI, MUL.\n \nA UNIQUE index may be displayed as PRI if\nit cannot contain NULL values and there is no\nPRIMARY KEY in the table. A UNIQUE index\nmay display as MUL if several columns form a composite\nUNIQUE index; although the combination of the columns is\nunique, each column can still hold multiple occurrences of a\ngiven value.\n \nThe Default field indicates the default value that is\nassigned to the\ncolumn.\n \nThe Extra field contains any additional information that is\navailable about a given column.\n \nValue | Description | \n \nAUTO_INCREMENT | The column was created with the\nAUTO_INCREMENT keyword. | \n \nPERSISTENT | The column was created with the PERSISTENT\nkeyword. (New in 5.3) | \n \nVIRTUAL | The column was created with the VIRTUAL keyword.\n(New in 5.3) | \n \non update CURRENT_TIMESTAMP | The column is a TIMESTAMP\ncolumn that is automatically updated on INSERT and UPDATE. |\n\n \nPrivileges indicates the privileges you have for the column.\nThis\nvalue is displayed only if you use the FULL keyword.\n \nComment indicates any comment the column has. This value is\ndisplayed\nonly if you use the FULL keyword.\n \nSHOW FIELDS is a synonym for\nSHOW COLUMNS. Also DESCRIBE and EXPLAIN can be used as\nshortcuts.\n \nYou can also list a table\'s columns with: \n \nmysqlshow db_name tbl_name\n \nSee the mysqlshow command for more details.\n \nThe DESCRIBE statement provides information similar to SHOW\nCOLUMNS. The information_schema.COLUMNS table provides\nsimilar, but more complete, information.\n \nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX\nstatements also provide information about tables.\n \nExamples\n-------- \nSHOW COLUMNS FROM city;\n+------------+----------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+------------+----------+------+-----+---------+----------------+\n| Id | int(11) | NO | PRI | NULL | auto_increment |\n| Name | char(35) | NO | | | |\n| Country | char(3) | NO | UNI | | |\n| District | char(20) | YES | MUL | | |\n| Population | int(11) | NO | | 0 | |\n+------------+----------+------+-----+---------+----------------+\n \nSHOW COLUMNS FROM employees WHERE Type LIKE \'Varchar%\';\n+---------------+-------------+------+-----+---------+-------+\n| Field | Type | Null | Key | Default | Extra |\n+---------------+-------------+------+-----+---------+-------+\n| first_name | varchar(30) | NO | MUL | NULL | |\n| last_name | varchar(40) | NO | | NULL | |\n| position | varchar(25) | NO | | NULL | |\n| home_address | varchar(50) | NO | | NULL | |\n| home_phone | varchar(12) | NO | | NULL | |\n| employee_code | varchar(25) | NO | UNI | NULL | |\n+---------------+-------------+------+-----+---------+-------+\n \n\n\nURL: https://mariadb.com/kb/en/library/show-columns/','','https://mariadb.com/kb/en/library/show-columns/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (356,26,'SHOW CONTRIBUTORS','Syntax\n------ \nSHOW CONTRIBUTORS\n \nDescription\n----------- \nThe SHOW CONTRIBUTORS statement displays information about\nthe companies and people who financially contribute to\nMariaDB. For each contributor, it displays Name, Location,\nand Comment values. All columns are encoded as latin1.\n \nIn MariaDB 5.5 this is in somewhat random order, and the\nfeature was deprecated.\n \nIn MariaDB 10.0.5 it was un-deprecated, and since then\ndisplays all members and sponsors of the MariaDB Foundation\nas well as other financial contributors.\n \nExample\n \nSHOW CONTRIBUTORS;\n+---------------------+-------------------------------+-------------------------------------------------------------+\n| Name | Location | Comment |\n+---------------------+-------------------------------+-------------------------------------------------------------+\n| Booking.com | https://www.booking.com | Founding member,\nPlatinum Sponsor of the MariaDB Foundation |\n| Alibaba Cloud | https://www.alibabacloud.com/ | Platinum\nSponsor of the MariaDB Foundation |\n| Tencent Cloud | https://cloud.tencent.com | Platinum\nSponsor of the MariaDB Foundation |\n| Microsoft | https://microsoft.com/ | Platinum Sponsor of\nthe MariaDB Foundation |\n| MariaDB Corporation | https://mariadb.com | Founding\nmember, Platinum Sponsor of the MariaDB Foundation |\n| Visma | https://visma.com | Gold Sponsor of the MariaDB\nFoundation |\n| DBS | https://dbs.com | Gold Sponsor of the MariaDB\nFoundation |\n| IBM | https://www.ibm.com | Gold Sponsor of the MariaDB\nFoundation |\n| Tencent Games | http://game.qq.com/ | Gold Sponsor of the\nMariaDB Foundation |\n| Nexedi | https://www.nexedi.com | Silver Sponsor of the\nMariaDB Foundation |\n| Acronis | https://www.acronis.com | Silver Sponsor of the\nMariaDB Foundation |\n| Verkkokauppa.com | https://www.verkkokauppa.com | Bronze\nSponsor of the MariaDB Foundation |\n| Virtuozzo | https://virtuozzo.com | Bronze Sponsor of the\nMariaDB Foundation |\n| Tencent Game DBA | http://tencentdba.com/about | Bronze\nSponsor of the MariaDB Foundation |\n| Tencent TDSQL | http://tdsql.org | Bronze Sponsor of the\nMariaDB Foundation |\n| Percona | https://www.percona.com/ | Bronze Sponsor of the\nMariaDB Foundation |\n| Google | USA | Sponsoring encryption, parallel replication\nand GTID |\n| Facebook | USA | Sponsoring non-blocking API, LIMIT ROWS\nEXAMINED etc |\n| Ronald Bradford | Brisbane, Australia | EFF contribution\nfor UC2006 Auction |\n| Sheeri Kritzer | Boston, Mass. USA | EFF contribution for\nUC2006 Auction |\n| Mark Shuttleworth | London, UK. | EFF contribution for\nUC2006 Auction |\n+---------------------+-------------------------------+-------------------------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/show-contributors/','','https://mariadb.com/kb/en/library/show-contributors/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (357,26,'SHOW CREATE DATABASE','Syntax\n------ \nSHOW CREATE {DATABASE | SCHEMA} db_name\n \nDescription\n----------- \nShows the CREATE DATABASE statement that\ncreates the given database. SHOW CREATE SCHEMA is a synonym\nfor SHOW CREATE DATABASE. SHOW CREATE DATABASE quotes\ndatabase names according to the value of the\nsql_quote_show_create server system variable.\n \nExamples\n-------- \nSHOW CREATE DATABASE test;\n+----------+-----------------------------------------------------------------+\n| Database | Create Database |\n+----------+-----------------------------------------------------------------+\n| test | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER\nSET latin1 */ |\n+----------+-----------------------------------------------------------------+\n \nSHOW CREATE SCHEMA test;\n+----------+-----------------------------------------------------------------+\n| Database | Create Database |\n+----------+-----------------------------------------------------------------+\n| test | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER\nSET latin1 */ |\n+----------+-----------------------------------------------------------------+\n \nWith sql_quote_show_create off:\n \nSHOW CREATE DATABASE test;\n+----------+---------------------------------------------------------------+\n| Database | Create Database |\n+----------+---------------------------------------------------------------+\n| test | CREATE DATABASE test /*!40100 DEFAULT CHARACTER SET\nlatin1 */ |\n+----------+---------------------------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/show-create-database/','','https://mariadb.com/kb/en/library/show-create-database/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (358,26,'SHOW CREATE EVENT','Syntax\n------ \nSHOW CREATE EVENT event_name\n \nDescription\n----------- \nThis statement displays the CREATE EVENT\nstatement needed to re-create a given event, as well as the\nSQL_MODE that was used when the trigger has been created and\nthe character set used by the connection.. To find out which\nevents are present, use SHOW EVENTS.\n \nThe output of this statement is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n \nThe information_schema.EVENTS table provides similar, but\nmore complete, information.\n \nExamples\n-------- \nSHOW CREATE EVENT test.e_daily\\G\n*************************** 1. row\n***************************\n Event: e_daily\n sql_mode: \n time_zone: SYSTEM\n Create Event: CREATE EVENT `e_daily`\n ON SCHEDULE EVERY 1 DAY\n STARTS CURRENT_TIMESTAMP + INTERVAL 6 HOUR\n ON COMPLETION NOT PRESERVE\n ENABLE\n COMMENT \'Saves total number of sessions then\n clears the table each day\'\n DO BEGIN\n INSERT INTO site_activity.totals (time, total)\n SELECT CURRENT_TIMESTAMP, COUNT(*) \n FROM site_activity.sessions;\n DELETE FROM site_activity.sessions;\n END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n \n\n\nURL: https://mariadb.com/kb/en/library/show-create-event/','','https://mariadb.com/kb/en/library/show-create-event/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (359,26,'SHOW CREATE FUNCTION','Syntax\n------ \nSHOW CREATE FUNCTION func_name\n \nDescription\n----------- \nThis statement is similar to \nSHOW CREATE PROCEDURE but for\nstored functions.\n \nThe output of this statement is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n \nExample\n \nMariaDB [test]> SHOW CREATE FUNCTION VatCents\\G\n*************************** 1. row\n***************************\n Function: VatCents\n sql_mode: \n Create Function: CREATE DEFINER=`root`@`localhost` FUNCTION\n`VatCents`(price DECIMAL(10,2)) RETURNS int(11)\n DETERMINISTIC\nBEGIN\n DECLARE x INT;\n SET x = price * 114;\n RETURN x;\nEND\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n \n\n\nURL: https://mariadb.com/kb/en/library/show-create-function/','','https://mariadb.com/kb/en/library/show-create-function/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (360,26,'SHOW CREATE PACKAGE','Oracle-style packages were introduced in MariaDB 10.3.5.\n \nSyntax\n------ \nSHOW CREATE PACKAGE [ db_name . ] package_name\n \nDescription\n----------- \nThe SHOW CREATE PACKAGE statement can be used when Oracle\nSQL_MODE is set.\n \nShows the CREATE statement that creates the given package\nspecification.\n \nExamples\n-------- \nSHOW CREATE PACKAGE employee_tools\\G\n*************************** 1. row\n***************************\n Package: employee_tools\n sql_mode:\nPIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER\n Create Package: CREATE DEFINER=\"root\"@\"localhost\"\nPACKAGE \"employee_tools\" AS\n FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);\n PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));\n PROCEDURE raiseSalaryStd(eid INT);\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));\nEND\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n \n\n\nURL: https://mariadb.com/kb/en/library/show-create-package/','','https://mariadb.com/kb/en/library/show-create-package/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (361,26,'SHOW CREATE PACKAGE BODY','Oracle-style packages were introduced in MariaDB 10.3.5.\n \nSyntax\n------ \nSHOW CREATE PACKAGE BODY [ db_name . ] package_name\n \nDescription\n----------- \nThe SHOW CREATE PACKAGE BODY statement can be used when\nOracle SQL_MODE is set.\n \nShows the CREATE statement that creates the given package\nbody (i.e. the implementation).\n \nExamples\n-------- \nSHOW CREATE PACKAGE BODY employee_tools\\G\n*************************** 1. row\n***************************\n Package body: employee_tools\n sql_mode:\nPIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER\n Create Package Body: CREATE DEFINER=\"root\"@\"localhost\"\nPACKAGE BODY \"employee_tools\" AS\n \n stdRaiseAmount DECIMAL(10,2):=500;\n \n PROCEDURE log (eid INT, ecmnt TEXT) AS\n BEGIN\n INSERT INTO employee_log (id, cmnt) VALUES (eid, ecmnt);\n END;\n \n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2)) AS\n eid INT;\n BEGIN\n INSERT INTO employee (name, salary) VALUES (ename,\nesalary);\n eid:= last_insert_id();\n log(eid, \'hire \' || ename);\n END;\n \n FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2) AS\n nSalary DECIMAL(10,2);\n BEGIN\n SELECT salary INTO nSalary FROM employee WHERE id=eid;\n log(eid, \'getSalary id=\' || eid || \' salary=\' ||\nnSalary);\n RETURN nSalary;\n END;\n \n PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2)) AS\n BEGIN\n UPDATE employee SET salary=salary+amount WHERE id=eid;\n log(eid, \'raiseSalary id=\' || eid || \' amount=\' ||\namount);\n END;\n \n PROCEDURE raiseSalaryStd(eid INT) AS\n BEGIN\n raiseSalary(eid, stdRaiseAmount);\n log(eid, \'raiseSalaryStd id=\' || eid);\n END;\n \nBEGIN \n log(0, \'Session \' || connection_id() || \' \' ||\ncurrent_user || \' started\');\nEND\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/show-create-package-body/','','https://mariadb.com/kb/en/library/show-create-package-body/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (362,26,'SHOW CREATE PROCEDURE','Syntax\n------ \nSHOW CREATE PROCEDURE proc_name\n \nDescription\n----------- \nThis statement is a MariaDB extension. It returns the exact\nstring that\ncan be used to re-create the named stored procedure, as well\nas the SQL_MODE that was used when the trigger has been\ncreated and the character set used by the connection.. A\nsimilar\nstatement, SHOW CREATE FUNCTION,\ndisplays information about stored functions.\n \nBoth statements require that you are the owner of the\nroutine or have the SELECT privilege on the mysql.proc\ntable. When neither is true, the statements display NULL for\nthe Create Procedure or Create Function field.\n \nWarning Users with SELECT privileges on mysql.proc or USAGE\nprivileges on *.* can view the text of routines, even when\nthey do not have privileges for the function or procedure\nitself.\n \nThe output of these statements is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n \nExamples\n-------- \nHere\'s a comparison of the SHOW CREATE PROCEDURE and SHOW\nCREATE FUNCTION statements.\n \nSHOW CREATE PROCEDURE test.simpleproc\\G\n*************************** 1. row\n***************************\n Procedure: simpleproc\n sql_mode: \n Create Procedure: CREATE PROCEDURE `simpleproc`(OUT param1\nINT)\n BEGIN\n SELECT COUNT(*) INTO param1 FROM t;\n END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n \nSHOW CREATE FUNCTION test.hello\\G\n*************************** 1. row\n***************************\n Function: hello\n sql_mode:\n Create Function: CREATE FUNCTION `hello`(s CHAR(20))\n RETURNS CHAR(50)\n RETURN CONCAT(\'Hello, \',s,\'!\')\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n \nWhen the user issuing the statement does not have privileges\non the routine, attempting to CALL the procedure raises\nError 1370.\n \nCALL test.prc1();\nError 1370 (42000): execute command denieed to user\n\'test_user\'@\'localhost\' for routine \'test\'.\'prc1\'\n \nIf the user neither has privilege to the routine nor the\nSELECT privilege on mysql.proc table, it raises Error 1305,\ninforming them that the procedure does not exist.\n \nSHOW CREATE TABLES test.prc1\\G\nError 1305 (42000): PROCEDURE prc1 does not exist\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/show-create-procedure/','','https://mariadb.com/kb/en/library/show-create-procedure/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (363,26,'SHOW CREATE SEQUENCE','Sequences were introduced in MariaDB 10.3.\n \nSyntax\n------ \nSHOW CREATE SEQUENCE sequence_name;\n \nDescription\n----------- \nShows the CREATE SEQUENCE statement that created the given\nsequence. The statement requires the SELECT privilege for\nthe table.\n \nExample\n \nCREATE SEQUENCE s1 START WITH 50;\n \nSHOW CREATE SEQUENCE s1\\G;\n \n*************************** 1. row\n***************************\n Table: t1\nCreate Table: CREATE SEQUENCE `s1` start with 50 minvalue 1\nmaxvalue 9223372036854775806\nincrement by 1 cache 1000 nocycle ENGINE=Aria\n \nNotes\n \nIf you want to see the underlying table structure used for\nthe SEQUENCE\nyou can use SHOW CREATE TABLE on the SEQUENCE. You can also\nuse SELECT to read the current recorded state of the\nSEQUENCE:\n \nCREATE SEQUENCE t1;\n \nSHOW CREATE TABLE s1\\G\n*************************** 1. row\n***************************\n Table: s1\nCreate Table: CREATE TABLE `s1` (\n `next_value` bigint(21) NOT NULL COMMENT \'next not cached\nvalue\',\n `min_value` bigint(21) NOT NULL COMMENT \'min value\',\n `max_value` bigint(21) NOT NULL COMMENT \'max value\',\n `start` bigint(21) NOT NULL COMMENT \'start value\',\n `increment` bigint(21) NOT NULL COMMENT \'increment\nvalue\',\n `cache` bigint(21) NOT NULL COMMENT \'cache size\',\n `cycle` tinyint(1) unsigned NOT NULL COMMENT \'cycle\nstate\',\n `round` bigint(21) NOT NULL COMMENT \'How many cycles has\nbeen done\'\n) ENGINE=Aria SEQUENCE=1\n \nSELECT * FROM s1;\n \n+------------+-----------+---------------------+-------+-----------+-------+-------+-------+\n| next_value | min_value | max_value | start | increment |\ncache | cycle | round |\n+------------+-----------+---------------------+-------+-----------+-------+-------+-------+\n| 1 | 1 | 9223372036854775806 | 1 | 1 | 1000 | 0 | 0 |\n+------------+-----------+---------------------+-------+-----------+-------+-------+-------+\n \n\n\nURL: https://mariadb.com/kb/en/library/show-create-sequence/','','https://mariadb.com/kb/en/library/show-create-sequence/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (364,26,'SHOW CREATE TABLE','Syntax\n------ \nSHOW CREATE TABLE tbl_name\n \nDescription\n----------- \nShows the CREATE TABLE statement that created the given\ntable. The statement requires the SELECT privilege for the\ntable. This statement also works with views and SEQUENCE.\n \nSHOW CREATE TABLE quotes table and\ncolumn names according to the value of the\nsql_quote_show_create server system variable.\n \nMariaDB and MySQL-specific table options, column options,\nand index options are not included in the output of this\nstatement if the NO_TABLE_OPTIONS, NO_FIELD_OPTIONS and\nNO_KEY_OPTIONS SQL_MODE flags are used.\n \nInvalid table options, column options and index options are\nnormally commented out (note, that it is possible to create\na table with invalid options, by altering a table of a\ndifferent engine, where these options were valid). To have\nthem uncommented, enable IGNORE_BAD_TABLE_OPTIONS SQL_MODE.\nRemember that replaying a CREATE TABLE statement with\nuncommented invalid options will fail with an error, unless\nIGNORE_BAD_TABLE_OPTIONS SQL_MODE is in effect.\n \nNote that SHOW CREATE TABLE is not meant to provide metadata\nabout a table. It provides information about how the table\nwas declared, but the real table structure could differ a\nbit. For example, if an index has been declared as HASH, the\nCREATE TABLE statement returned by SHOW CREATE TABLE will\ndeclare that index as HASH; however, it is possible that the\nindex is in fact a BTREE, because the storage engine does\nnot support HASH.\n \nMariaDB 10.2.1 permits TEXT and BLOB data types to be\nassigned a DEFAULT value. As a result, from MariaDB 10.2.1,\nSHOW CREATE TABLE will append a DEFAULT NULL to nullable\nTEXT or BLOB fields if no specific default is provided. \n \nFrom MariaDB 10.2.2, numbers are no longer quoted in the\nDEFAULT clause in SHOW CREATE statement. Previously, MariaDB\nquoted numbers. \n \nExamples\n-------- \nSHOW CREATE TABLE t\\G\n*************************** 1. row\n***************************\n Table: t\nCreate Table: CREATE TABLE `t` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `s` char(60) DEFAULT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n \nWith sql_quote_show_create off:\n \nSHOW CREATE TABLE t\\G\n*************************** 1. row\n***************************\n Table: t\nCreate Table: CREATE TABLE t (\n id int(11) NOT NULL AUTO_INCREMENT,\n s char(60) DEFAULT NULL,\n PRIMARY KEY (id)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n \nUnquoted numeric DEFAULTs, from MariaDB 10.2.2:\n \nCREATE TABLE td (link TINYINT DEFAULT 1);\n \nSHOW CREATE TABLE td\\G\n*************************** 1. row\n***************************\n Table: td\nCreate Table: CREATE TABLE `td` (\n `link` tinyint(4) DEFAULT 1\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n \nQuoted numeric DEFAULTs, until MariaDB 10.2.1:\n \nCREATE TABLE td (link TINYINT DEFAULT 1);\n \nSHOW CREATE TABLE td\\G\n*************************** 1. row\n***************************\n Table: td\nCreate Table: CREATE TABLE `td` (\n `link` tinyint(4) DEFAULT \'1\'\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n \n\n\nURL: https://mariadb.com/kb/en/library/show-create-table/','','https://mariadb.com/kb/en/library/show-create-table/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (365,26,'SHOW CREATE TRIGGER','Syntax\n------ \nSHOW CREATE TRIGGER trigger_name\n \nDescription\n----------- \nThis statement shows a CREATE TRIGGER\nstatement that creates the given trigger, as well as the\nSQL_MODE that was used when the trigger has been created and\nthe character set used by the connection.\n \nThe output of this statement is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n \nExamples\n-------- \nSHOW CREATE TRIGGER example\\G\n*************************** 1. row\n***************************\n Trigger: example\n sql_mode:\nONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,STRICT_ALL_TABLES\n,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_\nENGINE_SUBSTITUTION\nSQL Original Statement: CREATE DEFINER=`root`@`localhost`\nTRIGGER example BEFORE\n INSERT ON t FOR EACH ROW\nBEGIN\n SET NEW.c = NEW.c * 2;\nEND\n character_set_client: cp850\n collation_connection: cp850_general_ci\n Database Collation: utf8_general_ci\n Created: 2016-09-29 13:53:34.35\n \nThe Created column was added in MySQL 5.7 and MariaDB 10.2.3\nas part of introducing multiple trigger events per action.\n \n\n\nURL: https://mariadb.com/kb/en/library/show-create-trigger/','','https://mariadb.com/kb/en/library/show-create-trigger/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (366,26,'SHOW CREATE USER','SHOW CREATE USER was introduced in MariaDB 10.2.0\n \nSyntax\n------ \nSHOW CREATE USER user_name\n \nDescription\n----------- \nShows the CREATE USER statement that created the given\nuser. The statement requires the SELECT privilege for the\nmysql database, except for the current user.\n \nExamples\n-------- \nCREATE USER foo4@test require cipher \'text\' \n issuer \'foo_issuer\' subject \'foo_subject\';\n \nSHOW CREATE USER foo4@test\\G\n*************************** 1. row\n***************************\nCREATE USER \'foo4\'@\'test\' \n REQUIRE ISSUER \'foo_issuer\' \n SUBJECT \'foo_subject\' \n CIPHER \'text\'\n \nUser Password Expiry:\n \nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL\n120 DAY;\n \nSHOW CREATE USER \'monty\'@\'localhost\';\n \n+------------------------------------------------------------------+\n| CREATE USER for monty@localhost |\n+------------------------------------------------------------------+\n| CREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE\nINTERVAL 120 DAY |\n+------------------------------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/show-create-user/','','https://mariadb.com/kb/en/library/show-create-user/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (367,26,'SHOW CREATE VIEW','Syntax\n------ \nSHOW CREATE VIEW view_name\n \nDescription\n----------- \nThis statement shows a CREATE VIEW statement that creates\nthe given view, as well as the character set used by the\nconnection when the view was created. This statement\nalso works with views.\n \nSHOW CREATE VIEW quotes table, column and stored function\nnames according to the value of the sql_quote_show_create\nserver system variable.\n \nExamples\n-------- \nSHOW CREATE VIEW example\\G\n*************************** 1. row\n***************************\n View: example\n Create View: CREATE ALGORITHM=UNDEFINED\nDEFINER=`root`@`localhost` SQL\nSECURITY DEFINER VIEW `example` AS (select `t`.`id` AS\n`id`,`t`.`s` AS `s` from\n`t`)\ncharacter_set_client: cp850\ncollation_connection: cp850_general_ci\n \nWith sql_quote_show_create off:\n \nSHOW CREATE VIEW example\\G\n*************************** 1. row\n***************************\n View: example\n Create View: CREATE ALGORITHM=UNDEFINED\nDEFINER=root@localhost SQL SECU\nRITY DEFINER VIEW example AS (select t.id AS id,t.s AS s\nfrom t)\ncharacter_set_client: cp850\ncollation_connection: cp850_general_ci\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-create-view/','','https://mariadb.com/kb/en/library/show-create-view/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (368,26,'SHOW DATABASES','Syntax\n------ \nSHOW {DATABASES | SCHEMAS}\n [LIKE \'pattern\' | WHERE expr]\n \nDescription\n----------- \nSHOW DATABASES lists the databases on the MariaDB server\nhost.\nSHOW SCHEMAS is a synonym for \nSHOW DATABASES. The LIKE clause, if\npresent on its own, indicates which database names to match.\nThe WHERE and LIKE clauses can be given to select rows using\nmore general conditions, as discussed in Extended SHOW.\n \nYou see only those databases for which you have some kind of\nprivilege, unless you have the global \nSHOW DATABASES privilege. You\ncan also get this list using the mysqlshow command.\n \nIf the server was started with the --skip-show-database\noption, you cannot use this statement at all unless you have\nthe\nSHOW DATABASES privilege.\n \nExample\n \nSHOW DATABASES;\n+--------------------+\n| Database |\n+--------------------+\n| information_schema |\n| mysql |\n| performance_schema |\n| test |\n+--------------------+\n \nSHOW DATABASES LIKE \'m%\';\n+---------------+\n| Database (m%) |\n+---------------+\n| mysql |\n+---------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-databases/','','https://mariadb.com/kb/en/library/show-databases/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (369,26,'SHOW ENGINE','Syntax\n------ \nSHOW ENGINE engine_name {STATUS | MUTEX}\n \nDescription\n----------- \nSHOW ENGINE displays operational information about a storage\nengine. The following statements currently are supported:\n \nSHOW ENGINE INNODB STATUS\nSHOW ENGINE INNODB MUTEX\nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\n \nIf the Sphinx Storage Engine is installed, the following is\nalso supported:\n \nSHOW ENGINE SPHINX STATUS\n \nSee SHOW ENGINE SPHINX STATUS.\n \nOlder (and now removed) synonyms were SHOW INNODB STATUS\nfor SHOW ENGINE INNODB STATUS and \nSHOW MUTEX STATUS for \nSHOW ENGINE INNODB MUTEX.\n \nSHOW ENGINE BDB LOGS formerly displayed status information\nabout BDB log files. It was deprecated in MySQL 5.1.12 and\nremoved in MariaDB and MySQL 5.5, so now produces an error.\n \nSHOW ENGINE INNODB STATUS\n \nSHOW ENGINE INNODB STATUS displays extensive information\nfrom the standard InnoDB Monitor about the state of the\nInnoDB storage engine.\nSee SHOW ENGINE INNODB STATUS for more.\n \nSHOW ENGINE INNODB MUTEX\n \nSHOW ENGINE INNODB MUTEX displays InnoDB mutex statistics.\n \nThe statement displays the following output fields:\nType: Always InnoDB.\nName: The source file where the mutex is implemented, and\nthe line number\n in the file where the mutex is created. The line number is\ndependent on the MariaDB version.\nStatus: This field displays the following values if\nUNIV_DEBUG was defined at compilation time (for example, in\ninclude/univ.h in the InnoDB part of the source tree). Only\nthe os_waits value is displayed if UNIV_DEBUG was not\ndefined. Without UNIV_DEBUG, the information on which the\noutput is based is insufficient to distinguish regular\nmutexes and mutexes that protect\n rw-locks (which allow multiple readers or a single writer).\nConsequently, the\n output may appear to contain multiple rows for the same\nmutex.\ncount indicates how many times the mutex was requested.\nspin_waits indicates how many times the spinlock had to run.\nspin_rounds indicates the number of spinlock rounds.\n(spin_rounds divided by\n spin_waits provides the average round count.)\nos_waits indicates the number of operating system waits.\nThis occurs when\n the spinlock did not work (the mutex was not locked during\nthe spinlock and\n it was necessary to yield to the operating system and\nwait).\nos_yields indicates the number of times a the thread trying\nto lock a mutex\n gave up its timeslice and yielded to the operating system\n(on the\n presumption that allowing other threads to run will free\nthe mutex so that\n it can be locked).\nos_wait_times indicates the amount of time (in ms) spent in\noperating system\n waits, if the timed_mutexes system variable is 1 (ON). If\ntimed_mutexes is 0\n (OFF), timing is disabled, so os_wait_times is 0.\ntimed_mutexes is off by\n default.\n \nInformation from this statement can be used to diagnose\nsystem problems. For\nexample, large values of spin_waits and spin_rounds may\nindicate scalability\nproblems.\n \nThe information_schema.INNODB_MUTEXES table provides similar\ninformation.\n \nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\n \nThis statement shows how much memory is used for\nperformance_schema tables and internal buffers.\n \nThe output contains the following fields:\nType: Always performance_schema.\nName: The name of a table, the name of an internal buffer,\nor the performance_schema word, followed by a dot and an\nattribute. Internal buffers names are enclosed by\nparenthesis. performance_schema means that the attribute\nrefers to the whole database (it is a total). \nStatus: The value for the attribute.\n \nThe following attributes are shown, in this order, for all\ntables:\nrow_size: The memory used for an individual record. This\nvalue will never change.\nrow_count: The number of rows in the table or buffer. For\nsome tables, this value depends on a server system variable.\nmemory: For tables and performance_schema, this is the\nresult of row_size * row_count.\n \nFor internal buffers, the attributes are:\ncount\nsize\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-engine/','','https://mariadb.com/kb/en/library/show-engine/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (370,26,'SHOW ENGINE INNODB STATUS','SHOW ENGINE INNODB STATUS is a specific form of the SHOW\nENGINE statement that displays the InnoDB Monitor output,\nwhich is extensive InnoDB information which can be useful in\ndiagnosing problems.\n \nThe following sections are displayed\nStatus: Shows the timestamp, monitor name and the number of\nseconds, or the elapsed time between the current time and\nthe time the InnoDB Monitor output was last displayed. The\nper-second averages are based upon this time.\nBACKGROUND THREAD: srv_master_thread lines show work\nperformed by the main background thread.\nSEMAPHORES: Threads waiting for a semaphore and stats on how\nthe number of times threads have needed a spin or a wait on\na mutex or rw-lock semaphore. If this number of threads is\nlarge, there may be I/O or contention issues. Reducing the\nsize of the innodb_thread_concurrency system variable may\nhelp if contention is related to thread scheduling. Spin\nrounds per wait shows the number of spinlock rounds per OS\nwait for a mutex. \nLATEST FOREIGN KEY ERROR: Only shown if there has been a\nforeign key constraint error, it displays the failed\nstatement and information about the constraint and the\nrelated tables.\nLATEST DETECTED DEADLOCK: Only shown if there has been a\ndeadlock, it displays the transactions involved in the\ndeadlock and the statements being executed, held and\nrequired locked and the transaction rolled back to.\nTRANSACTIONS: The output of this section can help identify\nlock contention, as well as reasons for the deadlocks.\nFILE I/O: InnoDB thread information as well as pending I/O\noperations and I/O performance statistics.\nINSERT BUFFER AND ADAPTIVE HASH INDEX: InnoDB insert buffer\nand adaptive hash index status information, including the\nnumber of each type of operation performed, and adaptive\nhash index performance.\nLOG: InnoDB log information, including current log sequence\nnumber, how far the log has been flushed to disk, the\nposition at which InnoDB last took a checkpoint, pending\nwrites and write performance statistics.\nBUFFER POOL AND MEMORY: Information on buffer pool pages\nread and written, which allows you to see the number of data\nfile I/O operations performed by your queries. See InnoDB\nBuffer Pool for more. Similar information is also available\nfrom the INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS table.\nROW OPERATIONS:Information about the main thread, including\nthe number and performance rate for each type of row\noperation. \n \nIf the innodb_status_output_locks system variable is set to\n1, extended lock information will be displayed.\n \nExample output:\n \n=====================================\n2016-09-12 04:42:15 7f226145fb00 INNODB MONITOR OUTPUT\n=====================================\nPer second averages calculated from the last 29 seconds\n-----------------\nBACKGROUND THREAD\n-----------------\nsrv_master_thread loops: 0 srv_active, 0 srv_shutdown, 527\nsrv_idle\nsrv_master_thread log flush and writes: 527\n----------\nSEMAPHORES\n----------\nOS WAIT ARRAY INFO: reservation count 4\nOS WAIT ARRAY INFO: signal count 4\nMutex spin waits 2, rounds 60, OS waits 2\nRW-shared spins 2, rounds 60, OS waits 2\nRW-excl spins 0, rounds 0, OS waits 0\nSpin rounds per wait: 30.00 mutex, 30.00 RW-shared, 0.00\nRW-excl\n------------\nTRANSACTIONS\n------------\nTrx id counter 2308\nPurge done for trx\'s n:o < 0 undo n:o < 0 state: running\nbut idle\nHistory list length 0\nLIST OF TRANSACTIONS FOR EACH SESSION:\n---TRANSACTION 0, not started\nMySQL thread id 3, OS thread handle 0x7f226145fb00, query id\n4 localhost root init\nSHOW ENGINE INNODB STATUS\n--------\nFILE I/O\n--------\nI/O thread 0 state: waiting for completed aio requests\n(insert buffer thread)\nI/O thread 1 state: waiting for completed aio requests (log\nthread)\nI/O thread 2 state: waiting for completed aio requests (read\nthread)\nI/O thread 3 state: waiting for completed aio requests (read\nthread)\nI/O thread 4 state: waiting for completed aio requests (read\nthread)\nI/O thread 5 state: waiting for completed aio requests (read\nthread)\nI/O thread 6 state: waiting for completed aio requests\n(write thread)\nI/O thread 7 state: waiting for completed aio requests\n(write thread)\nI/O thread 8 state: waiting for completed aio requests\n(write thread)\nI/O thread 9 state: waiting for completed aio requests\n(write thread)\nPending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0,\n0, 0, 0] ,\n ibuf aio reads: 0, log i/o\'s: 0, sync i/o\'s: 0\nPending flushes (fsync) log: 0; buffer pool: 0\n172 OS file reads, 5 OS file writes, 5 OS fsyncs\n0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s\n-------------------------------------\nINSERT BUFFER AND ADAPTIVE HASH INDEX\n-------------------------------------\nIbuf: size 1, free list len 0, seg size 2, 0 merges\nmerged operations:\n insert 0, delete mark 0, delete 0\ndiscarded operations:\n insert 0, delete mark 0, delete 0\n0.00 hash searches/s, 0.00 non-hash searches/s\n---\nLOG\n---\nLog sequence number 1616829\nLog flushed up to 1616829\nPages flushed up to 1616829\nLast checkpoint at 1616829\nMax checkpoint age 80826164\nCheckpoint age target 78300347\nModified age 0\nCheckpoint age 0\n0 pending log writes, 0 pending chkp writes\n8 log i/o\'s done, 0.00 log i/o\'s/second\n----------------------\nBUFFER POOL AND MEMORY\n----------------------\nTotal memory allocated 140771328; in additional pool\nallocated 0\nTotal memory allocated by read views 88\nInternal hash tables (constant factor + variable factor)\n Adaptive hash index 2217568 (2213368 + 4200)\n Page hash 139112 (buffer pool 0 only)\n Dictionary cache 630703 (554768 + 75935)\n File system 817648 (812272 + 5376)\n Lock system 333232 (332872 + 360)\n Recovery system 0 (0 + 0)\nDictionary memory allocated 75935\nBuffer pool size 8191\nBuffer pool size, bytes 134201344\nFree buffers 8037\nDatabase pages 154\nOld database pages 0\nModified db pages 0\nPercent of dirty pages(LRU & free pages): 0.000\nMax dirty pages percent: 75.000\nPending reads 0\nPending writes: LRU 0, flush list 0, single page 0\nPages made young 0, not young 0\n0.00 youngs/s, 0.00 non-youngs/s\nPages read 154, created 0, written 1\n0.00 reads/s, 0.00 creates/s, 0.00 writes/s\nNo buffer pool page gets since the last printout\nPages read ahead 0.00/s, evicted without access 0.00/s,\nRandom read ahead 0.00/s\nLRU len: 154, unzip_LRU len: 0\nI/O sum[0]:cur[0], unzip sum[0]:cur[0]\n--------------\nROW OPERATIONS\n--------------\n0 queries inside InnoDB, 0 queries in queue\n0 read views open inside InnoDB\n0 RW transactions active inside InnoDB\n0 RO transactions active inside InnoDB\n0 out of 1000 descriptors used\nMain thread process no. 3337, id 139784957703936, state:\nsleeping\nNumber of rows inserted 0, updated 0, deleted 0, read 0\n0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s\nNumber of system rows inserted 0, updated 0, deleted 0, read\n0\n0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s\n----------------------------\nEND OF INNODB MONITOR OUTPUT\n============================\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/show-engine-innodb-status/','','https://mariadb.com/kb/en/library/show-engine-innodb-status/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (371,26,'SHOW ENGINES','Syntax\n------ \nSHOW [STORAGE] ENGINES\n \nDescription\n----------- \nSHOW ENGINES displays status information about the server\'s\nstorage engines. This is particularly useful for checking\nwhether a storage\nengine is supported, or to see what the default engine is. \nSHOW TABLE TYPES is a deprecated synonym.\n \nThe information_schema.ENGINES table provides the same\ninformation.\n \nSince storage engines are plugins, different information\nabout them is also shown in the information_schema.PLUGINS\ntable and by the SHOW PLUGINS statement.\n \nNote that both MySQL\'s InnoDB and Percona\'s XtraDB\nreplacement are labeled as InnoDB. However, if XtraDB is in\nuse, it will be specified in the COMMENT field. See XtraDB\nand InnoDB. The same applies to FederatedX.\n \nThe output consists of the following columns:\nEngine indicates the engine\'s name.\nSupport indicates whether the engine is installed, and\nwhether it is the default engine for the current session.\nComment is a brief description.\nTransactions, XA and Savepoints indicate whether\ntransactions, XA transactions and transaction savepoints are\nsupported by the engine.\n \nExamples\n-------- \nSHOW ENGINES\\G\n*************************** 1. row\n***************************\n Engine: InnoDB\n Support: DEFAULT\n Comment: Supports transactions, row-level locking, and\nforeign keys\nTransactions: YES\n XA: YES\n Savepoints: YES\n*************************** 2. row\n***************************\n Engine: CSV\n Support: YES\n Comment: CSV storage engine\nTransactions: NO\n XA: NO\n Savepoints: NO\n*************************** 3. row\n***************************\n Engine: MyISAM\n Support: YES\n Comment: MyISAM storage engine\nTransactions: NO\n XA: NO\n Savepoints: NO\n*************************** 4. row\n***************************\n Engine: BLACKHOLE\n Support: YES\n Comment: /dev/null storage engine (anything you write to it\ndisappears)\nTransactions: NO\n XA: NO\n Savepoints: NO\n*************************** 5. row\n***************************\n Engine: FEDERATED\n Support: YES\n Comment: FederatedX pluggable storage engine\nTransactions: YES\n XA: NO\n Savepoints: YES\n*************************** 6. row\n***************************\n Engine: MRG_MyISAM\n Support: YES\n Comment: Collection of identical MyISAM tables\nTransactions: NO\n XA: NO\n Savepoints: NO\n*************************** 7. row\n***************************\n Engine: ARCHIVE\n Support: YES\n Comment: Archive storage engine\nTransactions: NO\n XA: NO\n Savepoints: NO\n*************************** 8. row\n***************************\n Engine: MEMORY\n Support: YES\n Comment: Hash based, stored in memory, useful for temporary\ntables\nTransactions: NO\n XA: NO\n Savepoints: NO\n*************************** 9. row\n***************************\n Engine: PERFORMANCE_SCHEMA\n Support: YES\n Comment: Performance Schema\nTransactions: NO\n XA: NO\n Savepoints: NO\n*************************** 10. row\n***************************\n Engine: Aria\n Support: YES\n Comment: Crash-safe tables with MyISAM heritage\nTransactions: NO\n XA: NO\n Savepoints: NO\n10 rows in set (0.00 sec)\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-engines/','','https://mariadb.com/kb/en/library/show-engines/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (372,26,'SHOW ERRORS','Syntax\n------ \nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW ERRORS [LIMIT row_count OFFSET offset]\nSHOW COUNT(*) ERRORS\n \nDescription\n----------- \nThis statement is similar to SHOW WARNINGS, except that\ninstead of\ndisplaying errors, warnings, and notes, it displays only\nerrors.\n \nThe LIMIT clause has the same syntax as for the\nSELECT statement.\n \nThe SHOW COUNT(*) ERRORS statement displays the number of\nerrors. You can also retrieve this number from the\nerror_count variable.\n \nSHOW COUNT(*) ERRORS;\nSELECT @@error_count;\n \nThe value of error_count might be greater than the number of\nmessages displayed by SHOW WARNINGS if the max_error_count\nsystem variable is set so low that not all messages are\nstored.\n \nFor a list of MariaDB error codes, see MariaDB Error Codes.\n \nExamples\n-------- \nSELECT f();\nERROR 1305 (42000): FUNCTION f does not exist\n \nSHOW COUNT(*) ERRORS;\n \n+-----------------------+\n| @@session.error_count |\n+-----------------------+\n| 1 |\n+-----------------------+\n \nSHOW ERRORS;\n \n+-------+------+---------------------------+\n| Level | Code | Message |\n+-------+------+---------------------------+\n| Error | 1305 | FUNCTION f does not exist |\n+-------+------+---------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-errors/','','https://mariadb.com/kb/en/library/show-errors/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (373,26,'SHOW EVENTS','Syntax\n------ \nSHOW EVENTS [{FROM | IN} schema_name]\n [LIKE \'pattern\' | WHERE expr]\n \nDescription\n----------- \nShows information about Event Manager events (created with\nCREATE EVENT). Requires the EVENT privilege. Without any\narguments, SHOW EVENTS lists all of the events in the\ncurrent schema:\n \nSELECT CURRENT_USER(), SCHEMA();\n+----------------+----------+\n| CURRENT_USER() | SCHEMA() |\n+----------------+----------+\n| jon@ghidora | myschema |\n+----------------+----------+\n \nSHOW EVENTS\\G\n*************************** 1. row\n***************************\n Db: myschema\n Name: e_daily\n Definer: jon@ghidora\n Time zone: SYSTEM\n Type: RECURRING\n Execute at: NULL\n Interval value: 10\n Interval field: SECOND\n Starts: 2006-02-09 10:41:23\n Ends: NULL\n Status: ENABLED\n Originator: 0\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n \nTo see the event action, use SHOW CREATE EVENT instead, or\nlook at the information_schema.EVENTS table.\n \nTo see events for a specific schema, use the FROM clause.\nFor example, to see events for the test schema, use the\nfollowing statement:\n \nSHOW EVENTS FROM test;\n \nThe LIKE clause, if present, indicates which event names to\nmatch. The WHERE clause can be given to select rows using\nmore general conditions, as discussed in Extended Show.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-events/','','https://mariadb.com/kb/en/library/show-events/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (374,26,'SHOW EXPLAIN','The SHOW EXPLAIN command is a new feature in MariaDB 10.0.0.\n \nCommand description\n \nThe SHOW EXPLAIN command allows one to get an EXPLAIN (that\nis, a\ndescription of a query plan) of a query running in a certain\nthread.\n \nThe syntax is:\n \nSHOW EXPLAIN FOR ;\n \nwhich will produce an EXPLAIN output for the query that\nthread number thread_id is running. The thread id can be\nobtained with SHOW PROCESSLIST.\n \nSHOW EXPLAIN FOR 1;\n \n+------+-------------+-------+-------+---------------+------+---------+------+---------+-------------+\n| id | select_type | table | type | possible_keys | key |\nkey_len | ref | rows | Extra |\n+------+-------------+-------+-------+---------------+------+---------+------+---------+-------------+\n| 1 | SIMPLE | tbl | index | NULL | a | 5 | NULL | 1000107 |\nUsing index |\n+------+-------------+-------+-------+---------------+------+---------+------+---------+-------------+\n1 row in set, 1 warning (0.00 sec)\n \nThe output is always accompanied with a warning which shows\nthe query the\ntarget thread is running (this shows what the EXPLAIN is\nfor):\n \nSHOW WARNINGS;\n \n+-------+------+------------------------+\n| Level | Code | Message |\n+-------+------+------------------------+\n| Note | 1003 | select sum(a) from tbl |\n+-------+------+------------------------+\n1 row in set (0.00 sec)\n \nPossible errors\n \nThe output can be only produced if the target thread is\ncurrently running a\nquery, which has a ready query plan. If this is not the\ncase, the output will\nbe:\n \nSHOW EXPLAIN FOR 2;\n \nERROR 1932 (HY000): Target is not running an EXPLAINable\ncommand\n \nYou will get this error when:\nthe target thread is not running a command for which one can\nrun EXPLAIN\nthe target thread is running a command for which one can run\nEXPLAIN, but\nthere is no query plan yet (for example, tables are open and\nlocks are\n acquired before the query plan is produced)\n \n\nDifferences between SHOW EXPLAIN and EXPLAIN outputs\n \nBackground\n \nIn MySQL, EXPLAIN execution takes a slightly different route\nfrom the way\nthe real query (typically the SELECT) is optimized. This is\nunfortunate,\nand has caused a number of bugs in EXPLAIN. (For example,\nsee\nMDEV-326, MDEV-410, and\nlp:1013343.\nlp:992942 is not directly\nabout EXPLAIN, but it also would not have existed if MySQL\ndidn\'t try to delete\nparts of a query plan in the middle of the query) \n \nSHOW EXPLAIN examines a running SELECT, and hence its output\nmay be\nslightly different from what EXPLAIN SELECT would produce.\nWe did our best\nto make sure that either the difference is negligible, or\nSHOW EXPLAIN\'s\noutput is closer to reality than EXPLAIN\'s output.\n \nList of recorded differences\n \nSHOW EXPLAIN may have Extra=\'no matching row in const\ntable\', where EXPLAIN would produce Extra=\'Impossible\nWHERE ...\'\nFor queries with subqueries, SHOW EXPLAIN may print\nselect_type==PRIMARY where regular EXPLAIN used to print\nselect_type==SIMPLE, or vice versa.\n \nRequired permissions\n \nRunning SHOW EXPLAIN requires the same permissions as\nrunning SHOW PROCESSLIST would.\n \n\n\nURL: https://mariadb.com/kb/en/library/show-explain/','','https://mariadb.com/kb/en/library/show-explain/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (375,26,'SHOW FUNCTION CODE','Syntax\n------ \nSHOW FUNCTION CODE func_name\n \nDescription\n----------- \nSHOW FUNCTION CODE shows a representation of the internal\nimplementation of the stored function.\n \nIt is similar to SHOW PROCEDURE CODE but for stored\nfunctions.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-function-code/','','https://mariadb.com/kb/en/library/show-function-code/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (376,26,'SHOW FUNCTION STATUS','Syntax\n------ \nSHOW FUNCTION STATUS\n [LIKE \'pattern\' | WHERE expr]\n \nDescription\n----------- \nThis statement is similar to \nSHOW PROCEDURE STATUS but for\nstored functions.\n \nThe LIKE clause, if present on its own, indicates which\nfunction names to match. \n \nThe WHERE and LIKE clauses can be given to select rows using\nmore general conditions, as discussed in Extended SHOW.\n \nThe information_schema.ROUTINES table contains more detailed\ninformation.\n \nExamples\n-------- \nShowing all stored functions:\n \nSHOW FUNCTION STATUS\\G\n*************************** 1. row\n***************************\n Db: test\n Name: VatCents\n Type: FUNCTION\n Definer: root@localhost\n Modified: 2013-06-01 12:40:31\n Created: 2013-06-01 12:40:31\n Security_type: DEFINER\n Comment: \ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n \nStored functions whose name starts with \'V\': \n \nSHOW FUNCTION STATUS LIKE \'V%\' \\G\n*************************** 1. row\n***************************\n Db: test\n Name: VatCents\n Type: FUNCTION\n Definer: root@localhost\n Modified: 2013-06-01 12:40:31\n Created: 2013-06-01 12:40:31\n Security_type: DEFINER\n Comment: \ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n \nStored functions with a security type of \'DEFINER\':\n \nSHOW FUNCTION STATUS WHERE Security_type LIKE \'DEFINER\'\n\\G\n*************************** 1. row\n***************************\n Db: test\n Name: VatCents\n Type: FUNCTION\n Definer: root@localhost\n Modified: 2013-06-01 12:40:31\n Created: 2013-06-01 12:40:31\n Security_type: DEFINER\n Comment: \ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-function-status/','','https://mariadb.com/kb/en/library/show-function-status/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (377,26,'SHOW GRANTS','Users\n \nSyntax\n------ \nSHOW GRANTS [FOR user]\n \nDescription\n----------- \nThis statement lists the GRANT statement or\nstatements that must be issued to duplicate the privileges\nthat are granted to\na MariaDB user account. The account is named using the same\nformat as for the\nGRANT statement; for example,\n\'jeffrey\'@\'localhost\'. If you specify only the user name\npart\nof the account name, a host name part of \'%\' is used. For\nadditional information about specifying account names, see\nGRANT.\n \nSHOW GRANTS FOR \'root\'@\'localhost\';\n+---------------------------------------------------------------------+\n| Grants for root@localhost |\n+---------------------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'root\'@\'localhost\' WITH\nGRANT OPTION |\n+---------------------------------------------------------------------+\n \nTo list the privileges granted to the account that you are\nusing to\nconnect to the server, you can use any of the following\nstatements:\n \nSHOW GRANTS;\n \nSHOW GRANTS FOR CURRENT_USER;\n \nSHOW GRANTS FOR CURRENT_USER();\n \nIf SHOW GRANTS FOR CURRENT_USER (or any\nof the equivalent syntaxes) is used in DEFINER context (such\nas within a stored procedure that is defined with \n SQL SECURITY DEFINER), the grants displayed are those of\nthe\ndefiner and not the invoker.\n \nNote that the DELETE HISTORY privilege, introduced in\nMariaDB 10.3.4, is displayed as DELETE VERSIONING ROWS when\nrunning SHOW GRANTS (MDEV-17655).\n \nRoles\n \nRoles were introduced in MariaDB 10.0.5.\n \nSyntax\n------ \nSHOW GRANTS [FOR role]\n \nDescription\n----------- \nFrom MariaDB 10.0.5, SHOW GRANTS can also be used to view\nthe privileges granted to a role.\n \nExample\n \nSHOW GRANTS FOR journalist;\n+------------------------------------------+\n| Grants for journalist |\n+------------------------------------------+\n| GRANT USAGE ON *.* TO \'journalist\' |\n| GRANT DELETE ON `test`.* TO \'journalist\' |\n+------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/show-grants/','','https://mariadb.com/kb/en/library/show-grants/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (378,26,'SHOW INDEX','Syntax\n------ \nSHOW {INDEX | INDEXES | KEYS} \n FROM tbl_name [FROM db_name]\n [WHERE expr]\n \nDescription\n----------- \nSHOW INDEX returns table index information. The format\nresembles that of the SQLStatistics call in ODBC.\n \nYou can use db_name.tbl_name as an alternative to the\n tbl_name FROM db_name syntax. These two statements are\n equivalent:\n \nSHOW INDEX FROM mytable FROM mydb;\nSHOW INDEX FROM mydb.mytable;\n \nSHOW KEYS and SHOW INDEXES are synonyms for SHOW INDEX.\n \nYou can also list a table\'s indexes with the following\ncommand: \n \nmysqlshow -k db_name tbl_name\n \nSee mysqlshow for more details.\n \nThe information_schema.STATISTICS table stores similar\ninformation.\n \nThe following fields are returned by SHOW INDEX.\n \nField | Description | \n \nTable | Table name | \n \nNon_unique | 1 if the index permits duplicate values, 0 if\nvalues must be unique. | \n \nKey_name | Index name. The primary key is always named\nPRIMARY. | \n \nSeq_in_index | The column\'s sequence in the index,\nbeginning with 1. | \n \nColumn_name | Column name. | \n \nCollation | Either A, if the column is sorted in ascending\norder in the index, or NULL if it\'s not sorted. | \n \nCardinality | Estimated number of unique values in the\nindex. The cardinality statistics are calculated at various\ntimes, and can help the optimizer make improved decisions. |\n\n \nSub_part | NULL if the entire column is included in the\nindex, or the number of included characters if not. | \n \nPacked | NULL if the index is not packed, otherwise how the\nindex is packed. | \n \nNull | NULL if NULL values are permitted in the column, an\nempty string if NULL\'s are not permitted. | \n \nIndex_type | The index type, which can be BTREE, FULLTEXT,\nHASH or RTREE. See Storage Engine Index Types. | \n \nComment | Other information, such as whether the index is\ndisabled. | \n \nIndex_comment | Contents of the COMMENT attribute when the\nindex was created. | \n \nThe WHERE and LIKE clauses can be given to select rows using\nmore general conditions, as discussed in Extended SHOW.\n \nExamples\n-------- \nCREATE TABLE IF NOT EXISTS `employees_example` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `first_name` varchar(30) NOT NULL,\n `last_name` varchar(40) NOT NULL,\n `position` varchar(25) NOT NULL,\n `home_address` varchar(50) NOT NULL,\n `home_phone` varchar(12) NOT NULL,\n `employee_code` varchar(25) NOT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `employee_code` (`employee_code`),\n KEY `first_name` (`first_name`,`last_name`)\n) ENGINE=Aria;\n \nINSERT INTO `employees_example` (`first_name`, `last_name`,\n`position`, `home_address`, `home_phone`, `employee_code`)\n VALUES\n (\'Mustapha\', \'Mond\', \'Chief Executive Officer\', \'692\nPromiscuous Plaza\', \'326-555-3492\', \'MM1\'),\n (\'Henry\', \'Foster\', \'Store Manager\', \'314 Savage\nCircle\', \'326-555-3847\', \'HF1\'),\n (\'Bernard\', \'Marx\', \'Cashier\', \'1240 Ambient\nAvenue\', \'326-555-8456\', \'BM1\'),\n (\'Lenina\', \'Crowne\', \'Cashier\', \'281 Bumblepuppy\nBoulevard\', \'328-555-2349\', \'LC1\'),\n (\'Fanny\', \'Crowne\', \'Restocker\', \'1023 Bokanovsky\nLane\', \'326-555-6329\', \'FC1\'),\n (\'Helmholtz\', \'Watson\', \'Janitor\', \'944 Soma\nCourt\', \'329-555-2478\', \'HW1\');\n \nSHOW INDEXES FROM employees_example;\n \n+-------------------+------------+---------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+\n| Table | Non_unique | Key_name | Seq_in_index | Column_name\n| Collation | Cardinality | Sub_part | Packed | Null |\nIndex_type | Comment | Index_comment |\n+-------------------+------------+---------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+\n| employees_example | 0 | PRIMARY | 1 | id | A | 7 | NULL |\nNULL | | BTREE | | |\n| employees_example | 0 | employee_code | 1 | employee_code\n| A | 7 | NULL | NULL | | BTREE | | |\n| employees_example | 1 | first_name | 1 | first_name | A |\nNULL | NULL | NULL | | BTREE | | |\n| employees_example | 1 | first_name | 2 | last_name | A |\nNULL | NULL | NULL | | BTREE | | |\n+-------------------+------------+---------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-index/','','https://mariadb.com/kb/en/library/show-index/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (379,26,'SHOW LOCALES','SHOW LOCALES was introduced as part of the Information\nSchema plugin extension in MariaDB 10.1.1.\n \nSHOW LOCALES is used to return locales information as part\nof the Locales plugin. While the information_schema.LOCALES\ntable has 8 columns, the SHOW LOCALES statement will only\ndisplay 4 of them:\n \nExample\n \nSHOW LOCALES;\n+-----+-------+-------------------------------------+------------------------+\n| Id | Name | Description | Error_Message_Language |\n+-----+-------+-------------------------------------+------------------------+\n| 0 | en_US | English - United States | english |\n| 1 | en_GB | English - United Kingdom | english |\n| 2 | ja_JP | Japanese - Japan | japanese |\n| 3 | sv_SE | Swedish - Sweden | swedish |\n...\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-locales/','','https://mariadb.com/kb/en/library/show-locales/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (380,26,'SHOW MASTER STATUS','Syntax\n------ \nSHOW MASTER STATUS\n \nDescription\n----------- \nProvides status information about the binary log files of\nthe master.\n \nThis statement requires the SUPER or the REPLICATION_CLIENT\nprivilege.\n \nTo see information about the current GTIDs in the binary\nlog, use the\ngtid_binlog_pos variable.\n \nExample\n \nSHOW MASTER STATUS;\n+--------------------+----------+--------------+------------------+\n| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |\n+--------------------+----------+--------------+------------------+\n| mariadb-bin.000016 | 475 | | |\n+--------------------+----------+--------------+------------------+\nSELECT @@global.gtid_binlog_pos;\n+--------------------------+\n| @@global.gtid_binlog_pos |\n+--------------------------+\n| 0-1-2 |\n+--------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/show-master-status/','','https://mariadb.com/kb/en/library/show-master-status/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (381,26,'SHOW OPEN TABLES','Syntax\n------ \nSHOW OPEN TABLES [FROM db_name]\n [LIKE \'pattern\' | WHERE expr]\n \nDescription\n----------- \n SHOW OPEN TABLES lists the non-TEMPORARY\ntables that are currently open in the table cache. See\nhttp://dev.mysql.com/doc/refman/5.1/en/table-cache.html.\n \nThe FROM and LIKE clauses may be used.\n \nThe FROM\nclause, if present, restricts the tables shown to those\npresent in the\ndb_name database. \n \nThe LIKE clause, if\npresent on its own, indicates which table names to match.\nThe WHERE and LIKE clauses can be given to select rows using\nmore general conditions, as discussed in Extended SHOW.\n \nThe following information is returned:\n \nColumn | Description | \n \nDatabase | Database name. | \n \nName | Table name. | \n \nIn_use | Number of table instances being used. | \n \nName_locked | 1 if the table is name-locked, e.g. if it is\nbeing dropped or renamed, otherwise 0. | \n \nBefore MariaDB 5.5, each use of, for example, LOCK TABLE ...\nWRITE would increment In_use for that table. With the\nimplementation of the metadata locking improvements in\nMariaDB 5.5, LOCK TABLE... WRITE acquires a strong MDL lock,\nand concurrent connections will wait on this MDL lock, so\nany subsequent LOCK TABLE... WRITE will not increment\nIn_use.\n \nExample\n \nSHOW OPEN TABLES;\n \n+----------+---------------------------+--------+-------------+\n| Database | Table | In_use | Name_locked |\n+----------+---------------------------+--------+-------------+\n...\n| test | xjson | 0 | 0 |\n| test | jauthor | 0 | 0 |\n| test | locks | 1 | 0 |\n...\n+----------+---------------------------+--------+-------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-open-tables/','','https://mariadb.com/kb/en/library/show-open-tables/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (382,26,'SHOW PACKAGE BODY STATUS','Oracle-style packages were introduced in MariaDB 10.3.5.\n \nSyntax\n------ \nSHOW PACKAGE BODY STATUS\n [LIKE \'pattern\' | WHERE expr]\n \nDescription\n----------- \nThe SHOW PACKAGE BODY STATUS statement returns\ncharacteristics of stored package bodies (implementations),\nsuch as the database, name, type, creator, creation and\nmodification dates, and character set information. A similar\nstatement, SHOW PACKAGE STATUS, displays information about\nstored package specifications.\n \nThe LIKE clause, if present, indicates which package names\nto match. The WHERE and LIKE clauses can be given to select\nrows using more general conditions, as discussed in Extended\nSHOW.\n \nThe ROUTINES table in the INFORMATION_SCHEMA database\ncontains more detailed information.\n \nExamples\n-------- \nSHOW PACKAGE BODY STATUS LIKE \'pkg1\'\\G\n*************************** 1. row\n***************************\n Db: test\n Name: pkg1\n Type: PACKAGE BODY\n Definer: root@localhost\n Modified: 2018-02-27 14:44:14\n Created: 2018-02-27 14:44:14\n Security_type: DEFINER\n Comment: This is my first package body\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/show-package-body-status/','','https://mariadb.com/kb/en/library/show-package-body-status/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (383,26,'SHOW PACKAGE STATUS','Oracle-style packages were introduced in MariaDB 10.3.5.\n \nSyntax\n------ \nSHOW PACKAGE STATUS\n [LIKE \'pattern\' | WHERE expr]\n \nDescription\n----------- \nThe SHOW PACKAGE STATUS statement returns characteristics of\nstored package specifications, such as the database, name,\ntype, creator, creation and modification dates, and\ncharacter set information. A similar statement, SHOW PACKAGE\nBODY STATUS, displays information about stored package\nbodies (i.e. implementations).\n \nThe LIKE clause, if present, indicates which package names\nto match. The WHERE and LIKE clauses can be given to select\nrows using more general conditions, as discussed in Extended\nSHOW.\n \nThe ROUTINES table in the INFORMATION_SCHEMA database\ncontains more detailed information.\n \nExamples\n-------- \nSHOW PACKAGE STATUS LIKE \'pkg1\'\\G\n*************************** 1. row\n***************************\n Db: test\n Name: pkg1\n Type: PACKAGE\n Definer: root@localhost\n Modified: 2018-02-27 14:38:15\n Created: 2018-02-27 14:38:15\n Security_type: DEFINER\n Comment: This is my first package\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n \n\n\nURL: https://mariadb.com/kb/en/library/show-package-status/','','https://mariadb.com/kb/en/library/show-package-status/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (384,26,'SHOW PLUGINS','Syntax\n------ \nSHOW PLUGINS;\n \nDescription\n----------- \n SHOW PLUGINS displays information about installed plugins.\nThe Library column indicates the plugin library - if it is\nNULL, the plugin is built-in and cannot be uninstalled.\n \nThe PLUGINS table in the information_schema database\ncontains more detailed information.\n \nFor specific information about storage engines (a particular\ntype of plugin), see the information_schema.ENGINES table\nand the SHOW ENGINES statement.\n \nExamples\n-------- \nSHOW PLUGINS;\n+----------------------------+----------+--------------------+-------------+---------+\n| Name | Status | Type | Library | License |\n+----------------------------+----------+--------------------+-------------+---------+\n| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |\n| mysql_native_password | ACTIVE | AUTHENTICATION | NULL |\nGPL |\n| mysql_old_password | ACTIVE | AUTHENTICATION | NULL | GPL\n|\n| MRG_MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |\n| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |\n| CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |\n| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |\n| FEDERATED | ACTIVE | STORAGE ENGINE | NULL | GPL |\n| PERFORMANCE_SCHEMA | ACTIVE | STORAGE ENGINE | NULL | GPL\n|\n| Aria | ACTIVE | STORAGE ENGINE | NULL | GPL |\n| InnoDB | ACTIVE | STORAGE ENGINE | NULL | GPL |\n| INNODB_TRX | ACTIVE | INFORMATION SCHEMA | NULL | GPL |\n...\n| INNODB_SYS_FOREIGN | ACTIVE | INFORMATION SCHEMA | NULL |\nGPL |\n| INNODB_SYS_FOREIGN_COLS | ACTIVE | INFORMATION SCHEMA |\nNULL | GPL |\n| SPHINX | ACTIVE | STORAGE ENGINE | NULL | GPL |\n| ARCHIVE | ACTIVE | STORAGE ENGINE | NULL | GPL |\n| BLACKHOLE | ACTIVE | STORAGE ENGINE | NULL | GPL |\n| FEEDBACK | DISABLED | INFORMATION SCHEMA | NULL | GPL |\n| partition | ACTIVE | STORAGE ENGINE | NULL | GPL |\n| pam | ACTIVE | AUTHENTICATION | auth_pam.so | GPL |\n+----------------------------+----------+--------------------+-------------+---------+\n \n\n\nURL: https://mariadb.com/kb/en/library/show-plugins/','','https://mariadb.com/kb/en/library/show-plugins/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (385,26,'SHOW PLUGINS SONAME','MariaDB 10.0.2\n \nSHOW PLUGINS SONAME was introduced in MariaDB 10.0.2\n \nSyntax\n------ \nSHOW PLUGINS SONAME { library | LIKE \'pattern\' | WHERE\nexpr };\n \nDescription\n----------- \nSHOW PLUGINS SONAME displays information about compiled-in\nand all server plugins in the plugin_dir directory,\nincluding plugins that haven\'t been installed.\n \nExamples\n-------- \nSHOW PLUGINS SONAME \'ha_example.so\';\n+----------+---------------+----------------+---------------+---------+\n| Name | Status | Type | Library | License |\n+----------+---------------+----------------+---------------+---------+\n| EXAMPLE | NOT INSTALLED | STORAGE ENGINE | ha_example.so |\nGPL |\n| UNUSABLE | NOT INSTALLED | DAEMON | ha_example.so | GPL |\n+----------+---------------+----------------+---------------+---------+\n \nThere is also a corresponding information_schema table,\ncalled ALL_PLUGINS, which contains more complete\ninformation.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-plugins-soname/','','https://mariadb.com/kb/en/library/show-plugins-soname/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (386,26,'SHOW PRIVILEGES','Syntax\n------ \nSHOW PRIVILEGES\n \nDescription\n----------- \n SHOW PRIVILEGES shows the list of system privileges that\nthe MariaDB server supports. The exact list of privileges\ndepends on the version of your server.\n \nExamples\n-------- \nSHOW PRIVILEGES;\n+-------------------------+---------------------------------------+-------------------------------------------------------+\n| Privilege | Context | Comment |\n+-------------------------+---------------------------------------+-------------------------------------------------------+\n| Alter | Tables | To alter the table |\n| Alter routine | Functions,Procedures | To alter or drop\nstored functions/procedures |\n| Create | Databases,Tables,Indexes | To create new\ndatabases and tables |\n| Create routine | Databases | To use CREATE\nFUNCTION/PROCEDURE |\n| Create temporary tables | Databases | To use CREATE\nTEMPORARY TABLE |\n| Create view | Tables | To create new views |\n| Create user | Server Admin | To create new users |\n| Delete | Tables | To delete existing rows |\n| Drop | Databases,Tables | To drop databases, tables, and\nviews |\n| Event | Server Admin | To create, alter, drop and execute\nevents |\n| Execute | Functions,Procedures | To execute stored\nroutines |\n| File | File access on server | To read and write files on\nthe server |\n| Grant option | Databases,Tables,Functions,Procedures | To\ngive to other users those privileges you possess |\n| Index | Tables | To create or drop indexes |\n| Insert | Tables | To insert data into tables |\n| Lock tables | Databases | To use LOCK TABLES (together\nwith SELECT privilege) |\n| Process | Server Admin | To view the plain text of\ncurrently executing queries |\n| Proxy | Server Admin | To make proxy user possible |\n| References | Databases,Tables | To have references on\ntables |\n| Reload | Server Admin | To reload or refresh tables, logs\nand privileges |\n| Replication client | Server Admin | To ask where the slave\nor master servers are |\n| Replication slave | Server Admin | To read binary log\nevents from the master |\n| Select | Tables | To retrieve rows from table |\n| Show databases | Server Admin | To see all databases with\nSHOW DATABASES |\n| Show view | Tables | To see views with SHOW CREATE VIEW |\n| Shutdown | Server Admin | To shut down the server |\n| Super | Server Admin | To use KILL thread, SET GLOBAL,\nCHANGE MASTER, etc. |\n| Trigger | Tables | To use triggers |\n| Create tablespace | Server Admin | To create/alter/drop\ntablespaces |\n| Update | Tables | To update existing rows |\n| Usage | Server Admin | No privileges - allow connect only\n|\n+-------------------------+---------------------------------------+-------------------------------------------------------+\n31 rows in set (0.07 sec)\n \n\n\nURL: https://mariadb.com/kb/en/library/show-privileges/','','https://mariadb.com/kb/en/library/show-privileges/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (387,26,'SHOW PROCEDURE CODE','Syntax\n------ \nSHOW PROCEDURE CODE proc_name\n \nDescription\n----------- \nThis statement is a MariaDB extension that is available only\nfor servers that\nhave been built with debugging support. It displays a\nrepresentation of the\ninternal implementation of the named stored procedure. A\nsimilar statement,\n SHOW FUNCTION CODE, displays\ninformation about stored functions.\n \nBoth statements require that you be the owner of the routine\nor have\n SELECT access to the mysql.proc table.\n \nIf the named routine is available, each statement produces a\nresult\nset. Each row in the result set corresponds to one\n\"instruction\" in\nthe routine. The first column is Pos, which is an ordinal\nnumber\nbeginning with 0. The second column is Instruction, which\ncontains an\nSQL statement (usually changed from the original source), or\na\ndirective which has meaning only to the stored-routine\nhandler.\n \nExamples\n-------- \nDELIMITER //\n \nCREATE PROCEDURE p1 ()\n BEGIN\n DECLARE fanta INT DEFAULT 55;\n DROP TABLE t2;\n LOOP\n INSERT INTO t3 VALUES (fanta);\n END LOOP;\n END//\nQuery OK, 0 rows affected (0.00 sec)\n \nSHOW PROCEDURE CODE p1//\n+-----+----------------------------------------+\n| Pos | Instruction |\n+-----+----------------------------------------+\n| 0 | set fanta@0 55 |\n| 1 | stmt 9 \"DROP TABLE t2\" |\n| 2 | stmt 5 \"INSERT INTO t3 VALUES (fanta)\" |\n| 3 | jump 2 |\n+-----+----------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/show-procedure-code/','','https://mariadb.com/kb/en/library/show-procedure-code/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (388,26,'SHOW PROCEDURE STATUS','Syntax\n------ \nSHOW PROCEDURE STATUS\n [LIKE \'pattern\' | WHERE expr]\n \nDescription\n----------- \nThis statement is a MariaDB extension. It returns\ncharacteristics of a stored\nprocedure, such as the database, name, type, creator,\ncreation and modification\ndates, and character set information. A similar statement, \n SHOW FUNCTION STATUS, displays\ninformation about stored functions.\n \nThe LIKE clause, if present, indicates which procedure or\nfunction names to match. The WHERE and LIKE clauses can be\ngiven to select rows using more general conditions, as\ndiscussed in Extended SHOW.\n \nThe ROUTINES table in the INFORMATION_SCHEMA database\ncontains more detailed information.\n \nExamples\n-------- \nSHOW PROCEDURE STATUS LIKE \'p1\'\\G\n*************************** 1. row\n***************************\n Db: test\n Name: p1\n Type: PROCEDURE\n Definer: root@localhost\n Modified: 2010-08-23 13:23:03\n Created: 2010-08-23 13:23:03\n Security_type: DEFINER\n Comment: \ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/show-procedure-status/','','https://mariadb.com/kb/en/library/show-procedure-status/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (389,26,'SHOW PROCESSLIST','Syntax\n------ \nSHOW [FULL] PROCESSLIST\n \nDescription\n----------- \n SHOW PROCESSLIST shows you which threads are running. You\ncan also get this information from the\ninformation_schema.PROCESSLIST table or the mysqladmin\nprocesslist command. If you have the \nPROCESS privilege, you can see all threads.\nOtherwise, you can see only your own threads (that is,\nthreads associated with\nthe MariaDB account that you are using). If you do not use\nthe\nFULL keyword, only the first 100 characters of each\nstatement are shown in the Info field.\n \nThe columns shown in SHOW PROCESSLIST\n are:\n \nName | Description | Introduced | \n \nID | The client\'s process ID. | | \n \nUSER | The username associated with the process. | | \n \nHOST | The host the client is connected to. | | \n \nDB | The default database of the process (NULL if no\ndefault). | | \n \nCOMMAND | The command type. See Thread Command Values. | | \n \nTIME | The amount of time, in seconds, the process has been\nin its current state. For a slave SQL thread before MariaDB\n10.1, this is the time in seconds between the last\nreplicated event\'s timestamp and the slave machine\'s real\ntime. | | \n \nSTATE | See Thread States. | | \n \nINFO | The statement being executed. | | \n \nPROGRESS | The total progress of the process (0-100%) (see\nProgress Reporting). | MariaDB 5.3 | \n \nSee TIME_MS column in information_schema.PROCESSLIST for\ndifferences in the TIME column between MariaDB and MySQL.\n \nThe information_schema.PROCESSLIST table contains the\nfollowing additional columns:\n \nName | Description | Introduced | \n \nTIME_MS | The amount of time, in milliseconds, the process\nhas been in its current state. | MariaDB 5.1 | \n \nSTAGE | The stage the process is currently in. |\nMariaDB 5.3 | \n \nMAX_STAGE | The maximum number of stages. | MariaDB 5.3 | \n \nPROGRESS | The progress of the process within the current\nstage (0-100%). | MariaDB 5.3 | \n \nMEMORY_USED | The amount of memory used by the process. |\nMariaDB 10.0.1 | \n \nEXAMINED_ROWS | The number of rows the process has examined.\n| MariaDB 10.0.1 | \n \nQUERY_ID | Query ID. | MariaDB 10.0.5 | \n \nNote that the PROGRESS field from the information schema,\nand the PROGRESS field from SHOW PROCESSLIST display\ndifferent results. SHOW PROCESSLIST shows the total\nprogress, while the information schema shows the progress\nfor the current stage only.\n \nThreads can be killed using their thread_id, or, since\nMariaDB 10.0.5, their query_id, with the KILL statement.\n \nSince queries on this table are locking, if the\nperformance_schema is enabled, you may want to query the\nTHREADS table instead.\n \nExamples\n-------- \nFrom MariaDB 5.1.x\n \nSHOW FULL PROCESSLIST;\n+---------+-------+-----------+------+---------+------+-------+-----------------------+\n| Id | User | Host | db | Command | Time | State | Info |\n+---------+-------+-----------+------+---------+------+-------+-----------------------+\n| 1988880 | dbart | localhost | NULL | Query | 0 | NULL |\nSHOW FULL PROCESSLIST |\n+---------+-------+-----------+------+---------+------+-------+-----------------------+\n \nSELECT * FROM information_schema.processlist;\n+---------+-------+-----------+------+---------+------+-----------+----------------------------------------------+---------+\n| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO |\nTIME_MS |\n+---------+-------+-----------+------+---------+------+-----------+----------------------------------------------+---------+\n| 1988880 | dbart | localhost | NULL | Query | 0 | executing\n| SELECT * FROM information_schema.processlist | 0.444 |\n+---------+-------+-----------+------+---------+------+-----------+----------------------------------------------+---------+\n \nFrom MariaDB 5.5.x\n \nSHOW FULL PROCESSLIST;\n+-----+------+-----------+------+---------+------+-------+-----------------------+----------+\n| Id | User | Host | db | Command | Time | State | Info |\nProgress |\n+-----+------+-----------+------+---------+------+-------+-----------------------+----------+\n| 126 | root | localhost | NULL | Query | 0 | NULL | SHOW\nFULL PROCESSLIST | 0.000 |\n+-----+------+-----------+------+---------+------+-------+-----------------------+----------+\n \nSELECT * FROM information_schema.processlist;\n+-----+--------+-----------+------+---------+------+-----------+----------------------------------------------+---------+-------+-----------+----------+\n| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO |\nTIME_MS | STAGE | MAX_STAGE | PROGRESS |\n+-----+--------+-----------+------+---------+------+-----------+----------------------------------------------+---------+-------+-----------+----------+\n| 126 | root | localhost | NULL | Query | 0 | executing |\nSELECT * FROM information_schema.processlist | 344.718 | 0 |\n0 | 0.000 |\n+-----+--------+-----------+------+---------+------+-----------+----------------------------------------------+---------+-------+-----------+----------+\n \nFrom MariaDB 10.0.x\n \nSHOW PROCESSLIST;\n+----+-----------------+-----------+------+---------+------+------------------------+------------------+----------+\n| Id | User | Host | db | Command | Time | State | Info |\nProgress |\n+----+-----------------+-----------+------+---------+------+------------------------+------------------+----------+\n| 2 | event_scheduler | localhost | NULL | Daemon | 2693 |\nWaiting on empty queue | NULL | 0.000 |\n| 4 | root | localhost | NULL | Query | 0 | Table lock |\nSHOW PROCESSLIST | 0.000 |\n+----+-----------------+-----------+------+---------+------+------------------------+------------------+----------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-processlist/','','https://mariadb.com/kb/en/library/show-processlist/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (390,26,'SHOW PROFILE','Syntax\n------ \nSHOW PROFILE [type [, type] ... ]\n [FOR QUERY n]\n [LIMIT row_count [OFFSET offset]]\n \ntype:\n ALL\n | BLOCK IO\n | CONTEXT SWITCHES\n | CPU\n | IPC\n | MEMORY\n | PAGE FAULTS\n | SOURCE\n | SWAPS\n \nDescription\n----------- \nThe SHOW PROFILE and \nSHOW PROFILES statements display profiling\ninformation that indicates resource usage for statements\nexecuted during the\ncourse of the current session.\n \nProfiling is controlled by the profiling session variable,\nwhich has a default value of 0 (OFF). Profiling is enabled\nby setting profiling to 1 or ON:\n \nSET profiling = 1;\n \nSHOW PROFILES displays a list of the most recent statements\nsent to the master. The size of the list is controlled by\nthe\nprofiling_history_size session variable, which has a default\nvalue of 15. The maximum value is 100. Setting the value to\n0 has the practical effect of disabling profiling.\n \nAll statements are profiled except SHOW PROFILES and \nSHOW PROFILE, so you will find neither of those statements\nin the profile list. Malformed statements are profiled. For\nexample, \n SHOW PROFILING is an illegal statement, and a syntax error\noccurs if you try to execute it, but it will show up in the\nprofiling list.\n \n SHOW PROFILE displays detailed information about a single\nstatement. Without the FOR QUERY n clause, the output\npertains to the most recently executed statement. If \n FOR QUERY n is included,\n SHOW PROFILE displays information for statement n. The\nvalues of n correspond to\nthe Query_ID values displayed by SHOW PROFILES.\n \nThe LIMIT row_count clause may be given to limit the\noutput to row_count rows. If LIMIT is given, \n OFFSET offset may be added to begin the output offset\nrows into the full set of rows.\n \nBy default, SHOW PROFILE displays Status and Duration\ncolumns. The Status values are like the State values\ndisplayed by \nSHOW PROCESSLIST,\nalthough there might be some minor differences in\ninterpretation for\nthe two statements for some status values (see\nhttp://dev.mysql.com/doc/refman/5.6/en/thread-information.html).\n \nOptional type values may be specified to display specific\nadditional\ntypes of information:\nALL displays all information\nBLOCK IO displays counts for block input and output\noperations\nCONTEXT SWITCHES displays counts for voluntary and\ninvoluntary context switches\nCPU displays user and system CPU usage times\nIPC displays counts for messages sent and received\nMEMORY is not currently implemented\nPAGE FAULTS displays counts for major and minor page faults\nSOURCE displays the names of functions from the source code,\ntogether with the name and line number of the file in which\nthe function occurs\nSWAPS displays swap counts\n \nProfiling is enabled per session. When a session ends, its\nprofiling information is lost.\n \nThe information_schema.PROFILING table contains similar\ninformation.\n \nExamples\n-------- \nSELECT @@profiling;\n+-------------+\n| @@profiling |\n+-------------+\n| 0 |\n+-------------+\n \nSET profiling = 1;\n \nUSE test;\n \nDROP TABLE IF EXISTS t1;\n \nCREATE TABLE T1 (id INT);\n \nSHOW PROFILES;\n+----------+------------+--------------------------+\n| Query_ID | Duration | Query |\n+----------+------------+--------------------------+\n| 1 | 0.00009200 | SELECT DATABASE() |\n| 2 | 0.00023800 | show databases |\n| 3 | 0.00018900 | show tables |\n| 4 | 0.00014700 | DROP TABLE IF EXISTS t1 |\n| 5 | 0.24476900 | CREATE TABLE T1 (id INT) |\n+----------+------------+--------------------------+\n \nSHOW PROFILE;\n+----------------------+----------+\n| Status | Duration |\n+----------------------+----------+\n| starting | 0.000042 |\n| checking permissions | 0.000044 |\n| creating table | 0.244645 |\n| After create | 0.000013 |\n| query end | 0.000003 |\n| freeing items | 0.000016 |\n| logging slow query | 0.000003 |\n| cleaning up | 0.000003 |\n+----------------------+----------+\n \nSHOW PROFILE FOR QUERY 4;\n+--------------------+----------+\n| Status | Duration |\n+--------------------+----------+\n| starting | 0.000126 |\n| query end | 0.000004 |\n| freeing items | 0.000012 |\n| logging slow query | 0.000003 |\n| cleaning up | 0.000002 |\n+--------------------+----------+\n \nSHOW PROFILE CPU FOR QUERY 5;\n+----------------------+----------+----------+------------+\n| Status | Duration | CPU_user | CPU_system |\n+----------------------+----------+----------+------------+\n| starting | 0.000042 | 0.000000 | 0.000000 |\n| checking permissions | 0.000044 | 0.000000 | 0.000000 |\n| creating table | 0.244645 | 0.000000 | 0.000000 |\n| After create | 0.000013 | 0.000000 | 0.000000 |\n| query end | 0.000003 | 0.000000 | 0.000000 |\n| freeing items | 0.000016 | 0.000000 | 0.000000 |\n| logging slow query | 0.000003 | 0.000000 | 0.000000 |\n| cleaning up | 0.000003 | 0.000000 | 0.000000 |\n+----------------------+----------+----------+------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-profile/','','https://mariadb.com/kb/en/library/show-profile/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (391,26,'SHOW PROFILES','Syntax\n------ \nSHOW PROFILES\n \nDescription\n----------- \nThe SHOW PROFILES statement displays profiling information\nthat indicates resource usage for statements executed during\nthe course of the\ncurrent session. It is used together with \nSHOW PROFILE.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-profiles/','','https://mariadb.com/kb/en/library/show-profiles/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (392,26,'SHOW QUERY_RESPONSE_TIME','SHOW QUERY_RESPONSE_TIME was introduced in MariaDB 10.1.1.\n \nStarting with MariaDB 10.1.1, which introduced the\nInformation Schema plugin extension, it is possible to use\nSHOW QUERY_RESPONSE_TIME as an alternative for retrieving\ninformation from the QUERY_RESPONSE_TIME plugin.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/show-query_response_time/','','https://mariadb.com/kb/en/library/show-query_response_time/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (393,26,'SHOW RELAYLOG EVENTS','Syntax\n------ \nSHOW RELAYLOG [\'connection_name\'] EVENTS\n [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\n \nDescription\n----------- \nOn replication slaves this command shows the events in the\nrelay log. If \'log_name\' is not specified, the first relay\nlog is shown.\n \nSyntax for the LIMIT clause is the same as for SELECT ...\nLIMIT.\n \nUsing the LIMIT clause is highly recommended because the\nSHOW RELAYLOG EVENTS command returns the complete contents\nof the relay log, which can be quite large.\n \nThis command does not return events related to setting user\nand system variables. If you need those, use mysqlbinlog.\n \nOn the replication master, this command does nothing.\n \nconnection_name\n \nconnection_name was added as part of multi-source\nreplication added in MariaDB 10.0.1\n \nIf there is only one nameless master, or the default master\n(as specified by the default_master_connection system\nvariable) is intended, connection_name can be omitted. If\nprovided, the SHOW RELAYLOG statement will apply to the\nspecified master. connection_name is case-insensitive.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-relaylog-events/','','https://mariadb.com/kb/en/library/show-relaylog-events/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (394,26,'SHOW SLAVE HOSTS','Syntax\n------ \nSHOW SLAVE HOSTS\n \nDescription\n----------- \nThis command is run on the master and displays a list of\nreplication slaves that are currently registered with it.\nOnly slaves started with the --report-host=host_name option\nare visible in this list.\n \nThe list is displayed on any server (not just the master\nserver). The output\nlooks like this:\n \nSHOW SLAVE HOSTS;\n+------------+-----------+------+-----------+\n| Server_id | Host | Port | Master_id |\n+------------+-----------+------+-----------+\n| 192168010 | iconnect2 | 3306 | 192168011 |\n| 1921680101 | athena | 3306 | 192168011 |\n+------------+-----------+------+-----------+\nServer_id: The unique server ID of the slave server, as\nconfigured in the server\'s option file, or on the command\nline with --server-id=value.\nHost: The host name of the slave server, as configured in\nthe server\'s option file, or on the command line with\n--report-host=host_name. Note that this can differ from the\nmachine name as configured in the operating system.\nPort: The port the slave server is listening on.\nMaster_id: The unique server ID of the master server that\nthe slave server is replicating from.\n \nSome MariaDB and MySQL versions report another variable,\nrpl_recovery_rank. This\nvariable was never used, and was eventually removed in\nMariaDB 10.1.2 and MySQL 5.6.\n \n\n\nURL: https://mariadb.com/kb/en/library/show-slave-hosts/','','https://mariadb.com/kb/en/library/show-slave-hosts/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (395,26,'SHOW SLAVE STATUS','Syntax\n------ \nSHOW SLAVE [\"connection_name\"] STATUS\n \nor\n \nSHOW ALL SLAVES STATUS\n \nDescription\n----------- \nThis statement is to be run on a slave and provides status\ninformation on essential parameters of the replication slave\nthreads.\n \nThis statement requires the SUPER or the REPLICATION_CLIENT\nprivilege.\n \nMulti-source\n \nMariaDB 10.0 introduced the FULL and \"connection_name\"\noptions to\nallow you to connect to many masters at the same time.\n \nALL SLAVES gives you a list of all connections to the\nmaster.\n \nThe rows will be sorted according to Connection_name.\n \nIf you specify a connection_name, you only get the\ninformation about that\nconnection. If connection_name is not used, then the name\nset by default_master_connection is used. If the connection\nname doesn\'t exist you will get an error:\nThere is no master connection for \'xxx\'.\n \nColumn descriptions\n \nName | Description | Added | \n \nConnection_name | Name of the master connection. Returned\nwith SHOW ALL SLAVES STATUS only. | MariaDB 10.0 | \n \nSlave_SQL_State | State of SQL thread. Returned with SHOW\nALL SLAVES STATUS only. See Slave SQL Thread States. |\nMariaDB 10.0 | \n \nSlave_IO_State | State of I/O thread. See Slave I/O Thread\nStates. | MariaDB 10.0 | \n \nMaster_host | Master host that the slave is connected to. | \n| \n \nMaster_user | Account user name being used to connect to the\nmaster. | | \n \nMaster_port | The port being used to connect to the master.\n| | \n \nConnect_Retry | Time in seconds between retries to connect.\nThe default is 60. The CHANGE MASTER TO statement can set\nthis. The master-retry-count option determines the maximum\nnumber of reconnection attempts. | | \n \nMaster_Log_File | Name of the master binary log file that\nthe I/O thread is currently reading from. | | \n \nRead_Master_Log_Pos | Position up to which the I/O thread\nhas read in the current master binary log file. | | \n \nRelay_Log_File | Name of the relay log file that the SQL\nthread is currently processing. | | \n \nRelay_Log_Pos | Position up to which the SQL thread has\nfinished processing in the current relay log file. | | \n \nRelay_Master_Log_File | Name of the master binary log file\nthat contains the most recent event executed by the SQL\nthread. | | \n \nSlave_IO_Running | Whether the slave I/O thread is running\nand connected (Yes), running but not connected to a master\n(Connecting) or not running (No). | | \n \nSlave_SQL_Running | Whether or not the SQL thread is\nrunning. | | \n \nReplicate_Do_DB | Databases specified for replicating with\nthe replicate_do_db option. | | \n \nReplicate_Ignore_DB | Databases specified for ignoring with\nthe replicate_ignore_db option. | | \n \nReplicate_Do_Table | Tables specified for replicating with\nthe replicate_do_table option. | | \n \nReplicate_Ignore_Table | Tables specified for ignoring with\nthe replicate_ignore_table option. | | \n \nReplicate_Wild_Do_Table | Tables specified for replicating\nwith the replicate_wild_do_table option. | | \n \nReplicate_Wild_Ignore_Table | Tables specified for ignoring\nwith the replicate_wild_ignore_table option. | | \n \nLast_Errno | Alias for Last_SQL_Errno (see below) | | \n \nLast Error | Alias for Last_SQL_Error (see below) | | \n \nSkip_Counter | Number of events that a slave skips from the\nmaster, as recorded in the sql_slave_skip_counter system\nvariable. | | \n \nExec_Master_Log_Pos | Position up to which the SQL thread\nhas processed in the current master binary log file. Can be\nused to start a new slave from a current slave with the\nCHANGE MASTER TO ... MASTER_LOG_POS option. | | \n \nRelay_Log_Space | Total size of all relay log files\ncombined. | | \n \nUntil_Condition | | | \n \nUntil_Log_File | The MASTER_LOG_FILE value of the START\nSLAVE UNTIL condition. | | \n \nUntil_Log_Pos | The MASTER_LOG_POS value of the START SLAVE\nUNTIL condition. | | \n \nMaster_SSL_Allowed | Whether an SSL connection is permitted\n(Yes), not permitted (No) or permitted but without the slave\nhaving SSL support enabled (Ignored) | | \n \nMaster_SSL_CA_File | The MASTER_SSL_CA option of the CHANGE\nMASTER TO statement. | | \n \nMaster_SSL_CA_Path | The MASTER_SSL_CAPATH option of the\nCHANGE MASTER TO statement. | | \n \nMaster_SSL_Cert | The MASTER_SSL_CERT option of the CHANGE\nMASTER TO statement. | | \n \nMaster_SSL_Cipher | The MASTER_SSL_CIPHER option of the\nCHANGE MASTER TO statement. | | \n \nMaster_SSL_Key | The MASTER_SSL_KEY option of the CHANGE\nMASTER TO statement. | | \n \nSeconds_Behind_Master | Difference between the timestamp\nlogged on the master for the event that the slave is\ncurrently processing, and the current timestamp on the\nslave. Zero if the slave is not currently processing an\nevent. From MariaDB 10.0.23 and MariaDB 10.1.9, with\nparallel replication, seconds_behind_master is updated only\nafter transactions commit. | | \n \nMaster_SSL_Verify_Server_Cert | The\nMASTER_SSL_VERIFY_SERVER_CERT option of the CHANGE MASTER TO\nstatement. | | \n \nLast_IO_Errno | Error code of the most recent error that\ncaused the I/O thread to stop (also recorded in the slave\'s\nerror log). 0 means no error. RESET SLAVE or RESET MASTER\nwill reset this value. | | \n \nLast_IO_Error | Error message of the most recent error that\ncaused the I/O thread to stop (also recorded in the slave\'s\nerror log). An empty string means no error. RESET SLAVE or\nRESET MASTER will reset this value. | | \n \nLast_SQL_Errno | Error code of the most recent error that\ncaused the SQL thread to stop (also recorded in the slave\'s\nerror log). 0 means no error. RESET SLAVE or RESET MASTER\nwill reset this value. | | \n \nLast_SQL_Error | Error message of the most recent error that\ncaused the SQL thread to stop (also recorded in the slave\'s\nerror log). An empty string means no error. RESET SLAVE or\nRESET MASTER will reset this value. | | \n \nReplicate_Ignore_Server_Ids | List of server_ids that are\ncurrently being ignored for replication purposes, or an\nempty string for none, as specified in the IGNORE_SERVER_IDS\noption of the CHANGE MASTER TO statement. | | \n \nMaster_Server_Id | The master\'s server_id value. | | \n \nMaster_SSL_Crl | The MASTER_SSL_CRL option of the CHANGE\nMASTER TO statement. | MariaDB 10.0 | \n \nMaster_SSL_Crlpath | The MASTER_SSL_CRLPATH option of the\nCHANGE MASTER TO statement. | MariaDB 10.0 | \n \nUsing_Gtid | Whether or not global transaction ID\'s are\nbeing used for replication (can be No, Slave_Pos, or\nCurrent_Pos). | MariaDB 10.0.2 | \n \nGtid_IO_Pos | Current global transaction ID value. | MariaDB\n10.0.2 | \n \nRetried_transactions | Number of retried transactions for\nthis connection. Returned with SHOW ALL SLAVES STATUS only.\n| MariaDB 10.0 | \n \nMax_relay_log_size | Max relay log size for this connection.\nReturned with SHOW ALL SLAVES STATUS only. | MariaDB 10.0 | \n \nExecuted_log_entries | How many log entries the slave has\nexecuted. Returned with SHOW ALL SLAVES STATUS only. |\nMariaDB 10.0 | \n \nSlave_received_heartbeats | How many heartbeats we have got\nfrom the master. Returned with SHOW ALL SLAVES STATUS only.\n| MariaDB 10.0 | \n \nSlave_heartbeat_period | How often to request a heartbeat\npacket from the master (in seconds). Returned with SHOW ALL\nSLAVES STATUS only. | MariaDB 10.0 | \n \nGtid_Slave_Pos | GTID of the last event group replicated on\na slave server, for each replication domain, as stored in\nthe gtid_slave_pos system variable. Returned with SHOW ALL\nSLAVES STATUS only. | MariaDB 10.0 | \n \nSQL_Delay | Value specified by MASTER_DELAY in CHANGE MASTER\n(or 0 if none). | MariaDB 10.2.3 | \n \nSQL_Remaining_Delay | When the slave is delaying the\nexecution of an event due to MASTER_DELAY, this is the\nnumber of seconds of delay remaining before the event will\nbe applied. Otherwise, the value is NULL. | MariaDB 10.2.3 |\n\n \nSlave_SQL_Running_State | The state of the SQL driver\nthreads, same as in SHOW PROCESSLIST. When the slave is\ndelaying the execution of an event due to MASTER_DELAY, this\nfield displays: \"Waiting until MASTER_DELAY seconds after\nmaster executed event\". | MariaDB 10.2.3 | \n \nExamples\n-------- \nIf you issue this statement using the mysql client,\nyou can use a \\G statement terminator rather than a\nsemicolon to\nobtain a more readable vertical layout.\n \nSHOW SLAVE STATUS\\G\n*************************** 1. row\n***************************\n Slave_IO_State: Waiting for master to send event\n Master_Host: db01.example.com\n Master_User: replicant\n Master_Port: 3306\n Connect_Retry: 60\n Master_Log_File: mariadb-bin.000010\n Read_Master_Log_Pos: 548\n Relay_Log_File: relay-bin.000004\n Relay_Log_Pos: 837\n Relay_Master_Log_File: mariadb-bin.000010\n Slave_IO_Running: Yes\n Slave_SQL_Running: Yes\n Replicate_Do_DB: \n Replicate_Ignore_DB: \n Replicate_Do_Table: \n Replicate_Ignore_Table: \n Replicate_Wild_Do_Table: \n Replicate_Wild_Ignore_Table: \n Last_Errno: 0\n Last_Error: \n Skip_Counter: 0\n Exec_Master_Log_Pos: 548\n Relay_Log_Space: 1497\n Until_Condition: None\n Until_Log_File: \n Until_Log_Pos: 0\n Master_SSL_Allowed: No\n Master_SSL_CA_File: \n Master_SSL_CA_Path: \n Master_SSL_Cert: \n Master_SSL_Cipher: \n Master_SSL_Key: \n Seconds_Behind_Master: 0\nMaster_SSL_Verify_Server_Cert: No\n Last_IO_Errno: 0\n Last_IO_Error: \n Last_SQL_Errno: 0\n Last_SQL_Error: \n Replicate_Ignore_Server_Ids: \n Master_Server_Id: 101\n Master_SSL_Crl: \n Master_SSL_Crlpath: \n Using_Gtid: No\n Gtid_IO_Pos: \n \nMariaDB [(none)]> SHOW ALL SLAVES STATUS\\G\n*************************** 1. row\n***************************\n Connection_name: \n Slave_SQL_State: Slave has read all relay log; waiting for\nthe slave I/O thread to update it\n Slave_IO_State: Waiting for master to send event\n Master_Host: db01.example.com\n Master_User: replicant\n Master_Port: 3306\n Connect_Retry: 60\n Master_Log_File: mariadb-bin.000010\n Read_Master_Log_Pos: 3608\n Relay_Log_File: relay-bin.000004\n Relay_Log_Pos: 3897\n Relay_Master_Log_File: mariadb-bin.000010\n Slave_IO_Running: Yes\n Slave_SQL_Running: Yes\n Replicate_Do_DB: \n Replicate_Ignore_DB: \n Replicate_Do_Table: \n Replicate_Ignore_Table: \n Replicate_Wild_Do_Table: \n Replicate_Wild_Ignore_Table: \n Last_Errno: 0\n Last_Error: \n Skip_Counter: 0\n Exec_Master_Log_Pos: 3608\n Relay_Log_Space: 4557\n Until_Condition: None\n Until_Log_File: \n Until_Log_Pos: 0\n Master_SSL_Allowed: No\n Master_SSL_CA_File: \n Master_SSL_CA_Path: \n Master_SSL_Cert: \n Master_SSL_Cipher: \n Master_SSL_Key: \n Seconds_Behind_Master: 0\nMaster_SSL_Verify_Server_Cert: No\n Last_IO_Errno: 0\n Last_IO_Error: \n Last_SQL_Errno: 0\n Last_SQL_Error: \n Replicate_Ignore_Server_Ids: \n Master_Server_Id: 101\n Master_SSL_Crl: \n Master_SSL_Crlpath: \n Using_Gtid: No\n Gtid_IO_Pos:\n Retried_transactions: 0\n Max_relay_log_size: 104857600\n Executed_log_entries: 40\n Slave_received_heartbeats: 11\n Slave_heartbeat_period: 1800.000\n Gtid_Slave_Pos: 0-101-2320\n \nYou can also access some of the variables directly from\nstatus variables:\n \nSET @@default_master_connection=\"test\" ;\nshow status like \"%slave%\"\n \nVariable_name Value\nCom_show_slave_hosts 0\nCom_show_slave_status 0\nCom_start_all_slaves 0\nCom_start_slave 0\nCom_stop_all_slaves 0\nCom_stop_slave 0\nRpl_semi_sync_slave_status OFF\nSlave_connections 0\nSlave_heartbeat_period 1800.000\nSlave_open_temp_tables 0\nSlave_received_heartbeats 0\nSlave_retried_transactions 0\nSlave_running OFF\nSlaves_connected 0\nSlaves_running 1\n \n\n\nURL: https://mariadb.com/kb/en/library/show-slave-status/','','https://mariadb.com/kb/en/library/show-slave-status/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (396,26,'SHOW STATUS','Syntax\n------ \nSHOW [GLOBAL | SESSION] STATUS\n [LIKE \'pattern\' | WHERE expr]\n \nDescription\n----------- \nSHOW STATUS provides server status information. This\ninformation also can be obtained using the mysqladmin\nextended-status command, or by querying the Information\nSchema GLOBAL_STATUS and SESSION_STATUS tables.\nThe LIKE clause, if present, indicates which variable names\nto match. The WHERE clause can be given to select rows using\nmore general conditions.\n \nWith the GLOBAL modifier, SHOW STATUS\ndisplays the status values for all connections to MariaDB.\nWith\nSESSION, it displays the status values\nfor the current connection. If no modifier is present, the\ndefault is\n SESSION. LOCAL is a synonym for\n SESSION. If you see a lot of 0 values, the reason is\nprobably that you have used SHOW STATUS with a new\nconnection instead of SHOW GLOBAL STATUS.\n \nSome status variables have only a global value. For these,\nyou get the\nsame value for both GLOBAL and SESSION.\n \nSee Server Status Variables for a full list, scope and\ndescription of the variables that can be viewed with SHOW\nSTATUS.\n \nThe LIKE clause, if present on its own, indicates which\nvariable name to match.\n \nThe WHERE and LIKE clauses can be given to select rows using\nmore general conditions, as discussed in Extended SHOW.\n \nExamples\n-------- \nFull output from MariaDB 10.1.17:\n \nSHOW GLOBAL STATUS;\n \n+--------------------------------------------------------------+----------------------------------------+\n| Variable_name | Value |\n+--------------------------------------------------------------+----------------------------------------+\n| Aborted_clients | 0 |\n| Aborted_connects | 0 |\n| Access_denied_errors | 0 |\n| Acl_column_grants | 0 |\n| Acl_database_grants | 2 |\n| Acl_function_grants | 0 |\n| Acl_procedure_grants | 0 |\n| Acl_proxy_users | 2 |\n| Acl_role_grants | 0 |\n| Acl_roles | 0 |\n| Acl_table_grants | 0 |\n| Acl_users | 6 |\n| Aria_pagecache_blocks_not_flushed | 0 |\n| Aria_pagecache_blocks_unused | 15706 |\n| Aria_pagecache_blocks_used | 0 |\n| Aria_pagecache_read_requests | 0 |\n| Aria_pagecache_reads | 0 |\n| Aria_pagecache_write_requests | 0 |\n| Aria_pagecache_writes | 0 |\n| Aria_transaction_log_syncs | 0 |\n| Binlog_commits | 0 |\n| Binlog_group_commits | 0 |\n| Binlog_group_commit_trigger_count | 0 |\n| Binlog_group_commit_trigger_lock_wait | 0 |\n| Binlog_group_commit_trigger_timeout | 0 |\n| Binlog_snapshot_file | |\n| Binlog_snapshot_position | 0 |\n| Binlog_bytes_written | 0 |\n| Binlog_cache_disk_use | 0 |\n| Binlog_cache_use | 0 |\n| Binlog_stmt_cache_disk_use | 0 |\n| Binlog_stmt_cache_use | 0 |\n| Busy_time | 0.000000 |\n| Bytes_received | 432 |\n| Bytes_sent | 15183 |\n| Com_admin_commands | 1 |\n| Com_alter_db | 0 |\n| Com_alter_db_upgrade | 0 |\n| Com_alter_event | 0 |\n| Com_alter_function | 0 |\n| Com_alter_procedure | 0 |\n| Com_alter_server | 0 |\n| Com_alter_table | 0 |\n| Com_alter_tablespace | 0 |\n| Com_analyze | 0 |\n| Com_assign_to_keycache | 0 |\n| Com_begin | 0 |\n| Com_binlog | 0 |\n| Com_call_procedure | 0 |\n| Com_change_db | 0 |\n| Com_change_master | 0 |\n| Com_check | 0 |\n| Com_checksum | 0 |\n| Com_commit | 0 |\n| Com_compound_sql | 0 |\n| Com_create_db | 0 |\n| Com_create_event | 0 |\n| Com_create_function | 0 |\n| Com_create_index | 0 |\n| Com_create_procedure | 0 |\n| Com_create_role | 0 |\n| Com_create_server | 0 |\n| Com_create_table | 0 |\n| Com_create_temporary_table | 0 |\n| Com_create_trigger | 0 |\n| Com_create_udf | 0 |\n| Com_create_user | 0 |\n| Com_create_view | 0 |\n| Com_dealloc_sql | 0 |\n| Com_delete | 0 |\n| Com_delete_multi | 0 |\n| Com_do | 0 |\n| Com_drop_db | 0 |\n| Com_drop_event | 0 |\n| Com_drop_function | 0 |\n| Com_drop_index | 0 |\n| Com_drop_procedure | 0 |\n| Com_drop_role | 0 |\n| Com_drop_server | 0 |\n| Com_drop_table | 0 |\n| Com_drop_temporary_table | 0 |\n| Com_drop_trigger | 0 |\n| Com_drop_user | 0 |\n| Com_drop_view | 0 |\n| Com_empty_query | 0 |\n| Com_execute_sql | 0 |\n| Com_flush | 0 |\n| Com_get_diagnostics | 0 |\n| Com_grant | 0 |\n| Com_grant_role | 0 |\n| Com_ha_close | 0 |\n| Com_ha_open | 0 |\n| Com_ha_read | 0 |\n| Com_help | 0 |\n| Com_insert | 0 |\n| Com_insert_select | 0 |\n| Com_install_plugin | 0 |\n| Com_kill | 0 |\n| Com_load | 0 |\n| Com_lock_tables | 0 |\n| Com_optimize | 0 |\n| Com_preload_keys | 0 |\n| Com_prepare_sql | 0 |\n| Com_purge | 0 |\n| Com_purge_before_date | 0 |\n| Com_release_savepoint | 0 |\n| Com_rename_table | 0 |\n| Com_rename_user | 0 |\n| Com_repair | 0 |\n| Com_replace | 0 |\n| Com_replace_select | 0 |\n| Com_reset | 0 |\n| Com_resignal | 0 |\n| Com_revoke | 0 |\n| Com_revoke_all | 0 |\n| Com_revoke_role | 0 |\n| Com_rollback | 0 |\n| Com_rollback_to_savepoint | 0 |\n| Com_savepoint | 0 |\n| Com_select | 1 |\n| Com_set_option | 0 |\n| Com_show_authors | 0 |\n| Com_show_binlog_events | 0 |\n| Com_show_binlogs | 0 |\n| Com_show_charsets | 0 |\n| Com_show_collations | 0 |\n| Com_show_contributors | 0 |\n| Com_show_create_db | 0 |\n| Com_show_create_event | 0 |\n| Com_show_create_func | 0 |\n| Com_show_create_proc | 0 |\n| Com_show_create_table | 0 |\n| Com_show_create_trigger | 0 |\n| Com_show_databases | 0 |\n| Com_show_engine_logs | 0 |\n| Com_show_engine_mutex | 0 |\n| Com_show_engine_status | 0 |\n| Com_show_errors | 0 |\n| Com_show_events | 0 |\n| Com_show_explain | 0 |\n| Com_show_fields | 0 |\n| Com_show_function_status | 0 |\n| Com_show_generic | 0 |\n| Com_show_grants | 0 |\n| Com_show_keys | 0 |\n| Com_show_master_status | 0 |\n| Com_show_open_tables | 0 |\n| Com_show_plugins | 0 |\n| Com_show_privileges | 0 |\n| Com_show_procedure_status | 0 |\n| Com_show_processlist | 0 |\n| Com_show_profile | 0 |\n| Com_show_profiles | 0 |\n| Com_show_relaylog_events | 0 |\n| Com_show_slave_hosts | 0 |\n| Com_show_slave_status | 0 |\n| Com_show_status | 2 |\n| Com_show_storage_engines | 0 |\n| Com_show_table_status | 0 |\n| Com_show_tables | 0 |\n| Com_show_triggers | 0 |\n| Com_show_variables | 0 |\n| Com_show_warnings | 0 |\n| Com_shutdown | 0 |\n| Com_signal | 0 |\n| Com_start_all_slaves | 0 |\n| Com_start_slave | 0 |\n| Com_stmt_close | 0 |\n| Com_stmt_execute | 0 |\n| Com_stmt_fetch | 0 |\n| Com_stmt_prepare | 0 |\n| Com_stmt_reprepare | 0 |\n| Com_stmt_reset | 0 |\n| Com_stmt_send_long_data | 0 |\n| Com_stop_all_slaves | 0 |\n| Com_stop_slave | 0 |\n| Com_truncate | 0 |\n| Com_uninstall_plugin | 0 |\n| Com_unlock_tables | 0 |\n| Com_update | 0 |\n| Com_update_multi | 0 |\n| Com_xa_commit | 0 |\n| Com_xa_end | 0 |\n| Com_xa_prepare | 0 |\n| Com_xa_recover | 0 |\n| Com_xa_rollback | 0 |\n| Com_xa_start | 0 |\n| Compression | OFF |\n| Connection_errors_accept | 0 |\n| Connection_errors_internal | 0 |\n| Connection_errors_max_connections | 0 |\n| Connection_errors_peer_address | 0 |\n| Connection_errors_select | 0 |\n| Connection_errors_tcpwrap | 0 |\n| Connections | 4 |\n| Cpu_time | 0.000000 |\n| Created_tmp_disk_tables | 0 |\n| Created_tmp_files | 6 |\n| Created_tmp_tables | 2 |\n| Delayed_errors | 0 |\n| Delayed_insert_threads | 0 |\n| Delayed_writes | 0 |\n| Delete_scan | 0 |\n| Empty_queries | 0 |\n| Executed_events | 0 |\n| Executed_triggers | 0 |\n| Feature_delay_key_write | 0 |\n| Feature_dynamic_columns | 0 |\n| Feature_fulltext | 0 |\n| Feature_gis | 0 |\n| Feature_locale | 0 |\n| Feature_subquery | 0 |\n| Feature_timezone | 0 |\n| Feature_trigger | 0 |\n| Feature_xml | 0 |\n| Flush_commands | 1 |\n| Handler_commit | 1 |\n| Handler_delete | 0 |\n| Handler_discover | 0 |\n| Handler_external_lock | 0 |\n| Handler_icp_attempts | 0 |\n| Handler_icp_match | 0 |\n| Handler_mrr_init | 0 |\n| Handler_mrr_key_refills | 0 |\n| Handler_mrr_rowid_refills | 0 |\n| Handler_prepare | 0 |\n| Handler_read_first | 3 |\n| Handler_read_key | 0 |\n| Handler_read_last | 0 |\n| Handler_read_next | 0 |\n| Handler_read_prev | 0 |\n| Handler_read_retry | 0 |\n| Handler_read_rnd | 0 |\n| Handler_read_rnd_deleted | 0 |\n| Handler_read_rnd_next | 537 |\n| Handler_rollback | 0 |\n| Handler_savepoint | 0 |\n| Handler_savepoint_rollback | 0 |\n| Handler_tmp_update | 0 |\n| Handler_tmp_write | 516 |\n| Handler_update | 0 |\n| Handler_write | 0 |\n| Innodb_available_undo_logs | 128 |\n| Innodb_background_log_sync | 222 |\n| Innodb_buffer_pool_bytes_data | 2523136 |\n| Innodb_buffer_pool_bytes_dirty | 0 |\n| Innodb_buffer_pool_dump_status | Dumping buffer pool(s)\nnot yet started |\n| Innodb_buffer_pool_load_status | Loading buffer pool(s)\nnot yet started |\n| Innodb_buffer_pool_pages_data | 154 |\n| Innodb_buffer_pool_pages_dirty | 0 |\n| Innodb_buffer_pool_pages_flushed | 1 |\n| Innodb_buffer_pool_pages_free | 8037 |\n| Innodb_buffer_pool_pages_lru_flushed | 0 |\n| Innodb_buffer_pool_pages_made_not_young | 0 |\n| Innodb_buffer_pool_pages_made_young | 0 |\n| Innodb_buffer_pool_pages_misc | 0 |\n| Innodb_buffer_pool_pages_old | 0 |\n| Innodb_buffer_pool_pages_total | 8191 |\n| Innodb_buffer_pool_read_ahead | 0 |\n| Innodb_buffer_pool_read_ahead_evicted | 0 |\n| Innodb_buffer_pool_read_ahead_rnd | 0 |\n| Innodb_buffer_pool_read_requests | 558 |\n| Innodb_buffer_pool_reads | 155 |\n| Innodb_buffer_pool_wait_free | 0 |\n| Innodb_buffer_pool_write_requests | 1 |\n| Innodb_checkpoint_age | 0 |\n| Innodb_checkpoint_max_age | 80826164 |\n| Innodb_data_fsyncs | 5 |\n| Innodb_data_pending_fsyncs | 0 |\n| Innodb_data_pending_reads | 0 |\n| Innodb_data_pending_writes | 0 |\n| Innodb_data_read | 2609664 |\n| Innodb_data_reads | 172 |\n| Innodb_data_writes | 5 |\n| Innodb_data_written | 34304 |\n| Innodb_dblwr_pages_written | 1 |\n| Innodb_dblwr_writes | 1 |\n| Innodb_deadlocks | 0 |\n| Innodb_have_atomic_builtins | ON |\n| Innodb_history_list_length | 0 |\n| Innodb_ibuf_discarded_delete_marks | 0 |\n| Innodb_ibuf_discarded_deletes | 0 |\n| Innodb_ibuf_discarded_inserts | 0 |\n| Innodb_ibuf_free_list | 0 |\n| Innodb_ibuf_merged_delete_marks | 0 |\n| Innodb_ibuf_merged_deletes | 0 |\n| Innodb_ibuf_merged_inserts | 0 |\n| Innodb_ibuf_merges | 0 |\n| Innodb_ibuf_segment_size | 2 |\n| Innodb_ibuf_size | 1 |\n| Innodb_log_waits | 0 |\n| Innodb_log_write_requests | 0 |\n| Innodb_log_writes | 1 |\n| Innodb_lsn_current | 1616829 |\n| Innodb_lsn_flushed | 1616829 |\n| Innodb_lsn_last_checkpoint | 1616829 |\n| Innodb_master_thread_active_loops | 0 |\n| Innodb_master_thread_idle_loops | 222 |\n| Innodb_max_trx_id | 2308 |\n| Innodb_mem_adaptive_hash | 2217568 |\n| Innodb_mem_dictionary | 630703 |\n| Innodb_mem_total | 140771328 |\n| Innodb_mutex_os_waits | 1 |\n| Innodb_mutex_spin_rounds | 30 |\n| Innodb_mutex_spin_waits | 1 |\n| Innodb_oldest_view_low_limit_trx_id | 0 |\n| Innodb_os_log_fsyncs | 3 |\n| Innodb_os_log_pending_fsyncs | 0 |\n| Innodb_os_log_pending_writes | 0 |\n| Innodb_os_log_written | 512 |\n| Innodb_page_size | 16384 |\n| Innodb_pages_created | 0 |\n| Innodb_pages_read | 154 |\n| Innodb_pages_written | 1 |\n| Innodb_purge_trx_id | 0 |\n| Innodb_purge_undo_no | 0 |\n| Innodb_read_views_memory | 88 |\n| Innodb_row_lock_current_waits | 0 |\n| Innodb_row_lock_time | 0 |\n| Innodb_row_lock_time_avg | 0 |\n| Innodb_row_lock_time_max | 0 |\n| Innodb_row_lock_waits | 0 |\n| Innodb_rows_deleted | 0 |\n| Innodb_rows_inserted | 0 |\n| Innodb_rows_read | 0 |\n| Innodb_rows_updated | 0 |\n| Innodb_system_rows_deleted | 0 |\n| Innodb_system_rows_inserted | 0 |\n| Innodb_system_rows_read | 0 |\n| Innodb_system_rows_updated | 0 |\n| Innodb_s_lock_os_waits | 2 |\n| Innodb_s_lock_spin_rounds | 60 |\n| Innodb_s_lock_spin_waits | 2 |\n| Innodb_truncated_status_writes | 0 |\n| Innodb_x_lock_os_waits | 0 |\n| Innodb_x_lock_spin_rounds | 0 |\n| Innodb_x_lock_spin_waits | 0 |\n| Innodb_page_compression_saved | 0 |\n| Innodb_page_compression_trim_sect512 | 0 |\n| Innodb_page_compression_trim_sect1024 | 0 |\n| Innodb_page_compression_trim_sect2048 | 0 |\n| Innodb_page_compression_trim_sect4096 | 0 |\n| Innodb_page_compression_trim_sect8192 | 0 |\n| Innodb_page_compression_trim_sect16384 | 0 |\n| Innodb_page_compression_trim_sect32768 | 0 |\n| Innodb_num_index_pages_written | 0 |\n| Innodb_num_non_index_pages_written | 5 |\n| Innodb_num_pages_page_compressed | 0 |\n| Innodb_num_page_compressed_trim_op | 0 |\n| Innodb_num_page_compressed_trim_op_saved | 0 |\n| Innodb_num_pages_page_decompressed | 0 |\n| Innodb_num_pages_page_compression_error | 0 |\n| Innodb_num_pages_encrypted | 0 |\n| Innodb_num_pages_decrypted | 0 |\n| Innodb_have_lz4 | OFF |\n| Innodb_have_lzo | OFF |\n| Innodb_have_lzma | OFF |\n| Innodb_have_bzip2 | OFF |\n| Innodb_have_snappy | OFF |\n| Innodb_defragment_compression_failures | 0 |\n| Innodb_defragment_failures | 0 |\n| Innodb_defragment_count | 0 |\n| Innodb_onlineddl_rowlog_rows | 0 |\n| Innodb_onlineddl_rowlog_pct_used | 0 |\n| Innodb_onlineddl_pct_progress | 0 |\n| Innodb_secondary_index_triggered_cluster_reads | 0 |\n| Innodb_secondary_index_triggered_cluster_reads_avoided | 0\n|\n| Innodb_encryption_rotation_pages_read_from_cache | 0 |\n| Innodb_encryption_rotation_pages_read_from_disk | 0 |\n| Innodb_encryption_rotation_pages_modified | 0 |\n| Innodb_encryption_rotation_pages_flushed | 0 |\n| Innodb_encryption_rotation_estimated_iops | 0 |\n| Innodb_scrub_background_page_reorganizations | 0 |\n| Innodb_scrub_background_page_splits | 0 |\n| Innodb_scrub_background_page_split_failures_underflow | 0\n|\n|\nInnodb_scrub_background_page_split_failures_out_of_filespace\n| 0 |\n| Innodb_scrub_background_page_split_failures_missing_index\n| 0 |\n| Innodb_scrub_background_page_split_failures_unknown | 0 |\n| Key_blocks_not_flushed | 0 |\n| Key_blocks_unused | 107163 |\n| Key_blocks_used | 0 |\n| Key_blocks_warm | 0 |\n| Key_read_requests | 0 |\n| Key_reads | 0 |\n| Key_write_requests | 0 |\n| Key_writes | 0 |\n| Last_query_cost | 0.000000 |\n| Master_gtid_wait_count | 0 |\n| Master_gtid_wait_time | 0 |\n| Master_gtid_wait_timeouts | 0 |\n| Max_statement_time_exceeded | 0 |\n| Max_used_connections | 1 |\n| Memory_used | 273614696 |\n| Not_flushed_delayed_rows | 0 |\n| Open_files | 25 |\n| Open_streams | 0 |\n| Open_table_definitions | 18 |\n| Open_tables | 11 |\n| Opened_files | 77 |\n| Opened_plugin_libraries | 0 |\n| Opened_table_definitions | 18 |\n| Opened_tables | 18 |\n| Opened_views | 0 |\n| Performance_schema_accounts_lost | 0 |\n| Performance_schema_cond_classes_lost | 0 |\n| Performance_schema_cond_instances_lost | 0 |\n| Performance_schema_digest_lost | 0 |\n| Performance_schema_file_classes_lost | 0 |\n| Performance_schema_file_handles_lost | 0 |\n| Performance_schema_file_instances_lost | 0 |\n| Performance_schema_hosts_lost | 0 |\n| Performance_schema_locker_lost | 0 |\n| Performance_schema_mutex_classes_lost | 0 |\n| Performance_schema_mutex_instances_lost | 0 |\n| Performance_schema_rwlock_classes_lost | 0 |\n| Performance_schema_rwlock_instances_lost | 0 |\n| Performance_schema_session_connect_attrs_lost | 0 |\n| Performance_schema_socket_classes_lost | 0 |\n| Performance_schema_socket_instances_lost | 0 |\n| Performance_schema_stage_classes_lost | 0 |\n| Performance_schema_statement_classes_lost | 0 |\n| Performance_schema_table_handles_lost | 0 |\n| Performance_schema_table_instances_lost | 0 |\n| Performance_schema_thread_classes_lost | 0 |\n| Performance_schema_thread_instances_lost | 0 |\n| Performance_schema_users_lost | 0 |\n| Prepared_stmt_count | 0 |\n| Qcache_free_blocks | 1 |\n| Qcache_free_memory | 1031336 |\n| Qcache_hits | 0 |\n| Qcache_inserts | 0 |\n| Qcache_lowmem_prunes | 0 |\n| Qcache_not_cached | 0 |\n| Qcache_queries_in_cache | 0 |\n| Qcache_total_blocks | 1 |\n| Queries | 4 |\n| Questions | 4 |\n| Rows_read | 10 |\n| Rows_sent | 517 |\n| Rows_tmp_read | 516 |\n| Rpl_status | AUTH_MASTER |\n| Select_full_join | 0 |\n| Select_full_range_join | 0 |\n| Select_range | 0 |\n| Select_range_check | 0 |\n| Select_scan | 2 |\n| Slave_connections | 0 |\n| Slave_heartbeat_period | 0.000 |\n| Slave_open_temp_tables | 0 |\n| Slave_received_heartbeats | 0 |\n| Slave_retried_transactions | 0 |\n| Slave_running | OFF |\n| Slave_skipped_errors | 0 |\n| Slaves_connected | 0 |\n| Slaves_running | 0 |\n| Slow_launch_threads | 0 |\n| Slow_queries | 0 |\n| Sort_merge_passes | 0 |\n| Sort_priority_queue_sorts | 0 |\n| Sort_range | 0 |\n| Sort_rows | 0 |\n| Sort_scan | 0 |\n| Ssl_accept_renegotiates | 0 |\n| Ssl_accepts | 0 |\n| Ssl_callback_cache_hits | 0 |\n| Ssl_cipher | |\n| Ssl_cipher_list | |\n| Ssl_client_connects | 0 |\n| Ssl_connect_renegotiates | 0 |\n| Ssl_ctx_verify_depth | 0 |\n| Ssl_ctx_verify_mode | 0 |\n| Ssl_default_timeout | 0 |\n| Ssl_finished_accepts | 0 |\n| Ssl_finished_connects | 0 |\n| Ssl_server_not_after | |\n| Ssl_server_not_before | |\n| Ssl_session_cache_hits | 0 |\n| Ssl_session_cache_misses | 0 |\n| Ssl_session_cache_mode | NONE |\n| Ssl_session_cache_overflows | 0 |\n| Ssl_session_cache_size | 0 |\n| Ssl_session_cache_timeouts | 0 |\n| Ssl_sessions_reused | 0 |\n| Ssl_used_session_cache_entries | 0 |\n| Ssl_verify_depth | 0 |\n| Ssl_verify_mode | 0 |\n| Ssl_version | |\n| Subquery_cache_hit | 0 |\n| Subquery_cache_miss | 0 |\n| Syncs | 2 |\n| Table_locks_immediate | 21 |\n| Table_locks_waited | 0 |\n| Tc_log_max_pages_used | 0 |\n| Tc_log_page_size | 4096 |\n| Tc_log_page_waits | 0 |\n| Threadpool_idle_threads | 0 |\n| Threadpool_threads | 0 |\n| Threads_cached | 0 |\n| Threads_connected | 1 |\n| Threads_created | 2 |\n| Threads_running | 1 |\n| Update_scan | 0 |\n| Uptime | 223 |\n| Uptime_since_flush_status | 223 |\n| wsrep_cluster_conf_id | 18446744073709551615 |\n| wsrep_cluster_size | 0 |\n| wsrep_cluster_state_uuid | |\n| wsrep_cluster_status | Disconnected |\n| wsrep_connected | OFF |\n| wsrep_local_bf_aborts | 0 |\n| wsrep_local_index | 18446744073709551615 |\n| wsrep_provider_name | |\n| wsrep_provider_vendor | |\n| wsrep_provider_version | |\n| wsrep_ready | OFF |\n| wsrep_thread_count | 0 |\n+--------------------------------------------------------------+----------------------------------------+\n516 rows in set (0.00 sec)\n \nExample of filtered output:\n \nSHOW STATUS LIKE \'Key%\';\n \n+------------------------+--------+\n| Variable_name | Value |\n+------------------------+--------+\n| Key_blocks_not_flushed | 0 |\n| Key_blocks_unused | 107163 |\n| Key_blocks_used | 0 |\n| Key_blocks_warm | 0 |\n| Key_read_requests | 0 |\n| Key_reads | 0 |\n| Key_write_requests | 0 |\n| Key_writes | 0 |\n+------------------------+--------+\n8 rows in set (0.00 sec)\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-status/','','https://mariadb.com/kb/en/library/show-status/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (397,26,'SHOW TABLE STATUS','Syntax\n------ \nSHOW TABLE STATUS [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n \nDescription\n----------- \n SHOW TABLE STATUS works like \n SHOW TABLES, but provides more extensive information about\neach non-TEMPORARY table.\n \nThe LIKE clause, if present on its own, indicates which\ntable names to\nmatch. The WHERE and LIKE clauses can be given to select\nrows using more general conditions, as discussed in Extended\nSHOW.\n \nThe following information is returned:\n \nColumn | Description | \n \nName | Table name. | \n \nEngine | Table storage engine. | \n \nVersion | Version number from the table\'s .frm file. | \n \nRow_format | Row format (see InnoDB, Aria and MyISAM row\nformats). | \n \nRows | Number of rows in the table. Some engines, such as\nXtraDB and InnoDB may store an estimate. | \n \nAvg_row_length | Average row length in the table. | \n \nData_length | For InnoDB/XtraDB, the index size, in pages,\nmultiplied by the page size. For Aria and MyISAM, length of\nthe data file, in bytes. For MEMORY, the approximate\nallocated memory. | \n \nMax_data_length | Maximum length of the data file, ie the\ntotal number of bytes that could be stored in the table. Not\nused in XtraDB and InnoDB. | \n \nIndex_length | Length of the index file. | \n \nData_free | Bytes allocated but unused. For InnoDB tables in\na shared tablespace, the free space of the shared tablespace\nwith small safety margin. An estimate in the case of\npartitioned tables - see the PARTITIONS table. | \n \nAuto_increment | Next AUTO_INCREMENT value. | \n \nCreate_time | Time the table was created. | \n \nUpdate_time | Time the table was last updated. On Windows,\nthe timestamp is not updated on update, so MyISAM values\nwill be inaccurate. In InnoDB, if shared tablespaces are\nused, will be NULL, while buffering can also delay the\nupdate, so the value will differ from the actual time of the\nlast UPDATE, INSERT or DELETE. | \n \nCheck_time | Time the table was last checked. Not kept by\nall storage engines, in which case will be NULL. | \n \nCollation | Character set and collation. | \n \nChecksum | Live checksum value, if any. | \n \nCreate_options | Extra CREATE TABLE options. | \n \nComment | Table comment provided when MariaDB created the\ntable. | \n \nSimilar information can be found in the\ninformation_schema.TABLES table as well as by using\nmysqlshow:\n \nmysqlshow --status db_name\n \nExample\n \nshow table status\\G\n*************************** 1. row\n***************************\n Name: bus_routes\n Engine: InnoDB\n Version: 10\n Row_format: Dynamic\n Rows: 5\n Avg_row_length: 3276\n Data_length: 16384\nMax_data_length: 0\n Index_length: 0\n Data_free: 0\n Auto_increment: NULL\n Create_time: 2017-05-24 11:17:46\n Update_time: NULL\n Check_time: NULL\n Collation: latin1_swedish_ci\n Checksum: NULL\n Create_options: \n Comment:\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-table-status/','','https://mariadb.com/kb/en/library/show-table-status/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (398,26,'SHOW TABLES','Syntax\n------ \nSHOW [FULL] TABLES [FROM db_name]\n [LIKE \'pattern\' | WHERE expr]\n \nDescription\n----------- \nSHOW TABLES lists the non-TEMPORARY tables, sequences and\nviews in a given database. \n \nThe LIKE clause, if present on its own, indicates which\ntable names to match. The WHERE and LIKE clauses can be\ngiven to select rows using more general conditions, as\ndiscussed in Extended SHOW. For example, when searching for\ntables in the test database, the column name for use in the\nWHERE and LIKE clauses will be Tables_in_test\n \nThe FULL modifier is supported such that SHOW FULL TABLES\ndisplays a second output column. Values for the second\ncolumn. Table_type, are BASE TABLE for a table, VIEW for a\nview and SEQUENCE for a sequence.\n \nYou can also get this information using:\n \nmysqlshow db_name\n \nSee mysqlshow for more details.\n \nIf you have no privileges for a base table or view, it does\nnot show up in the output from SHOW TABLES or mysqlshow\ndb_name.\n \nThe information_schema.TABLES table, as well as the SHOW\nTABLE STATUS statement, provide extended information about\ntables.\n \nExamples\n-------- \nSHOW TABLES;\n+----------------------+\n| Tables_in_test |\n+----------------------+\n| animal_count |\n| animals |\n| are_the_mooses_loose |\n| aria_test2 |\n| t1 |\n| view1 |\n+----------------------+\n \nShowing the tables beginning with a only.\n \nSHOW TABLES WHERE Tables_in_test LIKE \'a%\';\n+----------------------+\n| Tables_in_test |\n+----------------------+\n| animal_count |\n| animals |\n| are_the_mooses_loose |\n| aria_test2 |\n+----------------------+\n \nShowing tables and table types:\n \nSHOW FULL TABLES;\n+----------------+------------+\n| Tables_in_test | Table_type |\n+----------------+------------+\n| s1 | SEQUENCE |\n| student | BASE TABLE |\n| v1 | VIEW |\n+----------------+------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/show-tables/','','https://mariadb.com/kb/en/library/show-tables/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (399,26,'SHOW TABLE_STATISTICS','MariaDB 5.2 introduced the User Statistics feature.\n \nSyntax\n------ \nSHOW TABLE_STATISTICS\n \nDescription\n----------- \nThe SHOW TABLE_STATISTICS statement was introduced in\nMariaDB 5.2 as part of the User Statistics feature. It was\nremoved as a separate statement in MariaDB 10.1.1, but\neffectively replaced by the generic SHOW\ninformation_schema_table statement. The\ninformation_schema.TABLE_STATISTICS table shows statistics\non table usage\n \nThe userstat system variable must be set to 1 to activate\nthis feature. See the User Statistics and\ninformation_schema.TABLE_STATISTICS articles for more\ninformation.\n \nExample\n \nFrom MariaDB 10.0\n \nSHOW TABLE_STATISTICS\\G\n*************************** 1. row\n***************************\n Table_schema: mysql\n Table_name: proxies_priv\n Rows_read: 2\n Rows_changed: 0\nRows_changed_x_#indexes: 0\n*************************** 2. row\n***************************\n Table_schema: test\n Table_name: employees_example\n Rows_read: 7\n Rows_changed: 0\nRows_changed_x_#indexes: 0\n*************************** 3. row\n***************************\n Table_schema: mysql\n Table_name: user\n Rows_read: 16\n Rows_changed: 0\nRows_changed_x_#indexes: 0\n*************************** 4. row\n***************************\n Table_schema: mysql\n Table_name: db\n Rows_read: 2\n Rows_changed: 0\nRows_changed_x_#indexes: 0\n \n\n \n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/show-table-statistics/','','https://mariadb.com/kb/en/library/show-table-statistics/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (400,26,'SHOW TRIGGERS','Syntax\n------ \nSHOW TRIGGERS [FROM db_name]\n [LIKE \'pattern\' | WHERE expr]\n \nDescription\n----------- \n SHOW TRIGGERS lists the triggers currently defined for\ntables in a database (the default database unless a FROM\nclause is given). This statement requires the\nTRIGGER privilege (prior to MySQL\n5.1.22, it required the SUPER privilege). \n \nThe LIKE clause, if present on its own, indicates which\ntable names to\nmatch and causes the statement to display triggers for those\ntables. The WHERE and LIKE clauses can be given to select\nrows using more general conditions, as discussed in Extended\nSHOW.\n \nSimilar information is stored in the\ninformation_schema.TRIGGERS table.\n \nIf there are multiple triggers for the same action, then the\ntriggers are shown in action order.\n \nExamples\n-------- \nFor the trigger defined at Trigger Overview:\n \nSHOW triggers Like \'animals\' \\G\n*************************** 1. row\n***************************\n Trigger: the_mooses_are_loose\n Event: INSERT\n Table: animals\n Statement: BEGIN\n IF NEW.name = \'Moose\' THEN\n UPDATE animal_count SET animal_count.animals =\nanimal_count.animals+100;\n ELSE \n UPDATE animal_count SET animal_count.animals =\nanimal_count.animals+1;\n END IF;\nEND\n Timing: AFTER\n Created: 2016-09-29 13:53:34.35\n sql_mode: \n Definer: root@localhost\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n \nListing all triggers associated with a certain table:\n \nSHOW TRIGGERS FROM test WHERE `Table` = \'user\' \\G\n*************************** 1. row\n***************************\n Trigger: user_ai\n Event: INSERT\n Table: user\n Statement: BEGIN END\n Timing: AFTER\n Created: 2016-09-29 13:53:34.35\n sql_mode: \n Definer: root@%\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n \nSHOW triggers WHERE Event Like \'Insert\' \\G\n*************************** 1. row\n***************************\n Trigger: the_mooses_are_loose\n Event: INSERT\n Table: animals\n Statement: BEGIN\n IF NEW.name = \'Moose\' THEN\n UPDATE animal_count SET animal_count.animals =\nanimal_count.animals+100;\n ELSE \n UPDATE animal_count SET animal_count.animals =\nanimal_count.animals+1;\n END IF;\nEND\n Timing: AFTER\n Created: 2016-09-29 13:53:34.35\n sql_mode: \n Definer: root@localhost\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\ncharacter_set_client is the session value of the\ncharacter_set_client system variable when the trigger was\ncreated. \ncollation_connection is the session value of the\ncollation_connection system variable when the trigger was\n created. \nDatabase Collation is the collation of the database \n with which the trigger is associated.\n \nThese columns were added in MariaDB/MySQL 5.1.21.\n \nOld triggers created before MySQL 5.7 and MariaDB 10.2.3 has\nNULL in the Created column.\n \n\n\nURL: https://mariadb.com/kb/en/library/show-triggers/','','https://mariadb.com/kb/en/library/show-triggers/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (401,26,'SHOW USER_STATISTICS','MariaDB 5.2 introduced the User Statistics feature.\n \nSyntax\n------ \nSHOW USER_STATISTICS\n \nDescription\n----------- \nThe SHOW USER_STATISTICS statement was introduced in MariaDB\n5.2 as part of the User Statistics feature. It was removed\nas a separate statement in MariaDB 10.1.1, but effectively\nreplaced by the generic SHOW information_schema_table\nstatement. The information_schema.USER_STATISTICS table\nholds statistics about user activity. You can use this table\nto find out such things as which user is causing the most\nload and which users are being abusive. You can also use\nthis table to measure how close to capacity the server may\nbe.\n \nThe userstat system variable must be set to 1 to activate\nthis feature. See the User Statistics and\ninformation_schema.USER_STATISTICS table for more\ninformation.\n \nExample\n \nFrom MariaDB 10.0:\n \nSHOW USER_STATISTICS\\G\n*************************** 1. row\n***************************\n User: root\n Total_connections: 1\nConcurrent_connections: 0\n Connected_time: 3297\n Busy_time: 0.14113400000000006\n Cpu_time: 0.017637000000000003\n Bytes_received: 969\n Bytes_sent: 22355\n Binlog_bytes_written: 0\n Rows_read: 10\n Rows_sent: 67\n Rows_deleted: 0\n Rows_inserted: 0\n Rows_updated: 0\n Select_commands: 7\n Update_commands: 0\n Other_commands: 0\n Commit_transactions: 1\n Rollback_transactions: 0\n Denied_connections: 0\n Lost_connections: 0\n Access_denied: 0\n Empty_queries: 7\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-user-statistics/','','https://mariadb.com/kb/en/library/show-user-statistics/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (402,26,'SHOW VARIABLES','Syntax\n------ \nSHOW [GLOBAL | SESSION] VARIABLES\n [LIKE \'pattern\' | WHERE expr]\n \nDescription\n----------- \nSHOW VARIABLES shows the values of MariaDB system variables.\nThis\ninformation also can be obtained using the mysqladmin\nvariables\ncommand. The LIKE clause, if present, indicates which\nvariable names\nto match. The WHERE clause can be given to select rows using\nmore\ngeneral conditions.\n \nWith the GLOBAL modifier, SHOW VARIABLES displays the values\nthat are\nused for new connections to MariaDB. With SESSION, it\ndisplays the\nvalues that are in effect for the current connection. If no\nmodifier\nis present, the default is SESSION. LOCAL is a synonym for\nSESSION.\nWith a LIKE clause, the statement displays only rows for\nthose\nvariables with names that match the pattern. To obtain the\nrow for a\nspecific variable, use a LIKE clause as shown:\n \nSHOW VARIABLES LIKE \'maria_group_commit\';\n \nSHOW SESSION VARIABLES LIKE \'maria_group_commit\';\n \nTo get a list of variables whose name match a pattern, use\nthe \"%\"\nwildcard character in a LIKE clause:\n \nSHOW VARIABLES LIKE \'%maria%\';\n \nSHOW GLOBAL VARIABLES LIKE \'%maria%\';\n \nWildcard characters can be used in any position within the\npattern to\nbe matched. Strictly speaking, because \"_\" is a wildcard\nthat matches\nany single character, you should escape it as \"\\_\" to\nmatch it\nliterally. In practice, this is rarely necessary.\n \nThe WHERE and LIKE clauses can be given to select rows using\nmore general conditions, as discussed in Extended SHOW.\n \nSee SET for information on setting server system variables.\n \nSee Server System Variables for a list of all the variables\nthat can be set.\n \nYou can also see the server variables by querying the\nInformation Schema GLOBAL_VARIABLES and SESSION_VARIABLES\ntables.\n \nExamples\n-------- \nSHOW VARIABLES LIKE \'aria%\';\n \n+------------------------------------------+---------------------+\n| Variable_name | Value |\n+------------------------------------------+---------------------+\n| aria_block_size | 8192 |\n| aria_checkpoint_interval | 30 |\n| aria_checkpoint_log_activity | 1048576 |\n| aria_force_start_after_recovery_failures | 0 |\n| aria_group_commit | none |\n| aria_group_commit_interval | 0 |\n| aria_log_file_size | 1073741824 |\n| aria_log_purge_type | immediate |\n| aria_max_sort_file_size | 9223372036853727232 |\n| aria_page_checksum | ON |\n| aria_pagecache_age_threshold | 300 |\n| aria_pagecache_buffer_size | 134217728 |\n| aria_pagecache_division_limit | 100 |\n| aria_recover | NORMAL |\n| aria_repair_threads | 1 |\n| aria_sort_buffer_size | 134217728 |\n| aria_stats_method | nulls_unequal |\n| aria_sync_log_dir | NEWFILE |\n| aria_used_for_temp_tables | ON |\n+------------------------------------------+---------------------+\n \nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'max_error_count\' OR\n VARIABLE_NAME LIKE \'innodb_sync_spin_loops\';\n \n+---------------------------+---------------+--------------+\n| VARIABLE_NAME | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT | 64 | 64 |\n| INNODB_SYNC_SPIN_LOOPS | NULL | 30 |\n+---------------------------+---------------+--------------+\n \nSET GLOBAL max_error_count=128;\n \nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'max_error_count\' OR\n VARIABLE_NAME LIKE \'innodb_sync_spin_loops\';\n \n+---------------------------+---------------+--------------+\n| VARIABLE_NAME | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT | 64 | 128 |\n| INNODB_SYNC_SPIN_LOOPS | NULL | 30 |\n+---------------------------+---------------+--------------+\n \nSET GLOBAL max_error_count=128;\n \nSHOW VARIABLES LIKE \'max_error_count\';\n \n+-----------------+-------+\n| Variable_name | Value |\n+-----------------+-------+\n| max_error_count | 64 |\n+-----------------+-------+\n \nSHOW GLOBAL VARIABLES LIKE \'max_error_count\';\n \n+-----------------+-------+\n| Variable_name | Value |\n+-----------------+-------+\n| max_error_count | 128 |\n+-----------------+-------+\n \nBecause the following variable only has a global scope, the\nglobal value is returned even when specifying SESSION (in\nthis case by default):\n \nSHOW VARIABLES LIKE \'innodb_sync_spin_loops\';\n \n+------------------------+-------+\n| Variable_name | Value |\n+------------------------+-------+\n| innodb_sync_spin_loops | 30 |\n+------------------------+-------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-variables/','','https://mariadb.com/kb/en/library/show-variables/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (403,26,'SHOW WARNINGS','Syntax\n------ \nSHOW WARNINGS [LIMIT [offset,] row_count]\nSHOW ERRORS [LIMIT row_count OFFSET offset]\nSHOW COUNT(*) WARNINGS\n \nDescription\n----------- \n SHOW WARNINGS shows the error, warning, and note messages\nthat resulted from the last statement that generated\nmessages in the\ncurrent session. It shows nothing if the last statement used\na table\nand generated no messages. (That is, a statement that uses a\ntable but\ngenerates no messages clears the message list.) Statements\nthat do not\nuse tables and do not generate messages have no effect on\nthe message\nlist.\n \nA note is different to a warning in that it only appears if\nthe sql_notes variable is set to 1 (the default), and is not\nconverted to an error if strict mode is enabled.\n \nA related statement, SHOW ERRORS, shows only the errors.\n \nThe SHOW COUNT(*) WARNINGS statement displays the total\nnumber of errors, warnings, and notes. You can also retrieve\nthis number from\nthe warning_count variable:\n \nSHOW COUNT(*) WARNINGS;\nSELECT @@warning_count;\n \nThe value of warning_count might be greater than the number\nof messages displayed by SHOW WARNINGS if the\nmax_error_count system variable is set so low that not all\nmessages are stored.\n \nThe LIMIT clause has the same syntax as for the\n SELECT statement.\n \nSHOW WARNINGS can be used after EXPLAIN EXTENDED to see how\na query is internally rewritten by MariaDB.\n \nIf the sql_notes server variable is set to 1, Notes are\nincluded in the output of SHOW WARNINGS; if it is set to 0,\nthis statement will not show (or count) Notes.\n \nThe results of SHOW WARNINGS and SHOW COUNT(*) WARNINGS are\ndirectly sent to the client. If you need to access those\ninformation in a stored program, you can use the GET\nDIAGNOSTICS statement instead.\n \nFor a list of MariaDB error codes, see MariaDB Error Codes.\n \nThe mysql client also has a number of options related to\nwarnings. The \\W command will show warnings after every\nstatement, while \\w will disable this. Starting the client\nwith the --show-warnings option will show warnings after\nevery statement.\n \nMariaDB 10.3.1 implements a stored routine error stack\ntrace. SHOW WARNINGS can also be used to show more\ninformation. See the example below.\n \nExamples\n-------- \nSELECT 1/0;\n+------+\n| 1/0 |\n+------+\n| NULL |\n+------+\n \nSHOW COUNT(*) WARNINGS;\n+-------------------------+\n| @@session.warning_count |\n+-------------------------+\n| 1 |\n+-------------------------+\n \nSHOW WARNINGS;\n+---------+------+---------------+\n| Level | Code | Message |\n+---------+------+---------------+\n| Warning | 1365 | Division by 0 |\n+---------+------+---------------+\n \nStack Trace\n \nFrom MariaDB 10.3.1, displaying a stack trace:\n \nDELIMITER $$\nCREATE OR REPLACE PROCEDURE p1()\n BEGIN\n DECLARE c CURSOR FOR SELECT * FROM not_existing;\n OPEN c;\n CLOSE c;\n END;\n$$\nCREATE OR REPLACE PROCEDURE p2()\n BEGIN\n CALL p1;\n END;\n$$\nDELIMITER ;\nCALL p2;\nERROR 1146 (42S02): Table \'test.not_existing\' doesn\'t\nexist\n \nSHOW WARNINGS;\n+-------+------+-----------------------------------------+\n| Level | Code | Message |\n+-------+------+-----------------------------------------+\n| Error | 1146 | Table \'test.not_existing\' doesn\'t exist\n|\n| Note | 4091 | At line 6 in test.p1 |\n| Note | 4091 | At line 4 in test.p2 |\n+-------+------+-----------------------------------------+\n \nSHOW WARNINGS displays a stack trace, showing where the\nerror actually happened:\nLine 4 in test.p1 is the OPEN command which actually raised\nthe error\nLine 3 in test.p2 is the CALL statement, calling p1 from p2.\n \n\n\nURL: https://mariadb.com/kb/en/library/show-warnings/','','https://mariadb.com/kb/en/library/show-warnings/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (404,26,'SHOW WSREP_MEMBERSHIP','MariaDB 10.1.2\n \nSHOW WSREP_MEMBERSHIP was introduced with the WSREP_INFO\nplugin in MariaDB 10.1.2.\n \nSyntax\n------ \nSHOW WSREP_MEMBERSHIP\n \nDescription\n----------- \nThe SHOW WSREP_MEMBERSHIP statement returns Galera node\ncluster membership information. It returns the same\ninformation as found in the\ninformation_schema.WSREP_MEMBERSHIP table. Only users with\nthe SUPER privilege can access this information.\n \nExamples\n-------- \nSHOW WSREP_MEMBERSHIP;\n+-------+--------------------------------------+----------+-----------------+\n| Index | Uuid | Name | Address |\n+-------+--------------------------------------+----------+-----------------+\n| 0 | 19058073-8940-11e4-8570-16af7bf8fced | my_node1 |\n10.0.2.15:16001 |\n| 1 | 19f2b0e0-8942-11e4-9cb8-b39e8ee0b5dd | my_node3 |\n10.0.2.15:16003 |\n| 2 | d85e62db-8941-11e4-b1ef-4bc9980e476d | my_node2 |\n10.0.2.15:16002 |\n+-------+--------------------------------------+----------+-----------------+\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/show-wsrep_membership/','','https://mariadb.com/kb/en/library/show-wsrep_membership/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (405,26,'SHOW WSREP_STATUS','MariaDB 10.1.2\n \nSHOW WSREP_STATUS was introduced with the WSREP_INFO plugin\nin MariaDB 10.1.2.\n \nSyntax\n------ \nSHOW WSREP_STATUS\n \nDescription\n----------- \nThe SHOW WSREP_STATUS statement returns Galera node and\ncluster status information. It returns the same information\nas found in the information_schema.WSREP_STATUS table. Only\nusers with the SUPER privilege can access this information.\n \nExamples\n-------- \nSHOW WSREP_STATUS;\n+------------+-------------+----------------+--------------+\n| Node_Index | Node_Status | Cluster_Status | Cluster_Size |\n+------------+-------------+----------------+--------------+\n| 0 | Synced | Primary | 3 |\n+------------+-------------+----------------+--------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/show-wsrep_status/','','https://mariadb.com/kb/en/library/show-wsrep_status/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (406,27,'CALL','Syntax\n------ \nCALL sp_name([parameter[,...]])\nCALL sp_name[()]\n \nDescription\n----------- \nThe CALL statement invokes a stored procedure that was\ndefined previously with CREATE PROCEDURE. \n \nStored procedure names can be specified as\ndatabase_name.procedure_name. Procedure names and database\nnames can be quoted with backticks (). This is necessary if\nthey are reserved words, or contain special characters. See\nidentifier qualifiers for details.\n \nBefore MySQL 5.1.13, stored procedures that take no\narguments required parentheses. In current releases of\nMariaDB, CALL p() and CALL p are equivalent.\n \nIf parentheses are used, any number of spaces, tab\ncharacters and new line characters is allowed between the\nprocedure\'s name and the open parenthesis.\n \nCALL can pass back values to its caller using parameters\nthat are declared as OUT or INOUT\nparameters. If no value is assigned to an OUT parameter,\nNULL is assigned (and its former value is lost). To pass\nsuch values from another stored program you can use\nuser-defined variables, local variables or routine\'s\nparameters; in other contexts, you can only use user-defined\nvariables. \n \nCALL can also be executed as a prepared statement.\nPlaceholders can be used for IN parameters in all versions\nof MariaDB; for OUT and INOUT parameters, placeholders can\nbe used since MariaDB 5.5.\n \nWhen the procedure returns, a client program can also obtain\nthe\nnumber of rows affected for the final statement executed\nwithin the routine: At\nthe SQL level, call the ROW_COUNT() function; from the C\nAPI, call the mysql_affected_rows() function.\n \nIf the CLIENT_MULTI_RESULTS API flag is set, CALL can return\nany number of resultsets and the called stored procedure can\nexecute prepared statements. If it is not set, at most one\nresultset can be returned and prepared statements cannot be\nused within procedures.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/call/','','https://mariadb.com/kb/en/library/call/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (407,27,'Concurrent Inserts','The MyISAM storage engine supports concurrent inserts. This\nfeature allows SELECT statements to be executed during\nINSERT operations, reducing contention.\n \nWhether concurrent inserts can be used or not depends on the\nvalue of the concurrent_insert server system variable:\nNEVER (0) disables concurrent inserts.\nAUTO (1) allows concurrent inserts only when the target\ntable has no free blocks (no data in the middle of the table\nhas been deleted after the last OPTIMIZE TABLE). This is the\ndefault.\nALWAYS (2) always enables concurrent inserts.\n \nIf the binary log is used, CREATE TABLE ... SELECT and\nINSERT ... SELECT statements cannot use concurrent inserts.\nThese statements acquire a read lock on the table, so\nconcurrent inserts will need to wait. This way the log can\nbe safely used to restore data.\n \nConcurrent inserts is not used by slaves with the row based\nreplication (see binary log formats).\n \nIf an INSERT statement contain the HIGH_PRIORITY clause,\nconcurrent inserts cannot be used. INSERT ... DELAYED is\nusually unneeded if concurrent inserts are enabled.\n \nLOAD DATA INFILE uses concurrent inserts if the CONCURRENT\nkeyword is specified and concurrent_insert is not NEVER.\nThis makes the statement slower (even if no other sessions\naccess the table) but reduces contention.\n \nLOCK TABLES allows non-conflicting concurrent inserts if a\nREAD LOCAL lock is used. Concurrent inserts are not allowed\nif the LOCAL keyword is omitted.\n \nNotes\n \nThe decision to enable concurrent insert for a table is done\nwhen the table is opened. If you change the value of\nconcurrent_insert it will only affect new opened tables. If\nyou want it to work for also for tables in use or cached,\nyou should do FLUSH TABLES after setting the variable.\n \n\n\nURL: https://mariadb.com/kb/en/library/concurrent-inserts/','','https://mariadb.com/kb/en/library/concurrent-inserts/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (408,27,'DELETE','Syntax\n------ \nSingle-table syntax:\n \nDELETE [LOW_PRIORITY] [QUICK] [IGNORE] \n FROM tbl_name [PARTITION (partition_list)]\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n [RETURNING select_expr \n [, select_expr ...]]\n \nMultiple-table syntax:\n \nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n tbl_name[.*] [, tbl_name[.*]] ...\n FROM table_references\n [WHERE where_condition]\n \nOr:\n \nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n FROM tbl_name[.*] [, tbl_name[.*]] ...\n USING table_references\n [WHERE where_condition]\n \nTrimming history:\n \nDELETE HISTORY\n FROM tbl_name [PARTITION (partition_list)]\n [BEFORE SYSTEM_TIME [TIMESTAMP|TRANSACTION] expression]\n \nDescription\n----------- \nOption | Description | \n \nLOW_PRIORITY | Wait until all SELECT\'s are done before\nstarting the statement. Used with storage engines that uses\ntable locking (MyISAM, Aria etc). See HIGH_PRIORITY and\nLOW_PRIORITY clauses for details. | \n \nQUICK | Signal the storage engine that it should expect that\na lot of rows are deleted. The storage engine engine can do\nthings to speed up the DELETE like ignoring merging of data\nblocks until all rows are deleted from the block (instead of\nwhen a block is half full). This speeds up things at the\nexpanse of lost space in data blocks. At least MyISAM and\nAria support this feature. | \n \nIGNORE | Don\'t stop the query even if a not-critical error\noccurs (like data overflow). See How IGNORE works for a full\ndescription. | \n \nFor the single-table syntax, the DELETE statement deletes\nrows\nfrom tbl_name and returns a count of the number of deleted\nrows. This count can\nbe obtained by calling the ROW_COUNT() function. The\nWHERE clause, if given, specifies the conditions that\nidentify\nwhich rows to delete. With no WHERE clause, all rows are\ndeleted. If the ORDER BY clause is specified, the rows are\ndeleted in the order that is specified. The LIMIT clause\nplaces a limit on the number of rows that can be deleted.\n \nFor the multiple-table syntax, DELETE deletes from each\ntbl_name the rows that satisfy the conditions. In this case,\nORDER BY and LIMIT> cannot be used. A DELETE can also\nreference tables which are located in different databases;\nsee Identifier Qualifiers for the syntax.\n \nwhere_condition is an expression that evaluates to true for\neach row to be deleted. It is specified as described in\nSELECT.\n \nCurrently, you cannot delete from a table and select from\nthe same\ntable in a subquery.\n \nYou need the DELETE privilege on a table to delete rows from\nit. You need only the SELECT privilege for any columns that\nare only read, such as those named in the WHERE clause. See\nGRANT.\n \nThe PARTITION clause was introduced in MariaDB 10.0. See\nPartition Pruning and Selection for details.\n \nAs stated, a DELETE statement with no WHERE\nclause deletes all rows. A faster way to do this, when you\ndo not need to know\nthe number of deleted rows, is to use TRUNCATE TABLE.\nHowever,\nwithin a transaction or if you have a lock on the table, \nTRUNCATE TABLE cannot be used whereas DELETE\ncan. See TRUNCATE TABLE, and\nLOCK.\n \nFrom MariaDB 10.0.5, it is possible to return a resultset of\nthe deleted rows for a single table to the client by using\nthe syntax DELETE ... RETURNING select_expr [, select_expr2\n...]]\n \nAny of SQL expression that can be calculated from a single\nrow fields is allowed. Subqueries are allowed. The AS\nkeyword is allowed, so it is possible to use aliases.\n \nThe use of aggregate functions is not allowed. RETURNING\ncannot be used in multi-table DELETEs.\n \nSame Source and Target Table\n \nUntil MariaDB 10.3.1, deleting from a table with the same\nsource and target was not possible. From MariaDB 10.3.1,\nthis is now possible. For example:\n \nDELETE FROM t1 WHERE c1 IN (SELECT b.c1 FROM t1 b WHERE\nb.c2=0);\n \nOne can use DELETE HISTORY to delete historical information\nfrom System-versioned tables.\n \nExamples\n-------- \nHow to use the ORDER BY and LIMIT clauses:\n \nDELETE FROM page_hit ORDER BY timestamp LIMIT 1000000;\n \nHow to use the RETURNING clause:\n \nDELETE FROM t RETURNING f1;\n \n+------+\n| f1 |\n+------+\n| 5 |\n| 50 |\n| 500 |\n+------+ \n \nThe following statement joins two tables: one is only used\nto satisfy a WHERE condition, but no row is deleted from it;\nrows from the other table are deleted, instead.\n \nDELETE post FROM blog INNER JOIN post WHERE blog.id =\npost.blog_id;\n \nDeleting from the Same Source and Target\n \nCREATE TABLE t1 (c1 INT, c2 INT);\nDELETE FROM t1 WHERE c1 IN (SELECT b.c1 FROM t1 b WHERE\nb.c2=0);\n \nUntil MariaDB 10.3.1, this returned:\n \nERROR 1093 (HY000): Table \'t1\' is specified twice, both as\na target for \'DELETE\' \n and as a separate source for\n \nFrom MariaDB 10.3.1:\n \nQuery OK, 0 rows affected (0.00 sec)\n \n\n\nURL: https://mariadb.com/kb/en/library/delete/','','https://mariadb.com/kb/en/library/delete/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (409,27,'DO','Syntax\n------ \nDO expr [, expr] ...\n \nDescription\n----------- \n DO executes the expressions but does not return any\nresults. In most respects, DO is shorthand for\n SELECT expr, ..., but has the advantage that it is slightly\nfaster when you do not care about the result.\n \n DO is useful primarily with functions that have side\n effects, such as RELEASE_LOCK().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/do/','','https://mariadb.com/kb/en/library/do/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (410,27,'DUAL','Description\n----------- \nYou are allowed to specify DUAL as a dummy table name in\nsituations where no tables are referenced, such as the\nfollowing SELECT statement:\n \nSELECT 1 + 1 FROM DUAL;\n \n+-------+\n| 1 + 1 |\n+-------+\n| 2 |\n+-------+\n \n DUAL is purely for the convenience of people who require\n that all SELECT statements should have\n FROM and possibly other clauses. MariaDB ignores the\n clauses. MariaDB does not require FROM DUAL if no tables\n are referenced.\n \nFROM DUAL could be used when you only SELECT computed\nvalues, but require a WHERE clause, perhaps to test that a\nscript correctly handles empty resultsets:\n \nSELECT 1 FROM DUAL WHERE FALSE;\n \nEmpty set (0.00 sec)\n \n\n\nURL: https://mariadb.com/kb/en/library/dual/','','https://mariadb.com/kb/en/library/dual/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (411,27,'EXCEPT','EXCEPT was introduced in MariaDB 10.3.0.\n \nThe result of EXCEPT is all records of the left SELECT\nresult set except records which are in right SELECT result\nset, i.e. it is subtraction of two result sets.\n \nSyntax\n------ \nSELECT ...\n(INTERSECT | EXCEPT | UNION [ALL | DISTINCT]) SELECT ...\n[(INTERSECT | EXCEPT | UNION [ALL | DISTINCT]) SELECT ...]\n[ORDER BY [column [, column ...]]]\n[LIMIT {[offset,] row_count | row_count OFFSET offset}]\n \nPlease note:\nALL is not supported by EXCEPT (and it is difficult to make\nsense of ALL with EXCEPT).\nBrackets for explicit operation precedence are not\nsupported; use a subquery in the FROM clause as a\nworkaround).\n \nDescription\n----------- \nMariaDB has supported EXCEPT and INTERSECT in addition to\nUNION since MariaDB 10.3.\n \nAll behavior for naming columns, ORDER BY and LIMIT is the\nsame as for UNION.\n \nEXCEPT implicitly supposes a DISTINCT operation.\n \nThe result of EXCEPT is all records of the left SELECT\nresult except records which are in right SELECT result set,\ni.e. it is subtraction of two result sets.\n \nEXCEPT and UNION have the same operation precedence.\n \n\nParentheses\n \nFrom MariaDB 10.4.0, parentheses can be used to specify\nprecedence. Before this, a syntax error would be returned.\n \nExamples\n-------- \nShow customers which are not employees:\n \n(SELECT e_name AS name, email FROM customers)\nEXCEPT\n(SELECT c_name AS name, email FROM employees);\n \nDifference between UNION, EXCEPT and INTERSECT:\n \nCREATE TABLE seqs (i INT);\nINSERT INTO seqs VALUES (1),(2),(3),(4),(5),(6);\n \nSELECT i FROM seqs WHERE i =3;\n \n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n| 3 |\n| 4 |\n| 5 |\n| 6 |\n+------+\n \nSELECT i FROM seqs WHERE i =3;\n \n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n+------+\n \nSELECT i FROM seqs WHERE i =3;\n \n+------+\n| i |\n+------+\n| 3 |\n+------+\n \nParentheses for specifying precedence, from MariaDB 10.4.0\n \nCREATE OR REPLACE TABLE t1 (a INT);\nCREATE OR REPLACE TABLE t2 (b INT);\nCREATE OR REPLACE TABLE t3 (c INT);\n \nINSERT INTO t1 VALUES (1),(2),(3),(4);\nINSERT INTO t2 VALUES (5),(6);\nINSERT INTO t3 VALUES (1),(6);\n \n((SELECT a FROM t1) UNION (SELECT b FROM t2)) EXCEPT (SELECT\nc FROM t3);\n+------+\n| a |\n+------+\n| 2 |\n| 3 |\n| 4 |\n| 5 |\n+------+\n \n(SELECT a FROM t1) UNION ((SELECT b FROM t2) EXCEPT (SELECT\nc FROM t3));\n+------+\n| a |\n+------+\n| 1 |\n| 2 |\n| 3 |\n| 4 |\n| 5 |\n+------+\n \n\n\nURL: https://mariadb.com/kb/en/library/except/','','https://mariadb.com/kb/en/library/except/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (412,27,'FOR UPDATE','The FOR UPDATE clause of SELECT applies only when autocommit\nis set to 0 or the SELECT is enclosed in a transaction. A\nlock is acquired on the rows, and other transactions are\nprevented from writing the rows, acquire locks, and from\nreading them (unless their isolation level is READ\nUNCOMMITTED).\n \nIf autocommit is set to 1, the LOCK IN SHARE MODE and FOR\nUPDATE clauses have no effect.\n \nIf the isolation level is set to SERIALIZABLE, all plain\nSELECT statements are converted to SELECT ... LOCK IN SHARE\nMODE.\n \nExample\n \nSELECT * FROM trans WHERE period=2001 FOR UPDATE;\n \n\n\nURL: https://mariadb.com/kb/en/library/for-update/','','https://mariadb.com/kb/en/library/for-update/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (413,27,'GROUP BY','Use the GROUP BY clause in a SELECT statement to group rows\ntogether that have the same value in one or more column, or\nthe same computed value using expressions with any\nfunctions and operators except\ngrouping functions. When you\nuse a GROUP BY clause, you will get a single result row for\neach group of rows\nthat have the same value for the expression given in GROUP\nBY.\n \nWhen grouping rows, grouping values are compared as if by\nthe = operator.\nFor string values, the = operator ignores trailing\nwhitespace and may normalize\ncharacters and ignore case, depending on the collation in\nuse.\n \nYou can use any of the grouping functions in your select\nexpression. Their values will\nbe calculated based on all the rows that have been grouped\ntogether for each result\nrow. If you select a non-grouped column or a value computed\nfrom a non-grouped\ncolumn, it is undefined which row the returned value is\ntaken from. This is not permitted if the ONLY_FULL_GROUP_BY\nSQL_MODE is used.\n \nYou can use multiple expressions in the GROUP BY clause,\nseparated by commas.\nRows are grouped together if they match on each of the\nexpressions.\n \nYou can also use a single integer as the grouping\nexpression. If you use an integer n,\nthe results will be grouped by the nth column in the select\nexpression.\n \nThe WHERE clause is applied before the GROUP BY clause. It\nfilters non-aggregated\nrows before the rows are grouped together. To filter grouped\nrows based on aggregate values,\nuse the HAVING clause. The HAVING clause takes any\nexpression and evaluates it as\na boolean, just like the WHERE clause. You can use grouping\nfunctions in the HAVING\nclause. As with the select expression, if you reference\nnon-grouped columns in the HAVING\nclause, the behavior is undefined.\n \nBy default, if a GROUP BY clause is present, the rows in the\noutput will be sorted by the expressions used in the GROUP\nBY. You can also specify ASC or DESC (ascending, descending)\nafter those expressions, like in ORDER BY. The default is\nASC.\n \nIf you want the rows to be sorted by another field, you can\nadd an explicit ORDER BY. If you don\'t want the result to\nbe ordered, you can add ORDER BY NULL.\n \nWITH ROLLUP\n \nThe WITH ROLLUP modifer adds extra rows to the resultset\nthat represent super-aggregate summaries. For a full\ndescription with examples, see SELECT WITH ROLLUP.\n \nGROUP BY Examples\n \nConsider the following table that records how many times\neach user has played and won a game:\n \nCREATE TABLE plays (name VARCHAR(16), plays INT, wins INT);\nINSERT INTO plays VALUES \n (\"John\", 20, 5), \n (\"Robert\", 22, 8), \n (\"Wanda\", 32, 8), \n (\"Susan\", 17, 3);\n \nGet a list of win counts along with a count:\n \nSELECT wins, COUNT(*) FROM plays GROUP BY wins;\n \n+------+----------+\n| wins | COUNT(*) |\n+------+----------+\n| 3 | 1 |\n| 5 | 1 |\n| 8 | 2 |\n+------+----------+\n3 rows in set (0.00 sec)\n \nThe GROUP BY expression can be a computed value, and can\nrefer back to an identifer\nspecified with AS. Get a list of win averages along with a\ncount:\n \nSELECT (wins / plays) AS winavg, COUNT(*) FROM plays GROUP\nBY winavg;\n \n+--------+----------+\n| winavg | COUNT(*) |\n+--------+----------+\n| 0.1765 | 1 |\n| 0.2500 | 2 |\n| 0.3636 | 1 |\n+--------+----------+\n3 rows in set (0.00 sec)\n \nYou can use any grouping function\nin the select expression. For each win average as above, get\na list of the average play\ncount taken to get that average:\n \nSELECT (wins / plays) AS winavg, AVG(plays) FROM plays \n GROUP BY winavg;\n \n+--------+------------+\n| winavg | AVG(plays) |\n+--------+------------+\n| 0.1765 | 17.0000 |\n| 0.2500 | 26.0000 |\n| 0.3636 | 22.0000 |\n+--------+------------+\n3 rows in set (0.00 sec)\n \nYou can filter on aggregate information using the HAVING\nclause. The HAVING\nclause is applied after GROUP BY and allows you to filter on\naggregate data that is\nnot available to the WHERE clause. Restrict the above\nexample to results that involve\nan average number of plays over 20:\n \nSELECT (wins / plays) AS winavg, AVG(plays) FROM plays \n GROUP BY winavg HAVING AVG(plays) > 20;\n \n+--------+------------+\n| winavg | AVG(plays) |\n+--------+------------+\n| 0.2500 | 26.0000 |\n| 0.3636 | 22.0000 |\n+--------+------------+\n2 rows in set (0.00 sec)\n \nSee Also\n \nSELECT\nJoins and Subqueries\nLIMIT\nORDER BY\nCommon Table Expressions\nSELECT WITH ROLLUP\nSELECT INTO OUTFILE\nSELECT INTO DUMPFILE\nFOR UPDATE\nLOCK IN SHARE MODE\nOptimizer Hints\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/group-by/','','https://mariadb.com/kb/en/library/group-by/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (414,27,'HANDLER Commands','Syntax\n------ \nHANDLER tbl_name OPEN [ [AS] alias]\nHANDLER tbl_name READ index_name { = | >= | = | \n\nURL: https://mariadb.com/kb/en/library/handler-commands/','','https://mariadb.com/kb/en/library/handler-commands/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (415,27,'HIGH_PRIORITY and LOW_PRIORITY','The XtraDB/InnoDB storage engine uses row-level locking to\nensure data integrity. However some storage engines (such as\nMEMORY, MyISAM, Aria and MERGE) lock the whole table to\nprevent conflicts. These storage engines use two separate\nqueues to remember pending statements; one is for SELECTs\nand the other one is for write statements (INSERT, DELETE,\nUPDATE). By default, the latter has a higher priority.\n \nTo give write operations a lower priority, the\nlow_priority_updates server system variable can be set to\nON. The option is available on both the global and session\nlevels, and it can be set at startup or via the SET\nstatement.\n \nWhen too many table locks have been set by write statements,\nsome pending SELECTs are executed. The maximum number of\nwrite locks that can be acquired before this happens is\ndetermined by the max_write_lock_count server system\nvariable, which is dynamic.\n \nIf write statements have a higher priority (default), the\npriority of individual write statements (INSERT, REPLACE,\nUPDATE, DELETE) can be changed via the LOW_PRIORITY\nattribute, and the priority of a SELECT statement can be\nraised via the HIGH_PRIORITY attribute. Also, LOCK TABLES\nsupports a LOW_PRIORITY attribute for WRITE locks.\n \nIf read statements have a higher priority, the priority of\nan INSERT can be changed via the HIGH_PRIORITY attribute.\nHowever, the priority of other write statements cannot be\nraised individually.\n \nThe use of LOW_PRIORITY or HIGH_PRIORITY for an INSERT\nprevents Concurrent Inserts from being used.\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/high_priority-and-low_priority/','','https://mariadb.com/kb/en/library/high_priority-and-low_priority/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (416,27,'IGNORE','The IGNORE option tells the server to ignore some common\nerrors.\n \nIGNORE can be used with the following statements:\nDELETE\nINSERT (see also INSERT IGNORE)\nLOAD DATA INFILE\nUPDATE\nALTER TABLE\nCREATE TABLE ... SELECT\nINSERT ... SELECT\n \nThe logic used:\nVariables out of ranges are replaced with the\nmaximum/minimum value.\n \nSQL_MODEs STRICT_TRANS_TABLES, STRICT_ALL_TABLES,\nNO_ZERO_IN_DATE, NO_ZERO_DATE are ignored.\n \nInserting NULL in a NOT NULL field will insert 0 ( in a\nnumerical\n field), 0000-00-00 ( in a date field) or an empty string (\nin a character\n field).\n \nRows that cause a duplicate key error or break a foreign key\nconstraint are\n not inserted, updated, or deleted.\n \nThe following errors are ignored:\n \nError number | Symbolic error name | Description | \n \n1022 | ER_DUP_KEY | Can\'t write; duplicate key in table\n\'%s\' | \n \n1048 | ER_BAD_NULL_ERROR | Column \'%s\' cannot be null | \n \n1062 | ER_DUP_ENTRY | Duplicate entry \'%s\' for key %d | \n \n1242 | ER_SUBQUERY_NO_1_ROW | Subquery returns more than 1\nrow | \n \n1264 | ER_WARN_DATA_OUT_OF_RANGE | Out of range value for\ncolumn \'%s\' at row %ld | \n \n1265 | WARN_DATA_TRUNCATED | Data truncated for column\n\'%s\' at row %ld | \n \n1292 | ER_TRUNCATED_WRONG_VALUE | Truncated incorrect %s\nvalue: \'%s\' | \n \n1366 | ER_TRUNCATED_WRONG_VALUE_FOR_FIELD | Incorrect\ninteger value | \n \n1369 | ER_VIEW_CHECK_FAILED | CHECK OPTION failed \'%s.%s\'\n| \n \n1451 | ER_ROW_IS_REFERENCED_2 | Cannot delete or update a\nparent row | \n \n1452 | ER_NO_REFERENCED_ROW_2 | Cannot add or update a child\nrow: a foreign key constraint fails (%s) | \n \n1526 | ER_NO_PARTITION_FOR_GIVEN_VALUE | Table has no\npartition for value %s | \n \n1586 | ER_DUP_ENTRY_WITH_KEY_NAME | Duplicate entry \'%s\'\nfor key \'%s\' | \n \n1591 | ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT | Table has no\npartition for some existing values | \n \n1748 | ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET | Found a\nrow not matching the given partition set | \n \nIgnored errors normally generate a warning.\n \nA property of the IGNORE clause consists in causing\ntransactional engines and non-transactional engines (like\nXtraDB and Aria) to behave the same way. For example,\nnormally a multi-row insert which tries to violate a UNIQUE\ncontraint is completely rolled back on XtraDB/InnoDB, but\nmight be partially executed on Aria. With the IGNORE clause,\nthe statement will be partially executed in both engines.\n \nStarting from MariaDB 5.5.28 duplicate key errors also\ngenerate warnings. The OLD_MODE server variable can be used\nto prevent this.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/ignore/','','https://mariadb.com/kb/en/library/ignore/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (417,27,'INSERT','Syntax\n------ \nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n [, col=expr] ... ]\n \nOr:\n \nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)]\n SET col={expr | DEFAULT}, ...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n [, col=expr] ... ]\n \nOr:\n \nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n SELECT ...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n [, col=expr] ... ]\n \nThe INSERT statement is used to insert new rows into an\nexisting table. The INSERT ... VALUES\nand INSERT ... SET forms of the statement insert rows based\non explicitly specified values. The INSERT ... SELECT form\ninserts rows selected from another table or tables. INSERT\n... SELECT is discussed further in the INSERT ... SELECT\narticle.\n \nThe table name can be specified in the form db_name.tbl_name\nor, if a default database is selected, in the form tbl_name\n(see Identifier Qualifiers). This allows to use INSERT ...\nSELECT to copy rows between different databases.\n \nThe PARTITION clause was introduced in MariaDB 10.0. It can\nbe used in both the INSERT and the SELECT part. See\nPartition Pruning and Selection for details.\n \nThe columns list is optional. It specifies which values are\nexplicitly inserted, and in which order. If this clause is\nnot specified, all values must be explicitly specified, in\nthe same order they are listed in the table definition.\n \nThe list of value follow the VALUES or VALUE keyword (which\nare interchangeable, regardless how much values you want to\ninsert), and is wrapped by parenthesis. The values must be\nlisted in the same order as the columns list. It is possible\nto specify more than one list to insert more than one rows\nwith a single statement. If many rows are inserted, this is\na speed optimization.\n \nFor one-row statements, the SET clause may be more simple,\nbecause you don\'t need to remember the columns order. All\nvalues are specified in the form col = expr.\n \nValues can also be specified in the form of a SQL expression\nor subquery. However, the subquery cannot access the same\ntable that is named in the INTO clause.\n \nIf you use the LOW_PRIORITY keyword, execution of the INSERT\nis delayed until no other clients are reading from the\ntable. If you use the HIGH_PRIORITY keyword, the statement\nhas the same priority as SELECTs. This affects only storage\nengines that use only table-level locking (MyISAM, MEMORY,\nMERGE). However, if one of these keywords is specified,\nconcurrent inserts cannot be used. See HIGH_PRIORITY and\nLOW_PRIORITY clauses for details.\n \nINSERT DELAYED\n \nFor more details on the DELAYED option, see INSERT DELAYED.\n \nHIGH PRIORITY and LOW PRIORITY\n \nSee HIGH_PRIORITY and LOW_PRIORITY.\n \nDefaults and Duplicate Values\n \nSee INSERT - Default & Duplicate Values for details..\n \nINSERT IGNORE\n \nSee INSERT IGNORE.\n \nINSERT ON DUPLICATE KEY UPDATE\n \nSee INSERT ON DUPLICATE KEY UPDATE.\n \nExamples\n-------- \nSpecifying the column names:\n \nINSERT INTO person (first_name, last_name) VALUES (\'John\',\n\'Doe\');\n \nInserting more than 1 row at a time:\n \nINSERT INTO tbl_name VALUES (1, \"row 1\"), (2, \"row 2\");\n \nUsing the SET clause:\n \nINSERT INTO person SET first_name = \'John\', last_name =\n\'Doe\';\n \nSELECTing from another table:\n \nINSERT INTO contractor SELECT * FROM person WHERE status =\n\'c\';\n \nSee INSERT ON DUPLICATE KEY UPDATE and INSERT IGNORE for\nfurther examples.\n \n\n\nURL: https://mariadb.com/kb/en/library/insert/','','https://mariadb.com/kb/en/library/insert/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (418,27,'INSERT - Default &amp; Duplicate Values','Default Values\n \nIf the SQL_MODE contains STRICT_TRANS_TABLES and you are\ninserting into a transactional table (like InnoDB), or if\nthe SQL_MODE contains STRICT_ALL_TABLES, all NOT NULL\ncolumns which does not have a DEFAULT value (and is not\nAUTO_INCREMENT) must be explicitly referenced in INSERT\nstatements. If not, an error like this is produced:\n \nERROR 1364 (HY000): Field \'col\' doesn\'t have a default\nvalue\n \nIn all other cases, if a NOT NULL column without a DEFAULT\nvalue is not referenced, an empty value will be inserted\n(for example, 0 for INTEGER columns and \'\' for CHAR\ncolumns). See NULL Values in MariaDB:Inserting for examples.\n \nIf a NOT NULL column having a DEFAULT value is not\nreferenced, NULL will be inserted.\n \nIf a NULL column having a DEFAULT value is not referenced,\nits default value will be inserted. It is also possible to\nexplicitly assign the default value using the DEFAULT\nkeyword or the DEFAULT() function.\n \nIf the DEFAULT keyword is used but the column does not have\na DEFAULT value, an error like this is produced:\n \nERROR 1364 (HY000): Field \'col\' doesn\'t have a default\nvalue\n \nDuplicate Values\n \nBy default, if you try to insert a duplicate row and there\nis a UNIQUE index, INSERT stops and an error like this is\nproduced:\n \nERROR 1062 (23000): Duplicate entry \'dup_value\' for key\n\'col\'\n \nTo handle duplicates you can use the IGNORE clause, INSERT\nON DUPLICATE KEY UPDATE or the REPLACE statement. Note that\nthe IGNORE and DELAYED options are ignored when you use ON\nDUPLICATE KEY UPDATE.\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/insert-default-duplicate-values/','','https://mariadb.com/kb/en/library/insert-default-duplicate-values/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (419,27,'INSERT DELAYED','Syntax\n------ \nINSERT DELAYED ...\n \nDescription\n----------- \nThe DELAYED option for the INSERT\nstatement is a MariaDB/MySQL extension to standard SQL that\nis very useful if you have\nclients that cannot or need not wait for the INSERT to\ncomplete. This is a common situation when you use MariaDB\nfor logging and you\nalso periodically run SELECT and UPDATE\nstatements that take a long time to complete.\n \nWhen a client uses INSERT DELAYED, it gets an okay from the\nserver at once, and the row is queued to be inserted when\nthe table is not in\nuse by any other thread.\n \nAnother major benefit of using INSERT DELAYED is that\ninserts from many clients are bundled together and written\nin one block. This\nis much faster than performing many separate inserts.\n \nNote that INSERT DELAYED is slower than a normal\n INSERT if the table is not otherwise in use. There is also\nthe additional overhead for the server to handle a separate\nthread for each\ntable for which there are delayed rows. This means that you\nshould use\nINSERT DELAYED only when you are really sure that you need\nit.\n \nThe queued rows are held only in memory until they are\ninserted into the table.\nThis means that if you terminate mysqld forcibly (for\nexample, with kill -9) or\nif mysqld dies unexpectedly, any queued rows that have not\nbeen written to disk\nare lost.\n \nThe number of concurrent INSERT DELAYED threads is limited\nby the max_delayed_threads server system variables. If it is\nset to 0, INSERT DELAYED is disabled. The session value can\nbe equal to the global value, or 0 to disable this statement\nfor the current session. If this limit has been reached, the\nDELAYED clause will be silently ignore for subsequent\nstatements (no error will be produced).\n \nThere are some constraints on the use of DELAYED:\nINSERT DELAYED works only with MyISAM, MEMORY, ARCHIVE,\n and BLACKHOLE tables. If you execute INSERT DELAYED with\nanother storage engine, you will get an error like this:\nERROR 1616 (HY000): DELAYED option not supported for table\n\'tab_name\'\nFor MyISAM tables, if there are no free blocks in the middle\nof the data\n file, concurrent SELECT and INSERT statements are\nsupported. Under these\n circumstances, you very seldom need to use INSERT DELAYED\n with MyISAM.\nINSERT DELAYED should be used only for\n INSERT statements that specify value lists. The server\n ignores DELAYED for INSERT ... SELECT\n or INSERT ... ON DUPLICATE KEY UPDATE statements.\nBecause the INSERT DELAYED statement returns immediately,\n before the rows are inserted, you cannot use\n LAST_INSERT_ID() to get the\n AUTO_INCREMENT value that the statement might generate.\nDELAYED rows are not visible to SELECT\n statements until they actually have been inserted.\nAfter INSERT DELAYED, ROW_COUNT() returns the number of the\nrows you tried to insert, not the number of the successful\nwrites.\nDELAYED is ignored on slave replication servers, so that \n INSERT DELAYED is treated as a normal\n INSERT on slaves. This is because\n DELAYED could cause the slave to have different data than\n the master. INSERT DELAYED statements are not safe for\nreplication.\nPending INSERT DELAYED statements are lost if a table is\n write locked and ALTER TABLE is used to modify the table\nstructure.\nINSERT DELAYED is not supported for views. If you try, you\nwill get an error like this: ERROR 1347 (HY000):\n\'view_name\' is not BASE TABLE\nINSERT DELAYED is not supported for partitioned tables.\nINSERT DELAYED is not supported within stored programs.\n \n\n\nURL: https://mariadb.com/kb/en/library/insert-delayed/','','https://mariadb.com/kb/en/library/insert-delayed/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (420,27,'INSERT IGNORE','Ignoring Errors\n \nNormally INSERT stops and rolls back when it encounters an\nerror.\n \nBy using the IGNORE keyword all errors are converted to\nwarnings, which will not stop inserts of additional rows.\n \nThe IGNORE and DELAYED options are ignored when you use ON\nDUPLICATE KEY UPDATE.\n \nIncompatibilities\n \nMariaDB until 5.5.28\nMySQL and MariaDB before 5.5.28 didn\'t give warnings for\nduplicate key errors when using IGNORE.\nYou can get the old behaviour if you set OLD_MODE to\nNO_DUP_KEY_WARNINGS_WITH_IGNORE\n \nExamples\n-------- \nCREATE TABLE t1 (x INT UNIQUE);\n \nINSERT INTO t1 VALUES(1),(2);\n \nINSERT INTO t1 VALUES(2),(3);\nERROR 1062 (23000): Duplicate entry \'2\' for key \'x\'\nSELECT * FROM t1;\n \n+------+\n| x |\n+------+\n| 1 |\n| 2 |\n+------+\n2 rows in set (0.00 sec)\n \nINSERT IGNORE INTO t1 VALUES(2),(3);\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n \nSHOW WARNINGS;\n \n+---------+------+---------------------------------+\n| Level | Code | Message |\n+---------+------+---------------------------------+\n| Warning | 1062 | Duplicate entry \'2\' for key \'x\' |\n+---------+------+---------------------------------+\n \nSELECT * FROM t1;\n \n+------+\n| x |\n+------+\n| 1 |\n| 2 |\n| 3 |\n+------+\n \nSee INSERT ON DUPLICATE KEY UPDATE for further examples\nusing that syntax.\n \n\n\nURL: https://mariadb.com/kb/en/library/insert-ignore/','','https://mariadb.com/kb/en/library/insert-ignore/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (421,27,'INSERT ON DUPLICATE KEY UPDATE','Syntax\n------ \nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n [, col=expr] ... ]\n \nOr:\n \nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)]\n SET col={expr | DEFAULT}, ...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n [, col=expr] ... ]\n \nOr:\n \nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n SELECT ...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n [, col=expr] ... ]\n \nDescription\n----------- \nINSERT ... ON DUPLICATE KEY UPDATE is a MariaDB/MySQL\nextension to the INSERT statement that, if it finds a\nduplicate unique or primary key, will instead perform an\nUPDATE.\n \nThe row/s affected value is reported as 1 if a row is\ninserted, and 2 if a row is updated, unless the API\'s\nCLIENT_FOUND_ROWS flag is set.\n \nIf more than one unique index is matched, only the first is\nupdated. It is not recommended to use this statement on\ntables with more than one unique index.\n \nIf the table has an AUTO_INCREMENT primary key and the\nstatement inserts or updates a row, the LAST_INSERT_ID()\nfunction returns its AUTO_INCREMENT value.\n \nThe VALUES() function can only be used in a ON DUPLICATE KEY\nUPDATE clause and has no meaning in any other context. It\nreturns the column values from the INSERT portion of the\nstatement. This function is particularly useful for\nmulti-rows inserts.\n \nThe IGNORE and DELAYED options are ignored when you use ON\nDUPLICATE KEY UPDATE.\n \nThe PARTITION clause was introduced in MariaDB 10.0. See\nPartition Pruning and Selection for details.\n \nThis statement activates INSERT and UPDATE triggers. See\nTrigger Overview for details.\n \nSee also a similar statement, REPLACE.\n \nExamples\n-------- \nCREATE TABLE ins_duplicate (id INT PRIMARY KEY, animal\nVARCHAR(30));\nINSERT INTO ins_duplicate VALUES (1,\'Aardvark\'),\n(2,\'Cheetah\'), (3,\'Zebra\');\n \nIf there is no existing key, the statement runs as a regular\nINSERT:\n \nINSERT INTO ins_duplicate VALUES (4,\'Gorilla\') ON\nDUPLICATE KEY UPDATE animal=\'Gorilla\';\nQuery OK, 1 row affected (0.07 sec)\n \nSELECT * FROM ins_duplicate;\n+----+----------+\n| id | animal |\n+----+----------+\n| 1 | Aardvark |\n| 2 | Cheetah |\n| 3 | Zebra |\n| 4 | Gorilla |\n+----+----------+\n \nA regular INSERT with a primary key value of 1 will fail,\ndue to the existing key:\n \nINSERT INTO ins_duplicate VALUES (1,\'Antelope\');\nERROR 1062 (23000): Duplicate entry \'1\' for key\n\'PRIMARY\'\n \nHowever, we can use an INSERT ON DUPLICATE KEY UPDATE\ninstead:\n \nINSERT INTO ins_duplicate VALUES (1,\'Antelope\') ON\nDUPLICATE KEY UPDATE animal=\'Antelope\';\nQuery OK, 2 rows affected (0.09 sec)\n \nNote that there are two rows reported as affected, but this\nrefers only to the UPDATE.\n \nSELECT * FROM ins_duplicate;\n+----+----------+\n| id | animal |\n+----+----------+\n| 1 | Antelope |\n| 2 | Cheetah |\n| 3 | Zebra |\n| 4 | Gorilla |\n+----+----------+\n \nAdding a second unique column:\n \nALTER TABLE ins_duplicate ADD id2 INT;\nUPDATE ins_duplicate SET id2=id+10;\nALTER TABLE ins_duplicate ADD UNIQUE KEY(id2);\n \nWhere two rows match the unique keys match, only the first\nis updated. This can be unsafe and is not recommended unless\nyou are certain what you are doing. Note that the warning\nshown below appears in MariaDB 5.5 and before, but has been\nremoved in MariaDB 10.0, as MariaDB now assumes that the\nkeys are checked in order, as shown in SHOW CREATE TABLE.\n \nINSERT INTO ins_duplicate VALUES (2,\'Lion\',13) ON\nDUPLICATE KEY UPDATE animal=\'Lion\';\nQuery OK, 2 rows affected, 1 warning (0.06 sec)\n \nSHOW WARNINGS;\n+-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Level | Code | Message |\n+-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Note | 1592 | Unsafe statement written to the binary log\nusing statement format since BINLOG_FORMAT = STATEMENT.\nINSERT... ON DUPLICATE KEY UPDATE on a table with more than\none UNIQUE KEY is unsafe |\n+-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n \nSELECT * FROM ins_duplicate;\n+----+----------+------+\n| id | animal | id2 |\n+----+----------+------+\n| 1 | Antelope | 11 |\n| 2 | Lion | 12 |\n| 3 | Zebra | 13 |\n| 4 | Gorilla | 14 |\n+----+----------+------+\n \nAlthough the third row with an id of 3 has an id2 of 13,\nwhich also matched, it was not updated.\n \nChanging id to an auto_increment field. If a new row is\nadded, the auto_increment is moved forward. If the row is\nupdated, it remains the same.\n \nALTER TABLE `ins_duplicate` CHANGE `id` `id` INT( 11 ) NOT\nNULL AUTO_INCREMENT;\nALTER TABLE ins_duplicate DROP id2;\nSELECT Auto_increment FROM INFORMATION_SCHEMA.TABLES WHERE\nTABLE_NAME=\'ins_duplicate\';\n+----------------+\n| Auto_increment |\n+----------------+\n| 5 |\n+----------------+\n \nINSERT INTO ins_duplicate VALUES (2,\'Leopard\') ON\nDUPLICATE KEY UPDATE animal=\'Leopard\';\nQuery OK, 2 rows affected (0.00 sec)\n \nSELECT Auto_increment FROM INFORMATION_SCHEMA.TABLES WHERE\nTABLE_NAME=\'ins_duplicate\';\n+----------------+\n| Auto_increment |\n+----------------+\n| 5 |\n+----------------+\n \nINSERT INTO ins_duplicate VALUES (5,\'Wild Dog\') ON\nDUPLICATE KEY UPDATE animal=\'Wild Dog\';\nQuery OK, 1 row affected (0.09 sec)\n \nSELECT * FROM ins_duplicate;\n+----+----------+\n| id | animal |\n+----+----------+\n| 1 | Antelope |\n| 2 | Leopard |\n| 3 | Zebra |\n| 4 | Gorilla |\n| 5 | Wild Dog |\n+----+----------+\n \nSELECT Auto_increment FROM INFORMATION_SCHEMA.TABLES WHERE\nTABLE_NAME=\'ins_duplicate\';\n+----------------+\n| Auto_increment |\n+----------------+\n| 6 |\n+----------------+\n \nRefering to column values from the INSERT portion of the\nstatement: \n \nINSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6)\n ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);\n \nSee the VALUES() function for more.\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/insert-on-duplicate-key-update/','','https://mariadb.com/kb/en/library/insert-on-duplicate-key-update/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (422,27,'INSERT SELECT','Syntax\n------ \nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [(col_name,...)]\n SELECT ...\n [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]\n \nDescription\n----------- \nWith INSERT ... SELECT, you can quickly insert many rows\ninto a table from one or more other tables. For example:\n \nINSERT INTO tbl_temp2 (fld_id)\n SELECT tbl_temp1.fld_order_id\n FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;\n \ntbl_name can also be specified in the form db_name.tbl_name\n(see Identifier Qualifiers). This allows to copy rows\nbetween different databases.\n \nIf the new table has a primary key or UNIQUE indexes, you\ncan use IGNORE to handle duplicate key errors during the\nquery. The newer values will not be inserted if an identical\nvalue already exists.\n \nREPLACE can be used instead of INSERT to prevent duplicates\non UNIQUE indexes by deleting old values. In that case, ON\nDUPLICATE KEY UPDATE cannot be used.\n \nINSERT ... SELECT works for tables which already exist. To\ncreate a table for a given resultset, you can use CREATE\nTABLE ... SELECT.\n \n\n\nURL: https://mariadb.com/kb/en/library/insert-select/','','https://mariadb.com/kb/en/library/insert-select/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (423,27,'INTERSECT','INTERSECT was introduced in MariaDB 10.3.0.\n \nThe result of an intersect is the intersection of right and\nleft SELECT results, i.e. only records that are present in\nboth result sets will be included in the result of the\noperation.\n \nSyntax\n------ \nSELECT ...\n(INTERSECT | EXCEPT | UNION [ALL | DISTINCT]) SELECT ...\n[(INTERSECT | EXCEPT | UNION [ALL | DISTINCT]) SELECT ...]\n[ORDER BY [column [, column ...]]]\n[LIMIT {[offset,] row_count | row_count OFFSET offset}]\n \nPlease note:\nALL is not supported by INTERSECT (and it is difficult to\nmake sense of ALL with INTERSECT).\nBrackets for explicit operation precedence are not\nsupported; use a subquery in the FROM clause as a\nworkaround).\n \nDescription\n----------- \nMariaDB has supported INTERSECT (as well as EXCEPT) in\naddition to UNION since MariaDB 10.3.\n \nAll behavior for naming columns, ORDER BY and LIMIT is the\nsame as for UNION.\n \nINTERSECT implicitly supposes a DISTINCT operation.\n \nThe result of an intersect is the intersection of right and\nleft SELECT results, i.e. only records that are present in\nboth result sets will be included in the result of the\noperation.\n \nINTERSECT has higher precedence than UNION and EXCEPT. If\npossible it will be executed linearly but if not it will be\ntranslated to a subquery in the FROM clause:\n \n(select a,b from t1)\nunion\n(select c,d from t2)\nintersect\n(select e,f from t3)\nunion\n(select 4,4);\n \nwill be translated to:\n \n(select a,b from t1)\nunion\nselect c,d from\n ((select c,d from t2)\n intersect\n (select e,f from t3)) dummy_subselect\nunion\n(select 4,4)\n \n\n \nParentheses\n \nFrom MariaDB 10.4.0, parentheses can be used to specify\nprecedence. Before this, a syntax error would be returned.\n \nExamples\n-------- \nShow customers which are employees:\n \n(SELECT e_name AS name, email FROM employees)\nINTERSECT\n(SELECT c_name AS name, email FROM customers);\n \nDifference between UNION, EXCEPT and INTERSECT:\n \nCREATE TABLE seqs (i INT);\nINSERT INTO seqs VALUES (1),(2),(3),(4),(5),(6);\n \nSELECT i FROM seqs WHERE i =3;\n \n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n| 3 |\n| 4 |\n| 5 |\n| 6 |\n+------+\n \nSELECT i FROM seqs WHERE i =3;\n \n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n+------+\n \nSELECT i FROM seqs WHERE i =3;\n \n+------+\n| i |\n+------+\n| 3 |\n+------+\n \nParentheses for specifying precedence, from MariaDB 10.4.0\n \nCREATE OR REPLACE TABLE t1 (a INT);\nCREATE OR REPLACE TABLE t2 (b INT);\nCREATE OR REPLACE TABLE t3 (c INT);\n \nINSERT INTO t1 VALUES (1),(2),(3),(4);\nINSERT INTO t2 VALUES (5),(6);\nINSERT INTO t3 VALUES (1),(6);\n \n((SELECT a FROM t1) UNION (SELECT b FROM t2)) INTERSECT\n(SELECT c FROM t3);\n+------+\n| a |\n+------+\n| 1 |\n| 6 |\n+------+\n \n(SELECT a FROM t1) UNION ((SELECT b FROM t2) INTERSECT\n(SELECT c FROM t3));\n+------+\n| a |\n+------+\n| 1 |\n| 2 |\n| 3 |\n| 4 |\n| 6 |\n+------+\n \n\n\nURL: https://mariadb.com/kb/en/library/intersect/','','https://mariadb.com/kb/en/library/intersect/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (424,27,'JOIN Syntax','Description\n----------- \nMariaDB supports the following JOIN syntaxes for\nthe table_references part of SELECT statements and\nmultiple-table DELETE and UPDATE statements:\n \ntable_references:\n table_reference [, table_reference] ...\n \ntable_reference:\n table_factor\n | join_table\n \ntable_factor:\n tbl_name [PARTITION (partition_list)]\n [query_system_time_period_specification] [[AS] alias]\n[index_hint_list]\n | table_subquery [query_system_time_period_specification]\n[AS] alias\n | ( table_references )\n | { ON table_reference LEFT OUTER JOIN table_reference\n ON conditional_expr }\n \njoin_table:\n table_reference [INNER | CROSS] JOIN table_factor\n[join_condition]\n | table_reference STRAIGHT_JOIN table_factor\n | table_reference STRAIGHT_JOIN table_factor ON\nconditional_expr\n | table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference\njoin_condition\n | table_reference NATURAL [{LEFT|RIGHT} [OUTER]] JOIN\ntable_factor\n \njoin_condition:\n ON conditional_expr\n | USING (column_list)\n \nquery_system_time_period_specification:\n FOR SYSTEM_TIME AS OF point_in_time\n | FOR SYSTEM_TIME BETWEEN point_in_time AND point_in_time\n | FOR SYSTEM_TIME FROM point_in_time TO point_in_time\n | FOR SYSTEM_TIME ALL\n \npoint_in_time:\n [TIMESTAMP] expression\n | TRANSACTION expression\n \nindex_hint_list:\n index_hint [, index_hint] ...\n \nindex_hint:\n USE {INDEX|KEY}\n [{FOR {JOIN|ORDER BY|GROUP BY}] ([index_list])\n | IGNORE {INDEX|KEY}\n [{FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n | FORCE {INDEX|KEY}\n [{FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n \nindex_list:\n index_name [, index_name] ...\n \nA table reference is also known as a join expression.\n \nEach table can also be specified as db_name.tabl_name. This\nallows to write queries which involve multiple databases.\nSee Identifier Qualifiers for syntax details.\n \nThe syntax of table_factor is extended in comparison with\nthe\nSQL Standard. The latter accepts only table_reference, not a\nlist of them inside a pair of parentheses.\n \nThis is a conservative extension if we consider each comma\nin a list of\ntable_reference items as equivalent to an inner join. For\nexample:\n \nSELECT * FROM t1 LEFT JOIN (t2, t3, t4)\n ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n \nis equivalent to:\n \nSELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4)\n ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n \nIn MariaDB, CROSS JOIN is a syntactic equivalent to\nINNER JOIN (they can replace each other). In standard SQL,\nthey are not equivalent. INNER JOIN is used with an\nON clause, CROSS JOIN is used otherwise.\n \nIn general, parentheses can be ignored in join expressions\ncontaining only\ninner join operations. MariaDB also supports nested joins\n(see\nhttp://dev.mysql.com/doc/refman/5.1/en/nested-join-optimization.html).\n \nSee System-versioned tables for more information\nabout FOR SYSTEM_TIME syntax.\n \nIndex hints can be specified to affect how the MariaDB\noptimizer makes\nuse of indexes. For more information, see How to force query\nplans.\n \nExamples\n-------- \nSELECT left_tbl.*\n FROM left_tbl LEFT JOIN right_tbl ON left_tbl.id =\nright_tbl.id\n WHERE right_tbl.id IS NULL;\n \n\n \n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/join-syntax/','','https://mariadb.com/kb/en/library/join-syntax/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (425,27,'LIMIT','Description\n----------- \nUse the LIMIT clause to restrict the number of returned\nrows. When you use a single\ninteger n with LIMIT, the first n rows will be returned. Use\nthe ORDER BY\nclause to control which rows come first. You can also select\na number of rows after an offset\nusing either of the following:\n \nLIMIT offset, row_count\nLIMIT row_count OFFSET offset\n \nWhen you provide an offset m with a limit n, the first m\nrows will be ignored, and the\nfollowing n rows will be returned.\n \nExecuting an UPDATE with the LIMIT clause is not safe for\nreplication.\n \nSince MariaDB 10.0.11, LIMIT 0 has been an exception to this\nrule (see MDEV-6170).\n \nBeginning in MariaDB 5.5.21, there is a LIMIT ROWS EXAMINED\noptimization which provides the\nmeans to terminate the execution of SELECT statements which\nexamine too\nmany rows, and thus use too many resources. See LIMIT ROWS\nEXAMINED.\n \nMulti-Table Updates\n \nUntil MariaDB 10.3.1, it was not possible to use LIMIT (or\nORDER BY) in a multi-table UPDATE statement. This\nrestriction was lifted in MariaDB 10.3.2.\n \nGROUP_CONCAT\n \nStarting from MariaDB 10.3.3, it is possible to use LIMIT\nwith GROUP_CONCAT().\n \nExamples\n-------- \nCREATE TABLE members (name VARCHAR(20));\nINSERT INTO members\nVALUES(\'Jagdish\'),(\'Kenny\'),(\'Rokurou\'),(\'Immaculada\');\n \nSELECT * FROM members;\n \n+------------+\n| name |\n+------------+\n| Jagdish |\n| Kenny |\n| Rokurou |\n| Immaculada |\n+------------+\n \nSelect the first two names (no ordering specified):\n \nSELECT * FROM members LIMIT 2;\n \n+---------+\n| name |\n+---------+\n| Jagdish |\n| Kenny |\n+---------+\n \nAll the names in alphabetical order:\n \nSELECT * FROM members ORDER BY name;\n \n+------------+\n| name |\n+------------+\n| Immaculada |\n| Jagdish |\n| Kenny |\n| Rokurou |\n+------------+\n \nThe first two names, ordered alphabetically:\n \nSELECT * FROM members ORDER BY name LIMIT 2;\n \n+------------+\n| name |\n+------------+\n| Immaculada |\n| Jagdish |\n+------------+\n \nThe third name, ordered alphabetically (the first name would\nbe offset zero, so the third is offset two):\n \nSELECT * FROM members ORDER BY name LIMIT 2,1;\n \n+-------+\n| name |\n+-------+\n| Kenny |\n+-------+\n \nFrom MariaDB 10.3.2, LIMIT can be used in a multi-table\nupdate:\n \nCREATE TABLE warehouse (product_id INT, qty INT);\nINSERT INTO warehouse VALUES\n(1,100),(2,100),(3,100),(4,100);\n \nCREATE TABLE store (product_id INT, qty INT);\nINSERT INTO store VALUES (1,5),(2,5),(3,5),(4,5);\n \nUPDATE warehouse,store SET warehouse.qty = warehouse.qty-2,\nstore.qty = store.qty+2 \n WHERE (warehouse.product_id = store.product_id AND\nstore.product_id >= 1) \n ORDER BY store.product_id DESC LIMIT 2;\n \nSELECT * FROM warehouse;\n \n+------------+------+\n| product_id | qty |\n+------------+------+\n| 1 | 100 |\n| 2 | 100 |\n| 3 | 98 |\n| 4 | 98 |\n+------------+------+\n \nSELECT * FROM store;\n \n+------------+------+\n| product_id | qty |\n+------------+------+\n| 1 | 5 |\n| 2 | 5 |\n| 3 | 7 |\n| 4 | 7 |\n+------------+------+\n \nFrom MariaDB 10.3.3, LIMIT can be used with GROUP_CONCAT,\nso, for example, given the following table:\n \nCREATE TABLE d (dd DATE, cc INT);\n \nINSERT INTO d VALUES (\'2017-01-01\',1);\nINSERT INTO d VALUES (\'2017-01-02\',2);\nINSERT INTO d VALUES (\'2017-01-04\',3);\n \nthe following query:\n \nSELECT SUBSTRING_INDEX(GROUP_CONCAT(CONCAT_WS(\":\",dd,cc)\nORDER BY cc DESC),\",\",1) FROM d;\n \n+----------------------------------------------------------------------------+\n| SUBSTRING_INDEX(GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER\nBY cc DESC),\",\",1) |\n+----------------------------------------------------------------------------+\n| 2017-01-04:3 |\n+----------------------------------------------------------------------------+\n \ncan be more simply rewritten as:\n \nSELECT GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc DESC\nLIMIT 1) FROM d;\n \n+-------------------------------------------------------------+\n| GROUP_CONCAT(CONCAT_WS(\":\",dd,cc) ORDER BY cc DESC LIMIT\n1) |\n+-------------------------------------------------------------+\n| 2017-01-04:3 |\n+-------------------------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/limit/','','https://mariadb.com/kb/en/library/limit/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (426,27,'LOAD DATA INFILE','Syntax\n------ \nLOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE\n\'file_name\'\n [REPLACE | IGNORE]\n INTO TABLE tbl_name\n [CHARACTER SET charset_name]\n [{FIELDS | COLUMNS}\n [TERMINATED BY \'string\']\n [[OPTIONALLY] ENCLOSED BY \'char\']\n [ESCAPED BY \'char\']\n ]\n [LINES\n [STARTING BY \'string\']\n [TERMINATED BY \'string\']\n ]\n [IGNORE number LINES]\n [(col_name_or_user_var,...)]\n [SET col_name = expr,...]\n \nDescription\n----------- \nReads rows from a text file into the designated table on the\ndatabase at a very high speed. The file name must be given\nas a literal string. \n \nFiles are written to disk using the SELECT INTO OUTFILE\nstatement. You can then read the files back into a table\nusing the LOAD DATA INFILE statement. The FIELDS and LINES\nclauses are the same in both statements. These clauses are\noptional, but if both are specified then the FIELDS clause\nmust precede LINES.\n \nIn releases after MariaDB 5.5, LOAD DATA INFILE is unsafe\nfor statement-based replication.\n \nExecuting this statement activates INSERT triggers.\n \nREPLACE and IGNORE\n \nIn cases where you load data from a file into a table that\nalready contains data and has a Primary Key, you may\nencounter issues where the statement attempts to insert a\nrow with a Primary Key that already exists. When this\nhappens, the statement fails with Error 1064, protecting the\ndata already on the table. In cases where you want MariaDB\nto overwrite duplicates, use the REPLACE keyword.\n \nThe REPLACE keyword works like the REPLACE statement. Here,\nthe statement attempts to load the data from the file. If\nthe row does not exist, it adds it to the table. If the row\ncontains an existing Primary Key, it replaces the table\ndata. That is, in the event of a conflict, it assumes the\nfile contains the desired row. \n \nThis operation can cause a degradation in load speed by a\nfactor of 20 or more if the part that has already been\nloaded is larger than the capacity of the InnoDB Buffer\nPool. This happens because it causes a lot of turnaround in\nthe Buffer Pool.\n \nUse the IGNORE keyword when you want to skip any rows that\ncontain a conflicting Primary Key. Here, the statement\nattempts to load the data from the file. If the row does not\nexist, it adds it to the table. If the row contains an\nexisting Primary Key, it ignores the addition request and\nmoves on to the next. That is, in the event of a conflict,\nit assumes the table contains the desired row.\n \nLOCAL\n \nWhen you issue this statement, the Server attempts to read\nfiles from the host file system. Using the LOCAL keyword,\nthe statement instead attempts to read files from the\nclient. This allows you to insert files from the client\'s\nlocal file system into the database.\n \nIn the event that you don\'t want the server to permit this\noperation, (such as for security reasons), you can disable\nsupport using local_infile. When this system variable is set\nto 0, MariaDB rejects LOAD DATA LOCAL INFILE statements,\nfailing with an error message.\n \nCharacter-sets\n \nWhen the statement opens the file, it attempts to read the\ncontents using the default character-set, as defined by the\ncharacter_set_database system variable. \n \nIn the cases where the file was written using a\ncharacter-set other than the default, you can specify the\ncharacter-set to use with the CHARACTER SET clause in the\nstatement. It ignores character-sets specified by the SET\nNAMES statement and by the character_set_client system\nvariable. Setting the CHARACTER SET clause to a value of\nbinary indicates \"no conversion.\"\n \nThe statement interprets all fields in the file as having\nthe same character-set, regardless of the column data type.\nTo properly interpret file contents, you must ensure that it\nwas written with the correct character-set. If you write a\ndata file with mysqldump -T or with the SELECT INTO OUTFILE\nstatement with the mysql client, be sure to use the\n--default-character-set option, so that the output is\nwritten with the desired character-set.\n \nWhen using mixed character sets, use the CHARACTER SET\nclause in both SELECT INTO OUTFILE and LOAD DATA INFILE to\nensure that MariaDB correctly interprets the escape\nsequences.\n \nThe character_set_filesystem system variable controls the\ninterpretation of the filename.\n \nIt is currently not possible to load data files that use the\nucs2 character set.\n \nPriority and Concurrency\n \nIn loading data from a file, there\'s a risk that the\nstatement will attempt insertions concurrent with reads from\nanother client, which can result in the read serving a\nresult-set that contains only part of the update from the\nLOAD DATA INFILE statement.\n \nUsing the LOW_PRIORITY keyword, MariaDB delays insertions\nuntil no other clients are reading from the table.\nAlternatively, you can use the CONCURRENT keyword to perform\nconcurrent insertion.\n \nThe LOW_PRIORITY and CONCURRENT keywords are mutually\nexclusive. They cannot be used in the same statement.\n \nProgress Reporting\n \nSince MariaDB 5.3, the LOAD DATA INFILE statement supports\nprogress reporting. You may find this useful when dealing\nwith long-running operations. Using another client you can\nissue a SHOW PROCESSLIST query to check the progress of the\ndata load.\n \nUsing mysqlimport\n \nMariaDB ships with a separate utility for loading data from\nfiles: mysqlimport. It operates by sending LOAD DATA INFILE\nstatements to the server.\n \nUsing mysqlimport you can compress the file using the\n--compress option, to get better performance over slow\nnetworks, providing both the client and server support the\ncompressed protocol. Use the --local option to load from the\nlocal file system.\n \nIndexing\n \nIn cases where the storage engine supports ALTER TABLE...\nDISABLE KEYS statements, the LOAD DATA INFILE statement\nautomatically disables indexes during the execution.\n \n\n\nURL: https://mariadb.com/kb/en/library/load-data-infile/','','https://mariadb.com/kb/en/library/load-data-infile/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (427,27,'LOAD XML','Syntax\n------ \nLOAD XML [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE\n\'file_name\'\n [REPLACE | IGNORE]\n INTO TABLE [db_name.]tbl_name\n [CHARACTER SET charset_name]\n [ROWS IDENTIFIED BY \'\']\n [IGNORE number {LINES | ROWS}]\n [(column_or_user_var,...)]\n [SET col_name = expr,...]\n \nDescription\n----------- \nThe LOAD XML statement reads data from an XML file into a\ntable. The\nfile_name must be given as a literal string. The tagname in\nthe\noptional ROWS IDENTIFIED BY clause must also be given as a\nliteral\nstring, and must be surrounded by angle brackets (< and >).\n \nLOAD XML acts as the complement of running the mysql client\nin XML\noutput mode (that is, starting the client with the --xml\noption). To\nwrite data from a table to an XML file, use a command such\nas the\nfollowing one from the system shell:\n \nshell> mysql --xml -e \'SELECT * FROM mytable\' > file.xml\n \nTo read the file back into a table, use LOAD XML INFILE. By\ndefault,\nthe element is considered to be the equivalent of a\ndatabase\ntable row; this can be changed using the ROWS IDENTIFIED BY\nclause.\n \nThis statement supports three different XML formats:\nColumn names as attributes and column values as attribute\nvalues:\n \nColumn names as tags and column values as the content of\nthese tags:\n \n value1\n value2\n \nColumn names are the name attributes of tags, and values\nare\n the contents of these tags:\n \n value1\n value2\n \n This is the format used by other tools, such as mysqldump.\n \nAll 3 formats can be used in the same XML file; the import\nroutine\nautomatically detects the format for each row and interprets\nit\ncorrectly. Tags are matched based on the tag or attribute\nname and the\ncolumn name.\n \nThe following clauses work essentially the same way for LOAD\nXML as\nthey do for LOAD DATA:\nLOW_PRIORITY or CONCURRENT\nLOCAL\nREPLACE or IGNORE\nCHARACTER SET\n(column_or_user_var,...)\nSET\n \nSee LOAD DATA for more information about these clauses.\n \nThe IGNORE number LINES or IGNORE number ROWS clause causes\nthe first\nnumber rows in the XML file to be skipped. It is analogous\nto the LOAD\nDATA statement\'s IGNORE ... LINES clause.\n \nIf the LOW_PRIORITY keyword is used, insertions are delayed\nuntil no other clients are reading from the table. The\nCONCURRENT keyword allowes the use of concurrent inserts.\nThese clauses cannot be specified together.\n \nThis statement activates INSERT triggers.\n \n\n\nURL: https://mariadb.com/kb/en/library/load-xml/','','https://mariadb.com/kb/en/library/load-xml/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (428,27,'LOCK IN SHARE MODE','When LOCK IN SHARE MODE is specified in a SELECT statement,\nMariaDB will wait until all transactions that have modified\nthe rows are committed. Then, a write lock is acquired. All\ntransactions can read the rows, but if they want to modify\nthem, they have to wait until your transaction is committed.\n \nInnoDB/XtraDB supports row-level locking. selected rows can\nbe locked using LOCK IN SHARE MODE or FOR UPDATE. In both\ncases, a lock is acquired on the rows read by the query, and\nit will be released when the current transaction is\ncommitted.\n \nIf autocommit is set to 1, the LOCK IN SHARE MODE and FOR\nUPDATE clauses have no effect.\n \n\n\nURL: https://mariadb.com/kb/en/library/lock-in-share-mode/','','https://mariadb.com/kb/en/library/lock-in-share-mode/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (429,27,'Non-Recursive Common Table Expressions Overview','Common Table Expressions (CTEs) are a standard SQL feature,\nand are essentially temporary named result sets. There are\ntwo kinds of CTEs: Non-Recursive, which this article covers;\nand Recursive.\n \nCommon table expressions were introduced in MariaDB 10.2.1.\n \nNon-Recursive CTEs\n \nThe WITH keyword signifies a CTE. It is given a name,\nfollowed by a body (the main query) as follows:\n \nCTEs are similar to derived tables. For example\n \nWITH engineers AS \n ( SELECT * FROM employees\n WHERE dept = \'Engineering\' )\n \nSELECT * FROM engineers\nWHERE ...\n \nSELECT * FROM\n ( SELECT * FROM employees\n WHERE dept = \'Engineering\' ) AS engineers\nWHERE\n...\n \nA non-recursive CTE is basically a query-local VIEW. There\nare several advantages and caveats to them. The syntax is\nmore readable than nested FROM (SELECT ...).\nA CTE can refer to another and it can be referenced from\nmultiple places.\n \nA CTE referencing Another CTE\n \nUsing this format makes for a more readable SQL than a\nnested FROM(SELECT ...) clause. Below is an example of this:\n \nWITH engineers AS (\nSELECT * FROM employees\nWHERE dept IN(\'Development\',\'Support\') ),\neu_engineers AS ( SELECT * FROM engineers WHERE country\nIN(\'NL\',...) )\nSELECT\n...\nFROM eu_engineers;\n \nMultiple Uses of a CTE\n \nThis can be an \'anti-self join\', for example:\n \nWITH engineers AS (\nSELECT * FROM employees\nWHERE dept IN(\'Development\',\'Support\') )\n \nSELECT * FROM engineers E1\nWHERE NOT EXISTS\n (SELECT 1 FROM engineers E2\n WHERE E2.country=E1.country\n AND E2.name E1.name );\n \nOr, for year-over-year comparisons, for example:\n \nWITH sales_product_year AS (\nSELECT product, YEAR(ship_date) AS year,\nSUM(price) AS total_amt\nFROM item_sales\nGROUP BY product, year )\n \nSELECT *\nFROM sales_product_year CUR,\nsales_product_year PREV,\nWHERE CUR.product=PREV.product \nAND CUR.year=PREV.year + 1 \nAND CUR.total_amt > PREV.total_amt\n \nAnother use is to compare individuals against their group.\nBelow is an example of how this might be executed:\n \nWITH sales_product_year AS (\nSELECT product,\nYEAR(ship_date) AS year,\nSUM(price) AS total_amt\nFROM item_sales\nGROUP BY product, year\n)\n \nSELECT * \nFROM sales_product_year S1\nWHERE\ntotal_amt > \n (SELECT 0.1 * SUM(total_amt)\n FROM sales_product_year S2\n WHERE S2.year = S1.year)\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/non-recursive-common-table-expressions-overview/','','https://mariadb.com/kb/en/library/non-recursive-common-table-expressions-overview/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (430,27,'ORDER BY','Description\n----------- \nUse the ORDER BY clause to order a resultset, such as that\nare returned from a SELECT\nstatement. You can specify just a column or use any\nexpression with functions. If you are\nusing the GROUP BY clause, you can use grouping functions in\nORDER BY.\nOrdering is done after grouping.\n \nYou can use multiple ordering expressions, separated by\ncommas. Rows will be sorted by\nthe first expression, then by the second expression if they\nhave the same value for the\nfirst, and so on.\n \nYou can use the keywords ASC and DESC after each ordering\nexpression to\nforce that ordering to be ascending or descending,\nrespectively. Ordering is ascending\nby default.\n \nYou can also use a single integer as the ordering\nexpression. If you use an integer n,\nthe results will be ordered by the nth column in the select\nexpression.\n \nWhen string values are compared, they are compared as if by\nthe STRCMP\nfunction. STRCMP ignores trailing whitespace and may\nnormalize\ncharacters and ignore case, depending on the collation in\nuse.\n \nStarting from MariaDB 5.5.35 duplicated entries in the ORDER\nBY clause are removed. MySQL 5.6 also removes duplicated\nfields.\n \nORDER BY can also be used to order the activities of a\nDELETE or UPDATE statement (usually with the LIMIT clause). \n \nUntil MariaDB 10.3.1, it was not possible to use ORDER BY\n(or LIMIT) in a multi-table UPDATE statement. This\nrestriction was lifted in MariaDB 10.3.2.\n \nExamples\n-------- \nCREATE TABLE seq (i INT, x VARCHAR(1));\nINSERT INTO seq VALUES (1,\'a\'), (2,\'b\'), (3,\'b\'),\n(4,\'f\'), (5,\'e\');\n \nSELECT * FROM seq ORDER BY i;\n \n+------+------+\n| i | x |\n+------+------+\n| 1 | a |\n| 2 | b |\n| 3 | b |\n| 4 | f |\n| 5 | e |\n+------+------+\n \nSELECT * FROM seq ORDER BY i DESC;\n \n+------+------+\n| i | x |\n+------+------+\n| 5 | e |\n| 4 | f |\n| 3 | b |\n| 2 | b |\n| 1 | a |\n+------+------+\n \nSELECT * FROM seq ORDER BY x,i;\n \n+------+------+\n| i | x |\n+------+------+\n| 1 | a |\n| 2 | b |\n| 3 | b |\n| 5 | e |\n| 4 | f |\n+------+------+\n \nORDER BY in an UPDATE statement, in conjunction with LIMIT:\n \nUPDATE seq SET x=\'z\' WHERE x=\'b\' ORDER BY i DESC LIMIT\n1;\n \nSELECT * FROM seq;\n \n+------+------+\n| i | x |\n+------+------+\n| 1 | a |\n| 2 | b |\n| 3 | z |\n| 4 | f |\n| 5 | e |\n+------+------+\n \nFrom MariaDB 10.3.2, ORDER BY can be used in a multi-table\nupdate:\n \nCREATE TABLE warehouse (product_id INT, qty INT);\nINSERT INTO warehouse VALUES\n(1,100),(2,100),(3,100),(4,100);\n \nCREATE TABLE store (product_id INT, qty INT);\nINSERT INTO store VALUES (1,5),(2,5),(3,5),(4,5);\n \nUPDATE warehouse,store SET warehouse.qty = warehouse.qty-2,\nstore.qty = store.qty+2 \n WHERE (warehouse.product_id = store.product_id AND\nstore.product_id >= 1) \n ORDER BY store.product_id DESC LIMIT 2;\n \nSELECT * FROM warehouse;\n \n+------------+------+\n| product_id | qty |\n+------------+------+\n| 1 | 100 |\n| 2 | 100 |\n| 3 | 98 |\n| 4 | 98 |\n+------------+------+\n \nSELECT * FROM store;\n \n+------------+------+\n| product_id | qty |\n+------------+------+\n| 1 | 5 |\n| 2 | 5 |\n| 3 | 7 |\n| 4 | 7 |\n+------------+------+\n \n\n\nURL: https://mariadb.com/kb/en/library/order-by/','','https://mariadb.com/kb/en/library/order-by/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (431,27,'PROCEDURE','The PROCEDURE clause of SELECT passes the whole result set\nto a Procedure which will process it. These Procedures are\nnot Stored Procedures, and can only be written in the C\nlanguage, so it is necessary to recompile the server.\n \nCurrently, the only available procedure is ANALYSE, which\nexamines the resultset and suggests the optimal datatypes\nfor each column. It is defined in the sql/sql_analyse.cc\nfile, and can be used as an example to create more\nProcedures.\n \nThis clause cannot be used in a view\'s definition.\n \n\n\nURL: https://mariadb.com/kb/en/library/procedure/','','https://mariadb.com/kb/en/library/procedure/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (432,27,'Recursive Common Table Expressions Overview','Recursive Common Table Expressions have been supported since\nMariaDB 10.2.2.\n \nCommon Table Expressions (CTEs) are a standard SQL feature,\nand are essentially temporary named result sets. CTEs first\nappeared in the SQL standard in 1999, and the first\nimplementations began appearing in 2007.\n \nThere are two kinds of CTEs:\nNon-recursive\nRecursive, which this article covers.\n \nSQL is generally poor at recursive structures.\n \nCTEs permit a query to reference itself. A recursive CTE\nwill repeatedly execute subsets of the data until it obtains\nthe complete result set. This makes it particularly useful\nfor handing hierarchical or tree-structured data.\n \nSyntax example\n \nWITH RECURSIVE signifies a recursive CTE. It is given a\nname, followed by a body (the main query) as follows:\n \n\nComputation\n \nGiven the following structure:\n \nFirst execute the anchor part of the query:\n \nNext, execute the recursive part of the query:\n \n\n \n\nSummary so far\n \nwith recursive R as (\n select anchor_data\n union [all]\n select recursive_part\n from R, ...\n)\nselect ...\nCompute anchor_data\nCompute recursive_part to get the new data\nif (new data is non-empty) goto 2;\n \nCAST to avoid truncating data\n \nAs currently implemented by MariaDB and by the SQL Standard,\ndata may be truncated if not correctly cast. It is necessary\nto CAST the column to the correct width if the CTE\'s\nrecursive part produces wider values for a column than the\nCTE\'s nonrecursive part. Some other DBMS give an error in\nthis situation, and MariaDB\'s behavior may change in future\n- see MDEV-12325. See the examples below.\n \nExamples\n-------- \nTransitive closure - determining bus destinations\n \nSample data:\n \nCREATE TABLE bus_routes (origin varchar(50), dst\nvarchar(50));\nINSERT INTO bus_routes VALUES \n (\'New York\', \'Boston\'), \n (\'Boston\', \'New York\'), \n (\'New York\', \'Washington\'), \n (\'Washington\', \'Boston\'), \n (\'Washington\', \'Raleigh\');\n \nNow, we want to return the bus destinations with New York as\nthe origin:\n \nWITH RECURSIVE bus_dst as ( \n SELECT origin as dst FROM bus_routes WHERE origin=\'New\nYork\' \n UNION\n SELECT bus_routes.dst FROM bus_routes, bus_dst WHERE\nbus_dst.dst= bus_routes.origin \n) \nSELECT * FROM bus_dst;\n \n+------------+\n| dst |\n+------------+\n| New York |\n| Boston |\n| Washington |\n| Raleigh |\n+------------+\n \nThe above example is computed as follows:\n \nFirst, the anchor data is calculated:\nStarting from New York\nBoston and Washington are added\n \nNext, the recursive part:\nStarting from Boston and then Washington\nRaleigh is added\nUNION excludes nodes that are already present.\n \nComputing paths - determining bus routes\n \nThis time, we are trying to get bus routes such as “New\nYork -> Washington -> Raleigh”.\n \nUsing the same sample data as the previous example:\n \nWITH RECURSIVE paths (cur_path, cur_dest) AS (\n SELECT origin, origin FROM bus_routes WHERE origin=\'New\nYork\' \n UNION\n SELECT CONCAT(paths.cur_path, \',\', bus_routes.dst),\nbus_routes.dst \n FROM paths, bus_routes \n WHERE paths.cur_dest = bus_routes.origin AND \n LOCATE(bus_routes.dst, paths.cur_path)=0 \n) \nSELECT * FROM paths;\n \n+-----------------------------+------------+\n| cur_path | cur_dest |\n+-----------------------------+------------+\n| New York | New York |\n| New York,Boston | Boston |\n| New York,Washington | Washington |\n| New York,Washington,Boston | Boston |\n| New York,Washington,Raleigh | Raleigh |\n+-----------------------------+------------+\n \nCAST to avoid data truncation\n \nIn the following example, data is truncated because the\nresults are not specifically cast to a wide enough type:\n \nWITH RECURSIVE tbl AS (\n SELECT NULL AS col\n UNION\n SELECT \"THIS NEVER SHOWS UP\" AS col FROM tbl\n)\n+------+\n| col |\n+------+\n| NULL |\n| |\n+------+\n \nExplicitly use CAST to overcome this:\n \nWITH RECURSIVE tbl AS (\n SELECT CAST(NULL AS CHAR(50)) AS col\n UNION SELECT \"THIS NEVER SHOWS UP\" AS col FROM tbl\n) \nSELECT * FROM tbl;\n \n+---------------------+\n| col |\n+---------------------+\n| NULL |\n| THIS NEVER SHOWS UP |\n+---------------------+\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/recursive-common-table-expressions-overview/','','https://mariadb.com/kb/en/library/recursive-common-table-expressions-overview/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (433,27,'REPLACE','Syntax\n------ \nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n \nOr:\n \nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name [PARTITION (partition_list)]\n SET col={expr | DEFAULT}, ...\n \nOr:\n \nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n SELECT ...\n \nDescription\n----------- \n REPLACE works exactly like\n INSERT, except that if an old row in the table\n has the same value as a new row for a PRIMARY KEY or a\n UNIQUE index, the old row is deleted before the new row is\n inserted. If the table has more than one UNIQUE keys, it is\npossible that the new row conflicts with more than one row.\nIn this case, all conflicting rows will be deleted.\n \nThe table name can be specified in the form db_name.tbl_name\nor, if a default database is selected, in the form tbl_name\n(see Identifier Qualifiers). This allows to use REPLACE ...\nSELECT to copy rows between different databases.\n \nBasically it works like this:\n \nBEGIN;\nSELECT 1 FROM t1 WHERE key=# FOR UPDATE;\nIF found-row\n DELETE FROM t1 WHERE key=# ;\n INSERT INTO t1 VALUES (...);\nENDIF\nEND;\n \nThe above can be replaced with:\n \nREPLACE INTO t1 VALUES (...)\n \n REPLACE is a MariaDB/MySQL extension to the SQL standard.\nIt\n either inserts, or deletes and inserts. For other\nMariaDB/MySQL extensions to\n standard SQL --- that also handle duplicate values --- see\nIGNORE and INSERT ON DUPLICATE KEY UPDATE.\n \nNote that unless the table has a PRIMARY KEY or\n UNIQUE index, using a REPLACE statement\nmakes no sense. It becomes equivalent to INSERT, because\nthere is no index to be used to determine whether a new row\nduplicates another.\n \nValues for all columns are taken from the values specified\nin the\n REPLACE statement. Any missing columns are set to their\ndefault values, just as happens for INSERT. You cannot refer\nto values from the current row and use them in the new row.\nIf you use an\nassignment such as \'SET col = col + 1\', the\nreference to the column name on the right hand side is\ntreated as\n DEFAULT(col), so the assignment is equivalent to\n \'SET col = DEFAULT(col) + 1\'.\n \nTo use REPLACE, you must have both the\n INSERT and DELETE privileges\nfor the table.\n \nThere are some gotchas you should be aware of, before using\nREPLACE:\nIf there is an AUTO_INCREMENT field, a new value will be\ngenerated.\nIf there are foreign keys, ON DELETE action will be\nactivated by REPLACE.\nTriggers on DELETE and INSERT will be activated by REPLACE.\n \nTo avoid some of these behaviors, you can use INSERT ... ON\nDUPLICATE KEY UPDATE.\n \nThe PARTITION clause was introduced in MariaDB 10.0. See\nPartition Pruning and Selection for details.\n \nThis statement activates INSERT and DELETE triggers. See\nTrigger Overview for details.\n \n\n\nURL: https://mariadb.com/kb/en/library/replace/','','https://mariadb.com/kb/en/library/replace/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (434,27,'SELECT','Syntax\n------ \nSELECT\n [ALL | DISTINCT | DISTINCTROW]\n [HIGH_PRIORITY]\n [STRAIGHT_JOIN]\n [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]\n [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]\n select_expr [, select_expr ...]\n [ FROM table_references\n [WHERE where_condition]\n [GROUP BY {col_name | expr | position} [ASC | DESC], ...\n[WITH ROLLUP]]\n [HAVING where_condition]\n [ORDER BY {col_name | expr | position} [ASC | DESC], ...]\n [LIMIT {[offset,] row_count | row_count OFFSET offset}]\n [PROCEDURE procedure_name(argument_list)]\n [INTO OUTFILE \'file_name\' [CHARACTER SET charset_name]\n[export_options]\n \nINTO DUMPFILE \'file_name\' | INTO var_name [, var_name] ] |\n\n \n [[FOR UPDATE | LOCK IN SHARE MODE] [WAIT n | NOWAIT] ] ]\n \nexport_options:\n [{FIELDS | COLUMNS}\n [TERMINATED BY \'string\']\n [[OPTIONALLY] ENCLOSED BY \'char\']\n [ESCAPED BY \'char\']\n ]\n [LINES\n [STARTING BY \'string\']\n [TERMINATED BY \'string\']\n ]\n \nDescription\n----------- \nSELECT is used to retrieve rows selected from one or more\ntables, and can include UNION statements and subqueries.\nEach select_expr expression indicates a column or data that\nyou want to retrieve. You\nmust have at least one select expression. See Select\nExpressions below.\n \nThe FROM clause indicates the table or tables from which to\nretrieve rows.\nUse either a single table name or a JOIN expression. See\nJOIN\nfor details. If no table is involved, FROM DUAL can be\nspecified.\n \nThe PARTITION clause was introduced in MariaDB 10.0. See\nPartition Pruning and Selection for details.\nEach table can also be specified as db_name.tabl_name. Each\ncolumn can also be specified as tbl_name.col_name or even\ndb_name.tbl_name.col_name. This allows to write queries\nwhich involve multiple databases. See Identifier Qualifiers\nfor syntax details.\n \nThe WHERE clause, if given, indicates the condition or\n conditions that rows must satisfy to be selected.\n where_condition is an expression that evaluates to true for\n each row to be selected. The statement selects all rows if\nthere is no WHERE\n clause.\nIn the WHERE clause, you can use any of the functions and\n operators that MariaDB supports, except for aggregate\n(summary) functions. See Functions and Operators and\nFunctions and Modifiers for use with GROUP BY (aggregate).\n \nUse the ORDER BY clause to order the results.\n \nUse the LIMIT clause allows you to restrict the results to\nonly\na certain number of rows, optionally with an offset.\n \nUse the GROUP BY and HAVING clauses to group\nrows together when they have columns or computed values in\ncommon.\n \nSELECT can also be used to retrieve rows computed without\nreference to\nany table.\n \nSelect Expressions\n \nA SELECT statement must contain one or more select\nexpressions, separated\nby commas. Each select expression can be one of the\nfollowing:\nThe name of a column.\nAny expression using functions and operators.\n* to select all columns from all tables in the FROM clause.\ntbl_name.* to select all columns from just the table\ntbl_name.\n \nWhen specifying a column, you can either use just the column\nname or qualify the column\nname with the name of the table using tbl_name.col_name. The\nqualified form is\nuseful if you are joining multiple tables in the FROM\nclause. If you do not qualify the\ncolumn names when selecting from multiple tables, MariaDB\nwill try to find the column in\neach table. It is an error if that column name exists in\nmultiple tables.\n \nYou can quote column names using backticks. If you are\nqualifying column names\nwith table names, quote each part separately as\n`tbl_name`.`col_name`.\n \nIf you use any grouping functions\nin any of the select expressions, all rows in your results\nwill be implicitly grouped, as if\nyou had used GROUP BY NULL.\n \nDISTINCT\n \nA query may produce some identical rows. By default, all\nrows are retrieved, even when their values are the same. To\nexplicitly specify that you want to retrieve identical rows,\nuse the ALL option. If you want duplicates to be removed\nfrom the resultset, use the DISTINCT option. DISTINCTROW is\na synonym for DISTINCT. See also COUNT DISTINCT and SELECT\nUNIQUE in Oracle mode.\n \nINTO\n \nThe INTO clause is used to specify that the query results\nshould be written to a file or variable.\nSELECT INTO OUTFILE - formatting and writing the result to\nan external file.\nSELECT INTO DUMPFILE - binary-safe writing of the\nunformatted results to an external file.\nSELECT INTO Variable - selecting and setting variables.\n \nThe reverse of SELECT INTO OUTFILE is LOAD DATA.\n \nWAIT/NOWAIT\n \nSet the lock wait timeout. See WAIT and NOWAIT.\n \n\nmax_statement_time clause\n \nBy using max_statement_time in conjunction with SET\nSTATEMENT, it is possible to limit the execution time of\nindividual queries. For example:\n \nSET STATEMENT max_statement_time=100 FOR \n SELECT field1 FROM table_name ORDER BY field1;\n \n\n\nURL: https://mariadb.com/kb/en/library/select/','','https://mariadb.com/kb/en/library/select/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (435,27,'SELECT INTO DUMPFILE','Syntax\n------ \nSELECT ... INTO DUMPFILE \'file_path\'\n \nDescription\n----------- \nSELECT ... INTO DUMPFILE is a SELECT clause which writes the\nresultset into a single unformatted row, without any\nseparators, in a file. The results will not be returned to\nthe client.\n \nfile_path can be an absolute path, or a relative path\nstarting from the data directory. It can only be specified\nas a string literal, not as a variable. However, the\nstatement can be dynamically composed and executed as a\nprepared statement to work around this limitation.\n \nThis statement is binary-safe and so is particularly useful\nfor writing BLOB values to file. It can be used, for\nexample, to copy an image or an audio document from the\ndatabase to a file. SELECT ... INTO FILE can be used to save\na text file.\n \nThe file must not exist. It cannot be overwritten. A user\nneeds the FILE privilege to run this statement. Also,\nMariaDB needs permission to write files in the specified\nlocation. If the secure_file_priv system variable is set to\na non-empty directory name, the file can only be written to\nthat directory.\n \nSince MariaDB 5.1, the character_set_filesystem system\nvariable has controlled interpretation of file names that\nare given as literal strings.\n \nExample\n \nSELECT _utf8\'Hello world!\' INTO DUMPFILE \'/tmp/world\';\n \nSELECT LOAD_FILE(\'/tmp/world\') AS world;\n \n+--------------+\n| world |\n+--------------+\n| Hello world! |\n+--------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/select-into-dumpfile/','','https://mariadb.com/kb/en/library/select-into-dumpfile/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (436,27,'SELECT INTO OUTFILE','Syntax\n------ \nSELECT ... INTO OUTFILE \'file_name\'\n [CHARACTER SET charset_name]\n [export_options]\n \nexport_options:\n [{FIELDS | COLUMNS}\n [TERMINATED BY \'string\']\n [[OPTIONALLY] ENCLOSED BY \'char\']\n [ESCAPED BY \'char\']\n ]\n [LINES\n [STARTING BY \'string\']\n [TERMINATED BY \'string\']\n ]\n \nDescription\n----------- \nSELECT INTO OUTFILE writes the resulting rows to a file, and\nallows the use of column and row terminators to specify a\nparticular output format. The default is to terminate fields\nwith tabs (\\t) and lines with newlines (\\n).\n \nThe file must not exist. It cannot be overwritten. A user\nneeds the FILE privilege to run this statement. Also,\nMariaDB needs permission to write files in the specified\nlocation. If the secure_file_priv system variable is set to\na non-empty directory name, the file can only be written to\nthat directory.\n \nThe LOAD DATA INFILE statement complements SELECT INTO\nOUTFILE.\n \nCharacter-sets\n \nThe CHARACTER SET clause specifies the character set in\nwhich the results are to be written. Without the clause, no\nconversion takes place (the binary character set). In this\ncase, if there are multiple character sets, the output will\ncontain these too, and may not easily be able to be\nreloaded.\n \nIn cases where you have two servers using different\ncharacter-sets, using SELECT INTO OUTFILE to transfer data\nfrom one to the other can have unexpected results. To ensure\nthat MariaDB correctly interprets the escape sequences, use\nthe CHARACTER SET clause on both the SELECT INTO OUTFILE\nstatement and the subsequent LOAD DATA INFILE statement.\n \nExample\n \nThe following example produces a file in the CSV format:\n \nSELECT customer_id, firstname, surname INTO OUTFILE\n\'/exportdata/customers.txt\'\n FIELDS TERMINATED BY \',\' OPTIONALLY ENCLOSED BY \'\"\'\n LINES TERMINATED BY \'\\n\'\n FROM customers;\n \n\n\nURL: https://mariadb.com/kb/en/library/select-into-outfile/','','https://mariadb.com/kb/en/library/select-into-outfile/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (437,27,'SELECT WITH ROLLUP','Syntax\n------ \nSee SELECT for the full syntax.\n \nDescription\n----------- \nThe WITH ROLLUP modifier adds extra rows to the resultset\nthat represent super-aggregate summaries. The\nsuper-aggregated column is represented by a NULL value.\nMultiple aggregates over different columns will be added if\nthere are multiple GROUP BY columns.\n \nThe LIMIT clause can be used at the same time, and is\napplied after the WITH ROLLUP rows have been added.\n \nWITH ROLLUP cannot be used with ORDER BY. Some sorting is\nstill possible by using ASC or DESC clauses with the GROUP\nBY column, although the super-aggregate rows will always be\nadded last.\n \nExamples\n-------- \nThese examples use the following sample table\n \nCREATE TABLE booksales ( \n country VARCHAR(35), genre\nENUM(\'fiction\',\'non-fiction\'), year YEAR, sales INT);\n \nINSERT INTO booksales VALUES\n (\'Senegal\',\'fiction\',2014,12234),\n(\'Senegal\',\'fiction\',2015,15647),\n (\'Senegal\',\'non-fiction\',2014,64980),\n(\'Senegal\',\'non-fiction\',2015,78901),\n (\'Paraguay\',\'fiction\',2014,87970),\n(\'Paraguay\',\'fiction\',2015,76940),\n (\'Paraguay\',\'non-fiction\',2014,8760),\n(\'Paraguay\',\'non-fiction\',2015,9030);\n \nThe addition of the WITH ROLLUP modifier in this example\nadds an extra row that aggregates both years:\n \nSELECT year, SUM(sales) FROM booksales GROUP BY year;\n \n+------+------------+\n| year | SUM(sales) |\n+------+------------+\n| 2014 | 173944 |\n| 2015 | 180518 |\n+------+------------+\n2 rows in set (0.08 sec)\n \nSELECT year, SUM(sales) FROM booksales GROUP BY year WITH\nROLLUP;\n \n+------+------------+\n| year | SUM(sales) |\n+------+------------+\n| 2014 | 173944 |\n| 2015 | 180518 |\n| NULL | 354462 |\n+------+------------+\n \nIn the following example, each time the genre, the year or\nthe country change, another super-aggregate row is added:\n \nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year, genre;\n \n+----------+------+-------------+------------+\n| country | year | genre | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2014 | fiction | 87970 |\n| Paraguay | 2014 | non-fiction | 8760 |\n| Paraguay | 2015 | fiction | 76940 |\n| Paraguay | 2015 | non-fiction | 9030 |\n| Senegal | 2014 | fiction | 12234 |\n| Senegal | 2014 | non-fiction | 64980 |\n| Senegal | 2015 | fiction | 15647 |\n| Senegal | 2015 | non-fiction | 78901 |\n+----------+------+-------------+------------+\n \nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year, genre WITH ROLLUP;\n \n+----------+------+-------------+------------+\n| country | year | genre | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2014 | fiction | 87970 |\n| Paraguay | 2014 | non-fiction | 8760 |\n| Paraguay | 2014 | NULL | 96730 |\n| Paraguay | 2015 | fiction | 76940 |\n| Paraguay | 2015 | non-fiction | 9030 |\n| Paraguay | 2015 | NULL | 85970 |\n| Paraguay | NULL | NULL | 182700 |\n| Senegal | 2014 | fiction | 12234 |\n| Senegal | 2014 | non-fiction | 64980 |\n| Senegal | 2014 | NULL | 77214 |\n| Senegal | 2015 | fiction | 15647 |\n| Senegal | 2015 | non-fiction | 78901 |\n| Senegal | 2015 | NULL | 94548 |\n| Senegal | NULL | NULL | 171762 |\n| NULL | NULL | NULL | 354462 |\n+----------+------+-------------+------------+\n \nThe LIMIT clause, applied after WITH ROLLUP:\n \nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year, genre WITH ROLLUP\nLIMIT 4;\n \n+----------+------+-------------+------------+\n| country | year | genre | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2014 | fiction | 87970 |\n| Paraguay | 2014 | non-fiction | 8760 |\n| Paraguay | 2014 | NULL | 96730 |\n| Paraguay | 2015 | fiction | 76940 |\n+----------+------+-------------+------------+\n \nSorting by year descending:\n \nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year DESC, genre WITH\nROLLUP;\n \n+----------+------+-------------+------------+\n| country | year | genre | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2015 | fiction | 76940 |\n| Paraguay | 2015 | non-fiction | 9030 |\n| Paraguay | 2015 | NULL | 85970 |\n| Paraguay | 2014 | fiction | 87970 |\n| Paraguay | 2014 | non-fiction | 8760 |\n| Paraguay | 2014 | NULL | 96730 |\n| Paraguay | NULL | NULL | 182700 |\n| Senegal | 2015 | fiction | 15647 |\n| Senegal | 2015 | non-fiction | 78901 |\n| Senegal | 2015 | NULL | 94548 |\n| Senegal | 2014 | fiction | 12234 |\n| Senegal | 2014 | non-fiction | 64980 |\n| Senegal | 2014 | NULL | 77214 |\n| Senegal | NULL | NULL | 171762 |\n| NULL | NULL | NULL | 354462 |\n+----------+------+-------------+------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/select-with-rollup/','','https://mariadb.com/kb/en/library/select-with-rollup/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (438,27,'UNION','UNION is used to combine the results from multiple SELECT\nstatements into a single result set.\n \nSyntax\n------ \nSELECT ...\nUNION [ALL | DISTINCT] SELECT ...\n[UNION [ALL | DISTINCT] SELECT ...]\n[ORDER BY [column [, column ...]]]\n[LIMIT {[offset,] row_count | row_count OFFSET offset}]\n \nDescription\n----------- \nUNION is used to combine the results from multiple SELECT\nstatements into a single result set.\n \nThe column names from the first SELECT statement are used as\nthe column names for the results returned. Selected columns\nlisted in corresponding positions of each SELECT statement\nshould have the same data type. (For example, the first\ncolumn selected by the first statement should have the same\ntype as the first column selected by the other statements.)\n \nIf they don\'t, the type and length of the columns in the\nresult take into account the values returned by all of the\nSELECTs, so there is no need for explicit casting. Note that\ncurrently this is not the case for recursive CTEs - see\nMDEV-12325.\n \nTable names can be specified as db_name.tbl_name. This\npermits writing UNIONs which involve multiple databases. See\nIdentifier Qualifiers for syntax details.\n \nUNION queries cannot be used with aggregate functions.\n \nALL/DISTINCT\n \nThe ALL keyword causes duplicate rows to be preserved. The\nDISTINCT keyword (the default if the keyword is omitted)\ncauses duplicate rows to be removed by the results.\n \nUNION ALL and UNION DISTINCT can both be present in a query.\nIn this case, UNION DISTINCT will override any UNION ALLs to\nits left.\n \nUntil MariaDB 10.1.1, all UNION ALL statements required the\nserver to create a temporary table. Since MariaDB 10.1.1,\nthe server can in most cases execute UNION ALL without\ncreating a temporary table, improving performance (see\nMDEV-334).\n \nORDER BY and LIMIT\n \nIndividual SELECTs can contain their own ORDER BY and LIMIT\nclauses. In this case, the individual queries need to be\nwrapped between parentheses. However, this does not affect\nthe order of the UNION, so they only are useful to limit the\nrecord read by one SELECT.\n \nThe UNION can have global ORDER BY and LIMIT clauses, which\naffect the whole resultset. If the columns retrieved by\nindividual SELECT statements have an alias (AS), the ORDER\nBY must use that alias, not the real column names.\n \nHIGH_PRIORITY\n \nSpecifying a query as HIGH_PRIORITY will not work inside a\nUNION. If applied to the first SELECT, it will be ignored.\nApplying to a later SELECT results in a syntax error:\n \nERROR 1234 (42000): Incorrect usage/placement of\n\'HIGH_PRIORITY\'\n \nSELECT ... INTO ...\n \nIndividual SELECTs cannot be written INTO DUMPFILE or INTO\nOUTFILE. If the last SELECT statement specifies INTO\nDUMPFILE or INTO OUTFILE, the entire result of the UNION\nwill be written. Placing the clause after any other SELECT\nwill result in a syntax error.\n \nIf the result is a single row, SELECT ... INTO @var_name can\nalso be used.\n \n\nParentheses\n \nFrom MariaDB 10.4.0, parentheses can be used to specify\nprecedence. Before this, a syntax error would be returned.\n \nExamples\n-------- \nUNION between tables having different column names:\n \n(SELECT e_name AS name, email FROM employees)\nUNION\n(SELECT c_name AS name, email FROM customers);\n \nSpecifying the UNION\'s global order and limiting total\nrows:\n \n(SELECT name, email FROM employees)\nUNION\n(SELECT name, email FROM customers)\nORDER BY name LIMIT 10;\n \nAdding a constant row:\n \n(SELECT \'John Doe\' AS name, \'john.doe@example.net\' AS\nemail)\nUNION\n(SELECT name, email FROM customers);\n \nDiffering types:\n \nSELECT CAST(\'x\' AS CHAR(1)) UNION SELECT REPEAT(\'y\',4);\n+----------------------+\n| CAST(\'x\' AS CHAR(1)) |\n+----------------------+\n| x |\n| yyyy |\n+----------------------+\n \nReturning the results in order of each individual SELECT by\nuse of a sort column:\n \n(SELECT 1 AS sort_column, e_name AS name, email FROM\nemployees)\nUNION\n(SELECT 2, c_name AS name, email FROM customers) ORDER BY\nsort_column;\n \nDifference between UNION, EXCEPT and INTERSECT:\n \nCREATE TABLE seqs (i INT);\nINSERT INTO seqs VALUES (1),(2),(3),(4),(5),(6);\n \nSELECT i FROM seqs WHERE i =3;\n \n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n| 3 |\n| 4 |\n| 5 |\n| 6 |\n+------+\n \nSELECT i FROM seqs WHERE i =3;\n \n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n+------+\n \nSELECT i FROM seqs WHERE i =3;\n \n+------+\n| i |\n+------+\n| 3 |\n+------+\n \nParentheses for specifying precedence, from MariaDB 10.4.0\n \nCREATE OR REPLACE TABLE t1 (a INT);\nCREATE OR REPLACE TABLE t2 (b INT);\nCREATE OR REPLACE TABLE t3 (c INT);\n \nINSERT INTO t1 VALUES (1),(2),(3),(4);\nINSERT INTO t2 VALUES (5),(6);\nINSERT INTO t3 VALUES (1),(6);\n \n((SELECT a FROM t1) UNION (SELECT b FROM t2)) INTERSECT\n(SELECT c FROM t3);\n+------+\n| a |\n+------+\n| 1 |\n| 6 |\n+------+\n \n(SELECT a FROM t1) UNION ((SELECT b FROM t2) INTERSECT\n(SELECT c FROM t3));\n+------+\n| a |\n+------+\n| 1 |\n| 2 |\n| 3 |\n| 4 |\n| 6 |\n+------+\n \n\n\nURL: https://mariadb.com/kb/en/library/union/','','https://mariadb.com/kb/en/library/union/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (439,27,'UPDATE','Syntax\n------ \nSingle-table syntax:\n \nUPDATE [LOW_PRIORITY] [IGNORE] table_reference \n [PARTITION (partition_list)]\n SET col1={expr1|DEFAULT} [,col2={expr2|DEFAULT}] ...\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n \nMultiple-table syntax:\n \nUPDATE [LOW_PRIORITY] [IGNORE] table_references\n SET col1={expr1|DEFAULT} [, col2={expr2|DEFAULT}] ...\n [WHERE where_condition]\n \nDescription\n----------- \nFor the single-table syntax, the UPDATE statement updates\ncolumns of existing rows in the named table with new values.\nThe\nSET clause indicates which columns to modify and the values\nthey should be given. Each value can be given as an\nexpression, or the keyword\nDEFAULT to set a column explicitly to its default value. The\nWHERE clause, if given, specifies the conditions that\nidentify\nwhich rows to update. With no WHERE clause, all rows are\nupdated. If the ORDER BY clause is specified, the rows are\nupdated in the order that is specified. The LIMIT clause\nplaces a limit on the number of rows that can be updated.\n \nThe PARTITION clause was introduced in MariaDB 10.0. See\nPartition Pruning and Selection for details.\n \nUntil MariaDB 10.3.2, for the multiple-table syntax, UPDATE\nupdates rows in each\ntable named in table_references that satisfy the conditions.\nIn this case,\nORDER BY and LIMIT cannot be used. This restriction was\nlifted in MariaDB 10.3.2 and both clauses can be used with\nmultiple-table updates. An UPDATE can also reference tables\nwhich are located in different databases; see Identifier\nQualifiers for the syntax.\n \nwhere_condition is an expression that evaluates to true for\neach row to be updated.\n \ntable_references and where_condition are as\nspecified as described in SELECT.\n \nAssignments are evaluated in left-to-right order, unless the\nSIMULTANEOUS_ASSIGNMENT sql_mode (available from MariaDB\n10.3.5) is set, in which case the UPDATE statement evaluates\nall assignments simultaneously. \n \nYou need the UPDATE privilege only for columns referenced in\nan UPDATE that are actually updated. You need only the\nSELECT privilege for any columns that are read but\nnot modified. See GRANT.\n \nThe UPDATE statement supports the following modifiers:\nIf you use the LOW_PRIORITY keyword, execution of\n the UPDATE is delayed until no other clients are reading\nfrom\n the table. This affects only storage engines that use only\ntable-level\n locking (MyISAM, MEMORY, MERGE). See HIGH_PRIORITY and\nLOW_PRIORITY clauses for details.\nIf you use the IGNORE keyword, the update statement does \n not abort even if errors occur during the update. Rows for\nwhich\n duplicate-key conflicts occur are not updated. Rows for\nwhich columns are\n updated to values that would cause data conversion errors\nare updated to the\n closest valid values instead.\n \nUPDATE Statements With the Same Source and Target\n \nFrom MariaDB 10.3.2, UPDATE statements may have the same\nsource and target.\n \nFor example, given the following table:\n \nDROP TABLE t1;\n \nCREATE TABLE t1 (c1 INT, c2 INT);\nINSERT INTO t1 VALUES (10,10), (20,20);\n \nUntil MariaDB 10.3.1, the following UPDATE statement would\nnot work:\n \nUPDATE t1 SET c1=c1+1 WHERE c2=(SELECT MAX(c2) FROM t1);\nERROR 1093 (HY000): Table \'t1\' is specified twice, \n both as a target for \'UPDATE\' and as a separate source\nfor data\n \nFrom MariaDB 10.3.2, the statement executes successfully:\n \nUPDATE t1 SET c1=c1+1 WHERE c2=(SELECT MAX(c2) FROM t1);\n \nSELECT * FROM t1;\n \n+------+------+\n| c1 | c2 |\n+------+------+\n| 10 | 10 |\n| 21 | 20 |\n+------+------+\n \nExample\n \nSingle-table syntax:\n \nUPDATE table_name SET column1 = value1, column2 = value2\nWHERE id=100;\n \nMultiple-table syntax:\n \nUPDATE tab1, tab2 SET tab1.column1 = value1, tab1.column2 =\nvalue2 WHERE tab1.id = tab2.id;\n \n\n\nURL: https://mariadb.com/kb/en/library/update/','','https://mariadb.com/kb/en/library/update/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (440,27,'WITH','The WITH keyword signifies a Common Table Expression (CTE).\nIt allows you to refer to a subquery expression many times\nin a query, as if having a temporary table that only exists\nfor the duration of a query.\n \nThere are two kinds of CTEs:\nNon-Recursive\nRecursive\n \nCommon Table Expression WITH was introduced in MariaDB\n10.2.1.\n \nRecursive WITH has been supported since MariaDB 10.2.2.\n \nSyntax\n------ \nWITH [RECURSIVE] table_reference as (SELECT ...)\n SELECT ...\n \nYou can use table_reference as any normal table in the\nexternal SELECT part. You can also use WITH in sub queries.\nWITH can also be used with EXPLAIN and SELECT.\n \nBelow is an example with the WITH at the top level:\n \nWITH t AS (SELECT a FROM t1 WHERE b >= \'c\') \n SELECT * FROM t2, t WHERE t2.c = t.a;\n \nThe example below uses WITH in a subquery:\n \nSELECT t1.a, t1.b FROM t1, t2\n WHERE t1.a > t2.c \n AND t2.c IN(WITH t AS (SELECT * FROM t1 WHERE t1.a \n\nURL: https://mariadb.com/kb/en/library/with/','','https://mariadb.com/kb/en/library/with/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (441,28,'DESCRIBE','Syntax\n------ \n{DESCRIBE | DESC} tbl_name [col_name | wild]\n \nDescription\n----------- \nDESCRIBE provides information about the columns in a table.\nIt is a shortcut for SHOW COLUMNS FROM.\nThese statements also display information for views.\n \ncol_name can be a column name, or a string containing the\nSQL \"%\" and \"_\" wildcard characters to\nobtain output only for the columns with names matching the\nstring. There is no\nneed to enclose the string within quotes unless it contains\nspaces or other\nspecial characters.\n \nDESCRIBE city;\n \n+------------+----------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+------------+----------+------+-----+---------+----------------+\n| Id | int(11) | NO | PRI | NULL | auto_increment |\n| Name | char(35) | YES | | NULL | |\n| Country | char(3) | NO | UNI | | |\n| District | char(20) | YES | MUL | | |\n| Population | int(11) | YES | | NULL | |\n+------------+----------+------+-----+---------+----------------+\n \nThe description for SHOW COLUMNS provides\nmore information about the output columns.\n \n\n\nURL: https://mariadb.com/kb/en/library/describe/','','https://mariadb.com/kb/en/library/describe/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (442,28,'EXPLAIN','Syntax\n------ \nEXPLAIN tbl_name\n \nOr\n \nEXPLAIN [EXTENDED | PARTITIONS] \n {SELECT select_options | UPDATE update_options | DELETE\ndelete_options}\n \nDescription\n----------- \nThe EXPLAIN statement can be used either as a synonym for\nDESCRIBE or as a way to obtain information about how MariaDB\nexecutes a SELECT (as well as UPDATE and DELETE since\nMariaDB 10.0.5) statement:\n\'EXPLAIN tbl_name\' is synonymous with \n \'DESCRIBE tbl_name\' or \n \'SHOW COLUMNS FROM tbl_name\'.\nWhen you precede a SELECT statement (or, since MariaDB\n10.0.5, an UPDATE or a DELETE as well) with the keyword \n EXPLAIN, MariaDB displays information from the optimizer\n about the query execution plan. That is, MariaDB explains\nhow it would\n process the SELECT, UPDATE or DELETE, including information\nabout how tables\n are joined and in which order. EXPLAIN EXTENDED can be\n used to provide additional information.\nEXPLAIN PARTITIONS has been available since MySQL 5.1.5. It\nis useful only when examining queries involving partitioned\ntables. For details, see Partition pruning and selection.\nANALYZE statement, which performs the query as well as\nproducing EXPLAIN output, and provides actual as well as\nestimated statistics, has been available from MariaDB\n10.1.0.\nSince MariaDB 10.0.5, it has been possible to have EXPLAIN\noutput printed in the slow query log. See EXPLAIN in the\nSlow Query Log for details.\n \nSince MariaDB 10.0, SHOW EXPLAIN shows the output of a\nrunning statement. In some cases, its output can be closer\nto reality than EXPLAIN.\n \nSince MariaDB 10.1, the ANALYZE statement runs a statement\nand returns information about its execution plan. It also\nshows additional columns, to check how much the optimizer\'s\nestimation about filtering and found rows are close to\nreality.\n \nThere is an online EXPLAIN Analyzer that you can use to\nshare EXPLAIN and EXPLAIN EXTENDED output with others.\n \nEXPLAIN can acquire metadata locks in the same way that\nSELECT does, as it needs to know table metadata and,\nsometimes, data as well.\n \nThe columns in EXPLAIN ... SELECT\n \nColumn name | Description | \n \nid | Sequence number that shows in which order tables are\njoined. | \n \nselect_type | What kind of SELECT the table comes from. | \n \ntable | Alias name of table. Materialized temporary tables\nfor sub queries are named | \n \ntype | How rows are found from the table (join type). | \n \npossible_keys | keys in table that could be used to find\nrows in the table | \n \nkey | The name of the key that is used to retrieve rows.\nNULL is no key was used. | \n \nkey_len | How many bytes of the key that was used (shows if\nwe are using only parts of the multi-column key). | \n \nref | The reference that is used to as the key value. | \n \nrows | An estimate of how many rows we will find in the\ntable for each key lookup. | \n \nExtra | Extra information about this join. | \n \nHere are descriptions of the values for some of the more\ncomplex columns in EXPLAIN ... SELECT:\n \n\"select_type\" column\n \nThe select_type column can have the following values:\n \nValue | Description | \n \nDEPENDENT SUBQUERY | The SUBQUERY is DEPENDENT. | \n \nDEPENDENT UNION | The UNION is DEPENDENT. | \n \nDERIVED | The SELECT is DERIVED from the PRIMARY. | \n \nMATERIALIZED | The SUBQUERY is MATERIALIZED. | \n \nPRIMARY | The SELECT is a PRIMARY one. | \n \nSIMPLE | The SELECT is a SIMPLE one. | \n \nSUBQUERY | The SELECT is a SUBQUERY of the PRIMARY. | \n \nUNCACHEABLE SUBQUERY | The SUBQUERY is UNCACHEABLE. | \n \nUNCACHEABLE UNION | The UNION is UNCACHEABLE. | \n \nUNION | The SELECT is a UNION of the PRIMARY. | \n \nUNION RESULT | The result of the UNION. | \n \n\"Type\" column\n \nThis column contains information on how the table is\naccessed.\n \nValue | Description | \n \nALL | A full table scan is done for the table (all rows are\nread). This is bad if the table is large and the table is\njoined against a previous table! This happens when the\noptimizer could not find any usable index to access rows. | \n \nconst | There is only one possibly matching row in the\ntable. The row is read before the optimization phase and all\ncolumns in the table are treated as constants. | \n \neq_ref | A unique index is used to find the rows. This is\nthe best possible plan to find the row. | \n \nfulltext | A fulltext index is used to access the rows. | \n \nindex_merge | A \'range\' access is done for for several\nindex and the found rows are merged. The key column shows\nwhich keys are used. | \n \nindex_subquery | This is similar as ref, but used for sub\nqueries that are transformed to key lookups. | \n \nindex | A full scan over the used index. Better than ALL but\nstill bad if index is large and the table is joined against\na previous table. | \n \nrange | The table will be accessed with a key over one or\nmore value ranges. | \n \nref_or_null | Like \'ref\' but in addition another search\nfor the \'null\' value is done if the first value was not\nfound. This happens usually with sub queries. | \n \nref | A non unique index or prefix of an unique index is\nused to find the rows. Good if the prefix doesn\'t match\nmany rows. | \n \nsystem | The table has 0 or 1 rows. | \n \nunique_subquery | This is similar as eq_ref, but used for\nsub queries that are transformed to key lookups | \n \n\"Extra\" column\n \nThis column consists of one or more of the following values,\nseparated by \';\'\n \n Note that some of these values are detected after the\noptimization phase.\n \nThe optimization phase can do the following changes to the\nWHERE clause:\nAdd the expressions from the ON and USING clauses to the\nWHERE\n clause.\nConstant propagation: If there is column=constant, replace\nall column\n instances with this constant.\nReplace all columns from \'const\' tables with their values.\nRemove the used key columns from the WHERE (as this will be\ntested as\n part of the key lookup).\nRemove impossible constant sub expressions.\n For example WHERE \'(a=1 and a=2) OR b=1\' becomes \'b=1\'.\nReplace columns with other columns that has identical\nvalues:\n Example: WHERE a=b and a=c may be treated\n as \'WHERE a=b and a=c and b=c\'.\nAdd extra conditions to detect impossible row conditions\nearlier. This\n happens mainly with OUTER JOIN where we in some cases add\ndetection\n of NULL values in the WHERE (Part of \'Not exists\'\noptimization).\n This can cause an unexpected \'Using where\' in the Extra\ncolumn.\nFor each table level we remove expressions that have already\nbeen tested when\n we read the previous row. Example: When joining tables t1\nwith t2\n using the following WHERE \'t1.a=1 and t1.a=t2.b\', we\ndon\'t have to\n test \'t1.a=1\' when checking rows in t2 as we already know\nthat this\n expression is true. \n \nValue | Description | \n \nconst row not found | The table was a system table (a table\nwith should exactly one row), but no row was found. | \n \nDistinct | If distinct optimization (remove duplicates) was\nused. This is marked only for the last table in the SELECT.\n| \n \nFull scan on NULL key | The table is a part of the sub query\nand if the value that is used to match the sub query will be\nNULL, we will do a full table scan. | \n \nImpossible HAVING | The used HAVING clause is always false\nso the SELECT will return no rows. | \n \nImpossible WHERE noticed after reading const tables. | The\nused WHERE clause is always false so the SELECT will return\nno rows. This case was detected after we had read all\n\'const\' tables and used the column values as constant in\nthe WHERE clause. For example: WHERE const_column=5 and\nconst_column had a value of 4. | \n \nImpossible WHERE | The used WHERE clause is always false so\nthe SELECT will return no rows. For example: WHERE 1=2 | \n \nNo matching min/max row | During early optimization of\nMIN()/MAX() values it was detected that no row could match\nthe WHERE clause. The MIN()/MAX() function will return NULL.\n| \n \nno matching row in const table | The table was a const table\n(a table with only one possible matching row), but no row\nwas found. | \n \nNo tables used | The SELECT was a sub query that did not use\nany tables. For example a there was no FROM clause or a FROM\nDUAL clause. | \n \nNot exists | Stop searching after more row if we find one\nsingle matching row. This optimization is used with LEFT\nJOIN where one is explicitly searching for rows that\ndoesn\'t exists in the LEFT JOIN TABLE. Example: SELECT *\nFROM t1 LEFT JOIN t2 on (...) WHERE t2.not_null_column IS\nNULL. As t2.not_null_column can only be NULL if there was no\nmatching row for on condition, we can stop searching if we\nfind a single matching row. | \n \nOpen_frm_only | For information_schema tables. Only the frm\n(table definition file was opened) was opened for each\nmatching row. | \n \nOpen_full_table | For information_schema tables. A full\ntable open for each matching row is done to retrieve the\nrequested information. (Slow) | \n \nOpen_trigger_only | For information_schema tables. Only the\ntrigger file definition was opened for each matching row. | \n \nRange checked for each record (index map: ...) | This only\nhappens when there was no good default index to use but\nthere may some index that could be used when we can treat\nall columns from previous table as constants. For each row\ncombination the optimizer will decide which index to use (if\nany) to fetch a row from this table. This is not fast, but\nfaster than a full table scan that is the only other choice.\nThe index map is a bitmask that shows which index are\nconsidered for each row condition. | \n \nScanned 0/1/all databases | For information_schema tables.\nShows how many times we had to do a directory scan. | \n \nSelect tables optimized away | All tables in the join was\noptimized away. This happens when we are only using\nCOUNT(*), MIN() and MAX() functions in the SELECT and we\nwhere able to replace all of these with constants. | \n \nSkip_open_table | For information_schema tables. The queried\ntable didn\'t need to be opened. | \n \nunique row not found | The table was detected to be a const\ntable (a table with only one possible matching row) during\nthe early optimization phase, but no row was found. | \n \nUsing filesort | Filesort is needed to resolve the query.\nThis means an extra phase where we first collect all columns\nto sort, sort them with a disk based merge sort and then use\nthe sorted set to retrieve the rows in sorted order. If the\ncolumn set is small, we store all the columns in the sort\nfile to not have to go to the database to retrieve them\nagain. | \n \nUsing index | Only the index is used to retrieve the needed\ninformation from the table. There is no need to perform an\nextra seek to retrieve the actual record. | \n \nUsing index condition | Like \'Using where\' but the where\ncondition is pushed down to the table engine for internal\noptimization at the index level. | \n \nUsing index condition(BKA) | Like \'Using index condition\'\nbut in addition we use batch key access to retrieve rows. | \n \nUsing index for group-by | The index is being used to\nresolve a GROUP BY or DISTINCT query. The rows are not read.\nThis is very efficient if the table has a lot of identical\nindex entries as duplicates are quickly jumped over. | \n \nUsing intersect(...) | For index_merge joins. Shows which\nindex are part of the intersect. | \n \nUsing join buffer | We store previous row combinations in a\nrow buffer to be able to match each row against all of the\nrows combinations in the join buffer at one go. | \n \nUsing sort_union(...) | For index_merge joins. Shows which\nindex are part of the union. | \n \nUsing temporary | A temporary table is created to hold the\nresult. This typically happens if you are using GROUP BY,\nDISTINCT or ORDER BY. | \n \nUsing where | A WHERE expression (in additional to the\npossible key lookup) is used to check if the row should be\naccepted. If you don\'t have \'Using where\' together with a\njoin type of ALL, you are probably doing something wrong! | \n \nUsing where with pushed condition | Like \'Using where\' but\nthe where condition is pushed down to the table engine for\ninternal optimization at the row level. | \n \nUsing buffer | The UPDATE statement will first buffer the\nrows, and then run the updates, rather than do updates on\nthe fly. See Using Buffer UPDATE Algorithm for a detailed\nexplanation. | \n \nEXPLAIN EXTENDED\n \nThe EXTENDED keyword adds another column, filtered, to the\noutput. This is a percentage estimate of the table rows that\nwill be filtered by the condition.\n \nAn EXPLAIN EXTENDED will always throw a warning, as it adds\nextra Message information to a subsequent SHOW WARNINGS\nstatement. This includes what the SELECT query would look\nlike after optimizing and rewriting rules are applied and\nhow the optimizer qualifies columns and tables.\n \nExamples\n-------- \nAs synonym for DESCRIBE or SHOW COLUMNS FROM:\n \nDESCRIBE city;\n \n+------------+----------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+------------+----------+------+-----+---------+----------------+\n| Id | int(11) | NO | PRI | NULL | auto_increment |\n| Name | char(35) | YES | | NULL | |\n| Country | char(3) | NO | UNI | | |\n| District | char(20) | YES | MUL | | |\n| Population | int(11) | YES | | NULL | |\n+------------+----------+------+-----+---------+----------------+\n \nA simple set of examples to see how EXPLAIN can identify\npoor index usage:\n \nCREATE TABLE IF NOT EXISTS `employees_example` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `first_name` varchar(30) NOT NULL,\n `last_name` varchar(40) NOT NULL,\n `position` varchar(25) NOT NULL,\n `home_address` varchar(50) NOT NULL,\n `home_phone` varchar(12) NOT NULL,\n `employee_code` varchar(25) NOT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `employee_code` (`employee_code`),\n KEY `first_name` (`first_name`,`last_name`)\n) ENGINE=Aria;\n \nINSERT INTO `employees_example` (`first_name`, `last_name`,\n`position`, `home_address`, `home_phone`, `employee_code`)\n VALUES\n (\'Mustapha\', \'Mond\', \'Chief Executive Officer\', \'692\nPromiscuous Plaza\', \'326-555-3492\', \'MM1\'),\n (\'Henry\', \'Foster\', \'Store Manager\', \'314 Savage\nCircle\', \'326-555-3847\', \'HF1\'),\n (\'Bernard\', \'Marx\', \'Cashier\', \'1240 Ambient\nAvenue\', \'326-555-8456\', \'BM1\'),\n (\'Lenina\', \'Crowne\', \'Cashier\', \'281 Bumblepuppy\nBoulevard\', \'328-555-2349\', \'LC1\'),\n (\'Fanny\', \'Crowne\', \'Restocker\', \'1023 Bokanovsky\nLane\', \'326-555-6329\', \'FC1\'),\n (\'Helmholtz\', \'Watson\', \'Janitor\', \'944 Soma\nCourt\', \'329-555-2478\', \'HW1\');\n \nSHOW INDEXES FROM employees_example;\n \n+-------------------+------------+---------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+\n| Table | Non_unique | Key_name | Seq_in_index | Column_name\n| Collation | Cardinality | Sub_part | Packed | Null |\nIndex_type | Comment | Index_comment |\n+-------------------+------------+---------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+\n| employees_example | 0 | PRIMARY | 1 | id | A | 7 | NULL |\nNULL | | BTREE | | |\n| employees_example | 0 | employee_code | 1 | employee_code\n| A | 7 | NULL | NULL | | BTREE | | |\n| employees_example | 1 | first_name | 1 | first_name | A |\nNULL | NULL | NULL | | BTREE | | |\n| employees_example | 1 | first_name | 2 | last_name | A |\nNULL | NULL | NULL | | BTREE | | |\n+-------------------+------------+---------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+\n \nSELECT on a primary key:\n \nEXPLAIN SELECT * FROM employees_example WHERE id=1;\n \n+------+-------------+-------------------+-------+---------------+---------+---------+-------+------+-------+\n| id | select_type | table | type | possible_keys | key |\nkey_len | ref | rows | Extra |\n+------+-------------+-------------------+-------+---------------+---------+---------+-------+------+-------+\n| 1 | SIMPLE | employees_example | const | PRIMARY | PRIMARY\n| 4 | const | 1 | |\n+------+-------------+-------------------+-------+---------------+---------+---------+-------+------+-------+\n \nThe type is const, which means that only one possible result\ncould be returned. \nNow, returning the same record but searching by their phone\nnumber:\n \nEXPLAIN SELECT * FROM employees_example WHERE\nhome_phone=\'326-555-3492\';\n \n+------+-------------+-------------------+------+---------------+------+---------+------+------+-------------+\n| id | select_type | table | type | possible_keys | key |\nkey_len | ref | rows | Extra |\n+------+-------------+-------------------+------+---------------+------+---------+------+------+-------------+\n| 1 | SIMPLE | employees_example | ALL | NULL | NULL | NULL\n| NULL | 6 | Using where |\n+------+-------------+-------------------+------+---------------+------+---------+------+------+-------------+\n \nHere, the type is All, which means no index could be used.\nLooking at the rows count, a full table scan (all six rows)\nhad to be performed in order to retrieve the record. If\nit\'s a requirement to search by phone number, an index will\nhave to be created.\n \nSHOW EXPLAIN example:\n \nSHOW EXPLAIN FOR 1;\n \n+------+-------------+-------+-------+---------------+------+---------+------+---------+-------------+\n| id | select_type | table | type | possible_keys | key |\nkey_len | ref | rows | Extra |\n+------+-------------+-------+-------+---------------+------+---------+------+---------+-------------+\n| 1 | SIMPLE | tbl | index | NULL | a | 5 | NULL | 1000107 |\nUsing index |\n+------+-------------+-------+-------+---------------+------+---------+------+---------+-------------+\n1 row in set, 1 warning (0.00 sec)\n \nExample of ref_or_null optimization\n \nSELECT * FROM table_name\n WHERE key_column=expr OR key_column IS NULL;\n \nref_or_null is something that often happens when you use\nsubqueries with NOT IN as then one has to do an extra check\nfor NULL values if the first value didn\'t have a matching\nrow. \n \n\n\nURL: https://mariadb.com/kb/en/library/explain/','','https://mariadb.com/kb/en/library/explain/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (443,28,'EXPLAIN ANALYZE','The syntax for the EXPLAIN ANALYZE feature was changed to\nANALYZE statement, available since MariaDB 10.1.0. See\nANALYZE statement. \n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/explain-analyze/','','https://mariadb.com/kb/en/library/explain-analyze/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (444,28,'ANALYZE FORMAT=JSON','ANALYZE FORMAT=JSON is a mix of the EXPLAIN FORMAT=JSON and\nANALYZE statement features. ANALYZE FORMAT=JSON $statement\nwill execute $statement, and then print the output of\nEXPLAIN FORMAT=JSON, amended with the data from query\nexecution.\n \nBasic Execution Data\n \nYou can get the following also from tabular ANALYZE\nstatement form:\nr_rows is provided for any node that reads rows. It shows\nhow many rows were read, on average \nr_filtered is provided whenever there is a condition that is\nchecked. It shows the percentage of rows left after checking\nthe condition.\n \nAdvanced Execution Data\n \nThe most important data that is not available in tabula\nANALYZE statement are:\nr_loops field. This shows how many times the node was\nexecuted. Most query plan elements have this field.\nr_total_time_ms field. It shows how much time in total was\nspent executing this node. If the node has subnodes, their\nexecution time is included.\nr_buffer_size field. Query plan nodes that make use of\nbuffers report the size of buffer that was was used.\n \nData About Individual Query Plan Nodes\n \nfilesort node reports whether sorting was done with LIMIT n\nparameter, and how many rows were in the sort result. \nblock-nl-join node has r_loops field, which allows to tell\nwhether Using join buffer was efficient \nrange-checked-for-each-record reports counters that show the\nresult of the check. \nexpression-cache is used for subqueries, and it reports how\nmany times the cache was used, and what cache hit ratio was.\nunion_result node has r_rows so one can see how many rows\nwere produced after UNION operation\nand so forth\n \nUse Cases\n \nSee Examples of ANALYZE FORMAT=JSON.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/analyze-format-json/','','https://mariadb.com/kb/en/library/analyze-format-json/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (445,28,'ANALYZE FORMAT=JSON Examples','Example #1\n \nCustomers who have ordered more than 1M goods.\n \nANALYZE FORMAT=JSON\nSELECT CONT(*)\nFROM customer\nWHERE\n (SELECT SUM(o_totalprice) FROM orders WHERE\no_custkey=c_custkey) > 1000*1000;\n \nThe query takes 40 seconds over cold cache\n \nEXPLAIN: {\n \"query_block\": {\n \"select_id\": 1,\n \"r_loops\": 1,\n \"r_total_time_ms\": 39872,\n \"table\": {\n \"table_name\": \"customer\",\n \"access_type\": \"index\",\n \"key\": \"i_c_nationkey\",\n \"key_length\": \"5\",\n \"used_key_parts\": [\"c_nationkey\"],\n \"r_loops\": 1,\n \"rows\": 150303,\n \"r_rows\": 150000,\n \"r_total_time_ms\": 270.3,\n \"filtered\": 100,\n \"r_filtered\": 60.691,\n \"attached_condition\": \"((subquery#2) > ((1000 *\n1000)))\",\n \"using_index\": true\n },\n \"subqueries\": [\n {\n \"query_block\": {\n \"select_id\": 2,\n \"r_loops\": 150000,\n \"r_total_time_ms\": 39531,\n \"table\": {\n \"table_name\": \"orders\",\n \"access_type\": \"ref\",\n \"possible_keys\": [\"i_o_custkey\"],\n \"key\": \"i_o_custkey\",\n \"key_length\": \"5\",\n \"used_key_parts\": [\"o_custkey\"],\n \"ref\": [\"dbt3sf1.customer.c_custkey\"],\n \"r_loops\": 150000,\n \"rows\": 7,\n \"r_rows\": 10,\n \"r_total_time_ms\": 39208,\n \"filtered\": 100,\n \"r_filtered\": 100\n }\n }\n }\n ]\n }\n}\nANALYZE shows that 39.2 seconds were spent in the subquery,\nwhich was executed 150K times (for every row of outer\ntable).\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/analyze-formatjson-examples/','','https://mariadb.com/kb/en/library/analyze-formatjson-examples/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (446,30,'CONTAINS','Syntax\n------ \nContains(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether a geometry g1 completely\ncontains geometry g2. CONTAINS() is based on the original\nMySQL implementation and uses object bounding rectangles,\nwhile ST_CONTAINS() uses object shapes. \n \nThis tests the opposite relationship to Within().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/contains/','','https://mariadb.com/kb/en/library/contains/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (447,30,'CROSSES','Syntax\n------ \nCrosses(g1,g2)\n \nDescription\n----------- \nReturns 1 if g1 spatially crosses g2. Returns NULL if g1 is\na Polygon or a MultiPolygon, or if g2 is a\nPoint or a MultiPoint. Otherwise, returns 0.\n \nThe term spatially crosses denotes a spatial relation\nbetween two\ngiven geometries that has the following properties:\nThe two geometries intersect\nTheir intersection results in a geometry that has a\ndimension that is one\n less than the maximum dimension of the two given geometries\nTheir intersection is not equal to either of the two given\ngeometries\n \nCROSSES() is based on the original MySQL implementation, and\nuses object bounding rectangles, while ST_CROSSES() uses\nobject shapes.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/crosses/','','https://mariadb.com/kb/en/library/crosses/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (448,30,'DISJOINT','Syntax\n------ \nDisjoint(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether g1 is spatially disjoint\nfrom\n(does not intersect) g2.\n \nDISJOINT() tests the opposite relationship to INTERSECTS().\n \nDISJOINT() is based on the original MySQL implementation and\nuses object bounding rectangles, while ST_DISJOINT() uses\nobject shapes.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/disjoint/','','https://mariadb.com/kb/en/library/disjoint/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (449,30,'EQUALS','Syntax\n------ \nEquals(g1,g2)\n \nFrom MariaDB 10.2.3:\n \nMBREQUALS(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether g1 is spatially equal to\ng2.\n \nEQUALS() is based on the original MySQL implementation and\nuses object bounding rectangles, while ST_EQUALS() uses\nobject shapes.\n \nFrom MariaDB 10.2.3, MBREQUALS is a synonym for Equals.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/equals/','','https://mariadb.com/kb/en/library/equals/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (450,30,'INTERSECTS','Syntax\n------ \nINTERSECTS(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether geometry g1 spatially\nintersects geometry g2.\n \nINTERSECTS() is based on the original MySQL implementation\nand uses object bounding rectangles, while ST_INTERSECTS()\nuses object shapes.\n \nINTERSECTS() tests the opposite relationship to DISJOINT().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/intersects/','','https://mariadb.com/kb/en/library/intersects/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (451,30,'OVERLAPS','Syntax\n------ \nOVERLAPS(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether g1 spatially overlaps g2.\nThe term spatially overlaps is used if two geometries\nintersect and their\nintersection results in a geometry of the same dimension but\nnot equal to\neither of the given geometries.\n \nOVERLAPS() is based on the original MySQL implementation and\nuses object bounding rectangles, while ST_OVERLAPS() uses\nobject shapes.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/overlaps/','','https://mariadb.com/kb/en/library/overlaps/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (452,30,'ST_CONTAINS','Syntax\n------ \nST_CONTAINS(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether a geometry g1 completely\ncontains geometry g2.\n \nST_CONTAINS() uses object shapes, while CONTAINS(), based on\nthe original MySQL implementation, uses object bounding\nrectangles.\n \nST_CONTAINS tests the opposite relationship to ST_WITHIN().\n \nExamples\n-------- \nSET @g1 = ST_GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60,\n125 100, 175 150))\');\n \nSET @g2 = ST_GEOMFROMTEXT(\'POINT(174 149)\');\n \nSELECT ST_CONTAINS(@g1,@g2);\n+----------------------+\n| ST_CONTAINS(@g1,@g2) |\n+----------------------+\n| 1 |\n+----------------------+\n \nSET @g2 = ST_GEOMFROMTEXT(\'POINT(175 151)\');\n \nSELECT ST_CONTAINS(@g1,@g2);\n+----------------------+\n| ST_CONTAINS(@g1,@g2) |\n+----------------------+\n| 0 |\n+----------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st-contains/','','https://mariadb.com/kb/en/library/st-contains/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (453,30,'ST_CROSSES','Syntax\n------ \nST_CROSSES(g1,g2)\n \nDescription\n----------- \nReturns 1 if geometry g1 spatially crosses geometry g2.\nReturns NULL if g1 is a Polygon or a MultiPolygon, or if g2\nis a\nPoint or a MultiPoint. Otherwise, returns 0.\n \nThe term spatially crosses denotes a spatial relation\nbetween two\ngiven geometries that has the following properties:\nThe two geometries intersect\nTheir intersection results in a geometry that has a\ndimension that is one\n less than the maximum dimension of the two given geometries\nTheir intersection is not equal to either of the two given\ngeometries\n \nST_CROSSES() uses object shapes, while CROSSES(), based on\nthe original MySQL implementation, uses object bounding\nrectangles.\n \nExamples\n-------- \nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(174 149, 176 151)\');\n \nSET @g2 = ST_GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60,\n125 100, 175 150))\');\n \nSELECT ST_CROSSES(@g1,@g2);\n+---------------------+\n| ST_CROSSES(@g1,@g2) |\n+---------------------+\n| 1 |\n+---------------------+\n \nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(176 149, 176 151)\');\n \nSELECT ST_CROSSES(@g1,@g2);\n+---------------------+\n| ST_CROSSES(@g1,@g2) |\n+---------------------+\n| 0 |\n+---------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st-crosses/','','https://mariadb.com/kb/en/library/st-crosses/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (454,30,'ST_DIFFERENCE','Syntax\n------ \nST_DIFFERENCE(g1,g2)\n \nDescription\n----------- \nReturns a geometry representing the point set difference of\nthe given geometry values.\n \nExample\n \nSET @g1 = POINT(10,10), @g2 = POINT(20,20);\n \nSELECT ST_AsText(ST_Difference(@g1, @g2));\n+------------------------------------+\n| ST_AsText(ST_Difference(@g1, @g2)) |\n+------------------------------------+\n| POINT(10 10) |\n+------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_difference/','','https://mariadb.com/kb/en/library/st_difference/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (455,30,'ST_DISJOINT','Syntax\n------ \nST_DISJOINT(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether geometry g1 is spatially\ndisjoint from\n(does not intersect with) geometry g2.\n \nST_DISJOINT() uses object shapes, while DISJOINT(), based on\nthe original MySQL implementation, uses object bounding\nrectangles.\n \nST_DISJOINT() tests the opposite relationship to\nST_INTERSECTS().\n \nExamples\n-------- \nSET @g1 = ST_GEOMFROMTEXT(\'POINT(0 0)\');\n \nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 0, 0 2)\');\n \nSELECT ST_DISJOINT(@g1,@g2);\n+----------------------+\n| ST_DISJOINT(@g1,@g2) |\n+----------------------+\n| 1 |\n+----------------------+\n \nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(0 0, 0 2)\');\n \nSELECT ST_DISJOINT(@g1,@g2);\n+----------------------+\n| ST_DISJOINT(@g1,@g2) |\n+----------------------+\n| 0 |\n+----------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_disjoint/','','https://mariadb.com/kb/en/library/st_disjoint/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (456,30,'ST_DISTANCE','ST_DISTANCE() was introduced in MariaDB 5.3.3.\n \nSyntax\n------ \nST_DISTANCE(g1,g2)\n \nDescription\n----------- \nReturns the distance between two geometries, or null if not\ngiven valid inputs.\n \nExample\n \nSELECT ST_Distance(POINT(1,2),POINT(2,2));\n+------------------------------------+\n| ST_Distance(POINT(1,2),POINT(2,2)) |\n+------------------------------------+\n| 1 |\n+------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_distance/','','https://mariadb.com/kb/en/library/st_distance/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (457,30,'ST_EQUALS','Syntax\n------ \nST_EQUALS(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether geometry g1 is spatially\nequal to geometry g2.\n \nST_EQUALS() uses object shapes, while EQUALS(), based on the\noriginal MySQL implementation, uses object bounding\nrectangles.\n \nExamples\n-------- \nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(174 149, 176 151)\');\n \nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(176 151, 174 149)\');\n \nSELECT ST_EQUALS(@g1,@g2);\n+--------------------+\n| ST_EQUALS(@g1,@g2) |\n+--------------------+\n| 1 |\n+--------------------+\n \nSET @g1 = ST_GEOMFROMTEXT(\'POINT(0 2)\');\n \nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 0)\');\n \nSELECT ST_EQUALS(@g1,@g2);\n+--------------------+\n| ST_EQUALS(@g1,@g2) |\n+--------------------+\n| 0 |\n+--------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st-equals/','','https://mariadb.com/kb/en/library/st-equals/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (458,30,'ST_INTERSECTS','Syntax\n------ \nST_INTERSECTS(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether geometry g1 spatially\nintersects geometry g2.\n \nST_INTERSECTS() uses object shapes, while INTERSECTS(),\nbased on the original MySQL implementation, uses object\nbounding rectangles.\n \nST_INTERSECTS() tests the opposite relationship to\nST_DISJOINT().\n \nExamples\n-------- \nSET @g1 = ST_GEOMFROMTEXT(\'POINT(0 0)\');\n \nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(0 0, 0 2)\');\n \nSELECT ST_INTERSECTS(@g1,@g2);\n+------------------------+\n| ST_INTERSECTS(@g1,@g2) |\n+------------------------+\n| 1 |\n+------------------------+\n \nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 0, 0 2)\');\n \nSELECT ST_INTERSECTS(@g1,@g2);\n+------------------------+\n| ST_INTERSECTS(@g1,@g2) |\n+------------------------+\n| 0 |\n+------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st-intersects/','','https://mariadb.com/kb/en/library/st-intersects/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (459,30,'ST_LENGTH','Syntax\n------ \nST_LENGTH(ls)\n \nDescription\n----------- \nReturns as a double-precision number the length of the\nLineString value ls in its associated spatial reference.\n \nExamples\n-------- \nSET @ls = \'LineString(1 1,2 2,3 3)\';\n \nSELECT ST_LENGTH(ST_GeomFromText(@ls));\n+---------------------------------+\n| ST_LENGTH(ST_GeomFromText(@ls)) |\n+---------------------------------+\n| 2.82842712474619 |\n+---------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_length/','','https://mariadb.com/kb/en/library/st_length/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (460,30,'ST_OVERLAPS','Syntax\n------ \nST_OVERLAPS(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether geometry g1 spatially\noverlaps geometry g2.\n \nThe term spatially overlaps is used if two geometries\nintersect and their\nintersection results in a geometry of the same dimension but\nnot equal to\neither of the given geometries.\n \nST_OVERLAPS() uses object shapes, while OVERLAPS(), based on\nthe original MySQL implementation, uses object bounding\nrectangles.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st-overlaps/','','https://mariadb.com/kb/en/library/st-overlaps/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (461,30,'ST_TOUCHES','Syntax\n------ \nST_TOUCHES(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether geometry g1 spatially\ntouches geometry g2. Two geometries spatially touch if the\ninteriors of the geometries do not intersect,\nbut the boundary of one of the geometries intersects either\nthe boundary or the\ninterior of the other.\n \nST_TOUCHES() uses object shapes, while TOUCHES(), based on\nthe original MySQL implementation, uses object bounding\nrectangles.\n \nExamples\n-------- \nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 0)\');\n \nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 0, 0 2)\');\n \nSELECT ST_TOUCHES(@g1,@g2);\n+---------------------+\n| ST_TOUCHES(@g1,@g2) |\n+---------------------+\n| 1 |\n+---------------------+\n \nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 1)\');\n \nSELECT ST_TOUCHES(@g1,@g2);\n+---------------------+\n| ST_TOUCHES(@g1,@g2) |\n+---------------------+\n| 0 |\n+---------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st-touches/','','https://mariadb.com/kb/en/library/st-touches/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (462,30,'ST_WITHIN','Syntax\n------ \nST_WITHIN(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether geometry g1 is spatially\nwithin geometry g2.\n \nThis tests the opposite relationship as ST_CONTAINS().\n \nST_WITHIN() uses object shapes, while WITHIN(), based on the\noriginal MySQL implementation, uses object bounding\nrectangles.\n \nExamples\n-------- \nSET @g1 = ST_GEOMFROMTEXT(\'POINT(174 149)\');\n \nSET @g2 = ST_GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60,\n125 100, 175 150))\');\n \nSELECT ST_WITHIN(@g1,@g2);\n+--------------------+\n| ST_WITHIN(@g1,@g2) |\n+--------------------+\n| 1 |\n+--------------------+\n \nSET @g1 = ST_GEOMFROMTEXT(\'POINT(176 151)\');\n \nSELECT ST_WITHIN(@g1,@g2);\n+--------------------+\n| ST_WITHIN(@g1,@g2) |\n+--------------------+\n| 0 |\n+--------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st-within/','','https://mariadb.com/kb/en/library/st-within/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (463,30,'TOUCHES','Syntax\n------ \nTouches(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether g1 spatially touches g2.\nTwo\ngeometries spatially touch if the interiors of the\ngeometries do not intersect,\nbut the boundary of one of the geometries intersects either\nthe boundary or the\ninterior of the other.\n \nTOUCHES() is based on the original MySQL implementation and\nuses object bounding rectangles, while ST_TOUCHES() uses\nobject shapes.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/touches/','','https://mariadb.com/kb/en/library/touches/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (464,30,'WITHIN','Syntax\n------ \nWithin(g1,g2)\n \nDescription\n----------- \nReturns 1 or 0 to indicate whether g1 is spatially within\ng2.\nThis tests the opposite relationship as Contains().\n \nWITHIN() is based on the original MySQL implementation, and\nuses object bounding rectangles, while ST_WITHIN() uses\nobject shapes.\n \nExamples\n-------- \nSET @g1 = GEOMFROMTEXT(\'POINT(174 149)\');\nSET @g2 = GEOMFROMTEXT(\'POINT(176 151)\');\nSET @g3 = GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60, 125\n100, 175 150))\');\n \nSELECT within(@g1,@g3);\n+-----------------+\n| within(@g1,@g3) |\n+-----------------+\n| 1 |\n+-----------------+\n \nSELECT within(@g2,@g3);\n+-----------------+\n| within(@g2,@g3) |\n+-----------------+\n| 0 |\n+-----------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/within/','','https://mariadb.com/kb/en/library/within/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (465,31,'ADDDATE','Syntax\n------ \nADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days)\n \nDescription\n----------- \nWhen invoked with the INTERVAL form of the second argument,\nADDDATE()\nis a synonym for DATE_ADD(). The related function\nSUBDATE() is a synonym for DATE_SUB(). For\ninformation on the INTERVAL unit argument, see the\ndiscussion for\nDATE_ADD().\n \nWhen invoked with the days form of the second argument,\nMariaDB treats it as an\ninteger number of days to be added to expr.\n \nExamples\n-------- \nSELECT DATE_ADD(\'2008-01-02\', INTERVAL 31 DAY);\n+-----------------------------------------+\n| DATE_ADD(\'2008-01-02\', INTERVAL 31 DAY) |\n+-----------------------------------------+\n| 2008-02-02 |\n+-----------------------------------------+\n \nSELECT ADDDATE(\'2008-01-02\', INTERVAL 31 DAY);\n+----------------------------------------+\n| ADDDATE(\'2008-01-02\', INTERVAL 31 DAY) |\n+----------------------------------------+\n| 2008-02-02 |\n+----------------------------------------+\n \nSELECT ADDDATE(\'2008-01-02\', 31);\n+---------------------------+\n| ADDDATE(\'2008-01-02\', 31) |\n+---------------------------+\n| 2008-02-02 |\n+---------------------------+\n \nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n (\"2007-01-30 21:31:07\"),\n (\"1983-10-15 06:42:51\"),\n (\"2011-04-21 12:34:56\"),\n (\"2011-10-30 06:31:41\"),\n (\"2011-01-30 14:03:25\"),\n (\"2004-10-07 11:19:34\");\n \nSELECT d, ADDDATE(d, 10) from t1;\n \n+---------------------+---------------------+\n| d | ADDDATE(d, 10) |\n+---------------------+---------------------+\n| 2007-01-30 21:31:07 | 2007-02-09 21:31:07 |\n| 1983-10-15 06:42:51 | 1983-10-25 06:42:51 |\n| 2011-04-21 12:34:56 | 2011-05-01 12:34:56 |\n| 2011-10-30 06:31:41 | 2011-11-09 06:31:41 |\n| 2011-01-30 14:03:25 | 2011-02-09 14:03:25 |\n| 2004-10-07 11:19:34 | 2004-10-17 11:19:34 |\n+---------------------+---------------------+\n \nSELECT d, ADDDATE(d, INTERVAL 10 HOUR) from t1;\n \n+---------------------+------------------------------+\n| d | ADDDATE(d, INTERVAL 10 HOUR) |\n+---------------------+------------------------------+\n| 2007-01-30 21:31:07 | 2007-01-31 07:31:07 |\n| 1983-10-15 06:42:51 | 1983-10-15 16:42:51 |\n| 2011-04-21 12:34:56 | 2011-04-21 22:34:56 |\n| 2011-10-30 06:31:41 | 2011-10-30 16:31:41 |\n| 2011-01-30 14:03:25 | 2011-01-31 00:03:25 |\n| 2004-10-07 11:19:34 | 2004-10-07 21:19:34 |\n+---------------------+------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/adddate/','','https://mariadb.com/kb/en/library/adddate/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (466,31,'ADDTIME','Syntax\n------ \nADDTIME(expr1,expr2)\n \nDescription\n----------- \nADDTIME() adds expr2 to expr1 and returns the result. expr1\nis a time\nor datetime expression, and expr2 is a time expression.\n \nExamples\n-------- \nSELECT ADDTIME(\'2007-12-31 23:59:59.999999\', \'1\n1:1:1.000002\');\n+---------------------------------------------------------+\n| ADDTIME(\'2007-12-31 23:59:59.999999\', \'1\n1:1:1.000002\') |\n+---------------------------------------------------------+\n| 2008-01-02 01:01:01.000001 |\n+---------------------------------------------------------+\n \nSELECT ADDTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n+-----------------------------------------------+\n| ADDTIME(\'01:00:00.999999\', \'02:00:00.999998\') |\n+-----------------------------------------------+\n| 03:00:01.999997 |\n+-----------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/addtime/','','https://mariadb.com/kb/en/library/addtime/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (467,31,'CONVERT_TZ','Syntax\n------ \nCONVERT_TZ(dt,from_tz,to_tz)\n \nDescription\n----------- \nCONVERT_TZ() converts a datetime value dt from the time zone\ngiven by from_tz to the time zone given by to_tz and returns\nthe resulting value.\n \nIn order to use named time zones, such as GMT, MET or\nAfrica/Johannesburg, the time_zone tables must be loaded\n(see mysql_tzinfo_to_sql).\n \nNo conversion will take place if the value falls outside of\nthe supported TIMESTAMP range (\'1970-01-01 00:00:01\' to\n\'2038-01-19 05:14:07\' UTC) when converted from from_tz to\nUTC.\n \nThis function returns NULL if the arguments are invalid (or\nnamed time zones have not been loaded).\n \nSee time zones for more information.\n \nExamples\n-------- \nSELECT CONVERT_TZ(\'2016-01-01\n12:00:00\',\'+00:00\',\'+10:00\');\n+-----------------------------------------------------+\n| CONVERT_TZ(\'2016-01-01 12:00:00\',\'+00:00\',\'+10:00\')\n|\n+-----------------------------------------------------+\n| 2016-01-01 22:00:00 |\n+-----------------------------------------------------+\n \nUsing named time zones (with the time zone tables loaded):\n \nSELECT CONVERT_TZ(\'2016-01-01\n12:00:00\',\'GMT\',\'Africa/Johannesburg\');\n+---------------------------------------------------------------+\n| CONVERT_TZ(\'2016-01-01\n12:00:00\',\'GMT\',\'Africa/Johannesburg\') |\n+---------------------------------------------------------------+\n| 2016-01-01 14:00:00 |\n+---------------------------------------------------------------+\n \nThe value is out of the TIMESTAMP range, so no conversion\ntakes place:\n \nSELECT CONVERT_TZ(\'1969-12-31\n22:00:00\',\'+00:00\',\'+10:00\');\n+-----------------------------------------------------+\n| CONVERT_TZ(\'1969-12-31 22:00:00\',\'+00:00\',\'+10:00\')\n|\n+-----------------------------------------------------+\n| 1969-12-31 22:00:00 |\n+-----------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/convert_tz/','','https://mariadb.com/kb/en/library/convert_tz/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (468,31,'CURDATE','Syntax\n------ \nCURDATE()\n \nDescription\n----------- \nReturns the current date as a value in \'YYYY-MM-DD\' or\nYYYYMMDD\nformat, depending on whether the function is used in a\nstring or\nnumeric context.\n \nExamples\n-------- \nSELECT CURDATE();\n+------------+\n| CURDATE() |\n+------------+\n| 2019-03-05 |\n+------------+\n \nIn a numeric context (note this is not performing date\ncalculations):\n \nSELECT CURDATE() +0;\n \n+--------------+\n| CURDATE() +0 |\n+--------------+\n| 20190305 |\n+--------------+\n \nData calculation:\n \nSELECT CURDATE() - INTERVAL 5 DAY;\n \n+----------------------------+\n| CURDATE() - INTERVAL 5 DAY |\n+----------------------------+\n| 2019-02-28 |\n+----------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/curdate/','','https://mariadb.com/kb/en/library/curdate/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (469,31,'CURRENT_DATE','Syntax\n------ \nCURRENT_DATE, CURRENT_DATE()\n \nDescription\n----------- \nCURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/current_date/','','https://mariadb.com/kb/en/library/current_date/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (470,31,'CURRENT_TIME','Syntax\n------ \nCURRENT_TIME\nCURRENT_TIME([precision])\n \nDescription\n----------- \nCURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME().\n \n\n\nURL: https://mariadb.com/kb/en/library/current_time/','','https://mariadb.com/kb/en/library/current_time/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (471,31,'CURRENT_TIMESTAMP','Syntax\n------ \nCURRENT_TIMESTAMP\nCURRENT_TIMESTAMP([precision])\n \nDescription\n----------- \nCURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are synonyms for\nNOW().\n \n\n\nURL: https://mariadb.com/kb/en/library/current_timestamp/','','https://mariadb.com/kb/en/library/current_timestamp/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (472,31,'CURTIME','Syntax\n------ \nCURTIME([precision])\n \nDescription\n----------- \nReturns the current time as a value in \'HH:MM:SS\' or\nHHMMSS.uuuuuu format, depending on whether the function is\nused in a string or numeric context. The value is expressed\nin the current time zone.\n \nThe optional precision determines the microsecond precision.\nSee Microseconds in MariaDB.\n \nExamples\n-------- \nSELECT CURTIME();\n+-----------+\n| CURTIME() |\n+-----------+\n| 12:45:39 |\n+-----------+\n \nSELECT CURTIME() + 0;\n \n+---------------+\n| CURTIME() + 0 |\n+---------------+\n| 124545.000000 |\n+---------------+\n \nWith precision:\n \nSELECT CURTIME(2);\n+-------------+\n| CURTIME(2) |\n+-------------+\n| 09:49:08.09 |\n+-------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/curtime/','','https://mariadb.com/kb/en/library/curtime/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (473,31,'DATE FUNCTION','Syntax\n------ \nDATE(expr)\n \nDescription\n----------- \nExtracts the date part of the date or datetime expression\nexpr.\n \nExamples\n-------- \nSELECT DATE(\'2013-07-18 12:21:32\');\n+-----------------------------+\n| DATE(\'2013-07-18 12:21:32\') |\n+-----------------------------+\n| 2013-07-18 |\n+-----------------------------+\n \nError Handling\n \nUntil MariaDB 5.5.32, some versions of MariaDB returned\n0000-00-00 when passed an invalid date. From 5.5.32, NULL is\nreturned.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/date-function/','','https://mariadb.com/kb/en/library/date-function/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (474,31,'DATEDIFF','Syntax\n------ \nDATEDIFF(expr1,expr2)\n \nDescription\n----------- \nDATEDIFF() returns (expr1 – expr2) expressed\nas a value in days from one date to the other. expr1 and\nexpr2 are date\nor date-and-time expressions. Only the date parts of the\nvalues are used in the\ncalculation.\n \nExamples\n-------- \nSELECT DATEDIFF(\'2007-12-31 23:59:59\',\'2007-12-30\');\n+----------------------------------------------+\n| DATEDIFF(\'2007-12-31 23:59:59\',\'2007-12-30\') |\n+----------------------------------------------+\n| 1 |\n+----------------------------------------------+\n \nSELECT DATEDIFF(\'2010-11-30 23:59:59\',\'2010-12-31\');\n+----------------------------------------------+\n| DATEDIFF(\'2010-11-30 23:59:59\',\'2010-12-31\') |\n+----------------------------------------------+\n| -31 |\n+----------------------------------------------+\n \nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n (\"2007-01-30 21:31:07\"),\n (\"1983-10-15 06:42:51\"),\n (\"2011-04-21 12:34:56\"),\n (\"2011-10-30 06:31:41\"),\n (\"2011-01-30 14:03:25\"),\n (\"2004-10-07 11:19:34\");\n \nSELECT NOW();\n+---------------------+\n| NOW() |\n+---------------------+\n| 2011-05-23 10:56:05 |\n+---------------------+\n \nSELECT d, DATEDIFF(NOW(),d) FROM t1;\n \n+---------------------+-------------------+\n| d | DATEDIFF(NOW(),d) |\n+---------------------+-------------------+\n| 2007-01-30 21:31:07 | 1574 |\n| 1983-10-15 06:42:51 | 10082 |\n| 2011-04-21 12:34:56 | 32 |\n| 2011-10-30 06:31:41 | -160 |\n| 2011-01-30 14:03:25 | 113 |\n| 2004-10-07 11:19:34 | 2419 |\n+---------------------+-------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/datediff/','','https://mariadb.com/kb/en/library/datediff/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (475,31,'DATE_ADD','Syntax\n------ \nDATE_ADD(date,INTERVAL expr unit)\n \nDescription\n----------- \nPerforms date arithmetic. The date argument specifies the\nstarting date or datetime value. expr is an expression\nspecifying the\ninterval value to be added or subtracted from the starting\ndate. expr is a\nstring; it may start with a \"-\" for negative intervals.\nunit is a\nkeyword indicating the units in which the expression should\nbe interpreted. See Date and Time Units for a complete list\nof permitted units. \n \nSee also DATE_SUB().\n \nExamples\n-------- \nSELECT \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND;\n \n+-------------------------------------------+\n| \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND |\n+-------------------------------------------+\n| 2009-01-01 00:00:00 |\n+-------------------------------------------+\n \nSELECT INTERVAL 1 DAY + \'2008-12-31\';\n \n+-------------------------------+\n| INTERVAL 1 DAY + \'2008-12-31\' |\n+-------------------------------+\n| 2009-01-01 |\n+-------------------------------+\n \nSELECT \'2005-01-01\' - INTERVAL 1 SECOND;\n \n+----------------------------------+\n| \'2005-01-01\' - INTERVAL 1 SECOND |\n+----------------------------------+\n| 2004-12-31 23:59:59 |\n+----------------------------------+\n \nSELECT DATE_ADD(\'2000-12-31 23:59:59\', INTERVAL 1 SECOND);\n+----------------------------------------------------+\n| DATE_ADD(\'2000-12-31 23:59:59\', INTERVAL 1 SECOND) |\n+----------------------------------------------------+\n| 2001-01-01 00:00:00 |\n+----------------------------------------------------+\n \nSELECT DATE_ADD(\'2010-12-31 23:59:59\', INTERVAL 1 DAY);\n+-------------------------------------------------+\n| DATE_ADD(\'2010-12-31 23:59:59\', INTERVAL 1 DAY) |\n+-------------------------------------------------+\n| 2011-01-01 23:59:59 |\n+-------------------------------------------------+\n \nSELECT DATE_ADD(\'2100-12-31 23:59:59\', INTERVAL \'1:1\'\nMINUTE_SECOND);\n+---------------------------------------------------------------+\n| DATE_ADD(\'2100-12-31 23:59:59\', INTERVAL \'1:1\'\nMINUTE_SECOND) |\n+---------------------------------------------------------------+\n| 2101-01-01 00:01:00 |\n+---------------------------------------------------------------+\n \nSELECT DATE_ADD(\'1900-01-01 00:00:00\', INTERVAL \'-1 10\'\nDAY_HOUR);\n+------------------------------------------------------------+\n| DATE_ADD(\'1900-01-01 00:00:00\', INTERVAL \'-1 10\'\nDAY_HOUR) |\n+------------------------------------------------------------+\n| 1899-12-30 14:00:00 |\n+------------------------------------------------------------+\n \nSELECT DATE_ADD(\'1992-12-31 23:59:59.000002\', INTERVAL\n\'1.999999\' SECOND_MICROSECOND);\n+--------------------------------------------------------------------------------+\n| DATE_ADD(\'1992-12-31 23:59:59.000002\', INTERVAL\n\'1.999999\' SECOND_MICROSECOND) |\n+--------------------------------------------------------------------------------+\n| 1993-01-01 00:00:01.000001 |\n+--------------------------------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/date_add/','','https://mariadb.com/kb/en/library/date_add/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (476,31,'DATE_FORMAT','Syntax\n------ \nDATE_FORMAT(date, format[, locale])\n \nDescription\n----------- \nFormats the date value according to the format string. \n \nThe language used for the names is controlled by the value\nof the lc_time_names system variable. See server locale for\nmore on the supported locales.\n \nThe options that can be used by DATE_FORMAT(), as well as\nits inverse STR_TO_DATE() and the FROM_UNIXTIME() function,\nare:\n \nOption | Description | \n \n%a | Short weekday name in current locale (Variable\nlc_time_names). | \n \n%b | Short form month name in current locale. For locale\nen_US this is one of:\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov or Dec. | \n \n%c | Month with 1 or 2 digits. | \n \n%D | Day with English suffix \'th\', \'nd\', \'st\' or\n\'rd\'\'. (1st, 2nd, 3rd...). | \n \n%d | Day with 2 digits. | \n \n%e | Day with 1 or 2 digits. | \n \n%f | Sub seconds 6 digits. | \n \n%H | Hour with 2 digits between 00-23. | \n \n%h | Hour with 2 digits between 01-12. | \n \n%I | Hour with 2 digits between 01-12. | \n \n%i | Minute with 2 digits. | \n \n%j | Day of the year (001-366) | \n \n%k | Hour with 1 digits between 0-23. | \n \n%l | Hour with 1 digits between 1-12. | \n \n%M | Full month name in current locale (Variable\nlc_time_names). | \n \n%m | Month with 2 digits. | \n \n%p | AM/PM according to current locale (Variable\nlc_time_names). | \n \n%r | Time in 12 hour format, followed by AM/PM. Short for\n\'%I:%i:%S %p\'. | \n \n%S | Seconds with 2 digits. | \n \n%s | Seconds with 2 digits. | \n \n%T | Time in 24 hour format. Short for \'%H:%i:%S\'. | \n \n%U | Week number (00-53), when first day of the week is\nSunday. | \n \n%u | Week number (00-53), when first day of the week is\nMonday. | \n \n%V | Week number (01-53), when first day of the week is\nSunday. Used with %X. | \n \n%v | Week number (01-53), when first day of the week is\nMonday. Used with %x. | \n \n%W | Full weekday name in current locale (Variable\nlc_time_names). | \n \n%w | Day of the week. 0 = Sunday, 6 = Saturday. | \n \n%X | Year with 4 digits when first day of the week is\nSunday. Used with %V. | \n \n%x | Year with 4 digits when first day of the week is\nMonday. Used with %v. | \n \n%Y | Year with 4 digits. | \n \n%y | Year with 2 digits. | \n \n%# | For str_to_date(), skip all numbers. | \n \n%. | For str_to_date(), skip all punctation characters. | \n \n%@ | For str_to_date(), skip all alpha characters. | \n \n%% | A literal % character. | \n \nTo get a date in one of the standard formats, GET_FORMAT()\ncan be used.\n \nExamples\n-------- \nSELECT DATE_FORMAT(\'2009-10-04 22:23:00\', \'%W %M %Y\');\n+------------------------------------------------+\n| DATE_FORMAT(\'2009-10-04 22:23:00\', \'%W %M %Y\') |\n+------------------------------------------------+\n| Sunday October 2009 |\n+------------------------------------------------+\n \nSELECT DATE_FORMAT(\'2007-10-04 22:23:00\', \'%H:%i:%s\');\n+------------------------------------------------+\n| DATE_FORMAT(\'2007-10-04 22:23:00\', \'%H:%i:%s\') |\n+------------------------------------------------+\n| 22:23:00 |\n+------------------------------------------------+\n \nSELECT DATE_FORMAT(\'1900-10-04 22:23:00\', \'%D %y %a %d %m\n%b %j\');\n+------------------------------------------------------------+\n| DATE_FORMAT(\'1900-10-04 22:23:00\', \'%D %y %a %d %m %b\n%j\') |\n+------------------------------------------------------------+\n| 4th 00 Thu 04 10 Oct 277 |\n+------------------------------------------------------------+\n \nSELECT DATE_FORMAT(\'1997-10-04 22:23:00\', \'%H %k %I %r %T\n%S %w\');\n+------------------------------------------------------------+\n| DATE_FORMAT(\'1997-10-04 22:23:00\', \'%H %k %I %r %T %S\n%w\') |\n+------------------------------------------------------------+\n| 22 22 10 10:23:00 PM 22:23:00 00 6 |\n+------------------------------------------------------------+\n \nSELECT DATE_FORMAT(\'1999-01-01\', \'%X %V\');\n+------------------------------------+\n| DATE_FORMAT(\'1999-01-01\', \'%X %V\') |\n+------------------------------------+\n| 1998 52 |\n+------------------------------------+\n \nSELECT DATE_FORMAT(\'2006-06-00\', \'%d\');\n+---------------------------------+\n| DATE_FORMAT(\'2006-06-00\', \'%d\') |\n+---------------------------------+\n| 00 |\n+---------------------------------+\n \nOptionally, the locale can be explicitly specified as the\nthird DATE_FORMAT() argument. Doing so makes the function\nindependent from the session settings, and the three\nargument version of DATE_FORMAT() can be used in virtual\nindexed and persistent generated-columns:\n \nSELECT DATE_FORMAT(\'2006-01-01\', \'%W\', \'el_GR\');\n+------------------------------------------+\n| DATE_FORMAT(\'2006-01-01\', \'%W\', \'el_GR\') |\n+------------------------------------------+\n| Κυριακή |\n+------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/date_format/','','https://mariadb.com/kb/en/library/date_format/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (477,31,'DATE_SUB','Syntax\n------ \nDATE_SUB(date,INTERVAL expr unit)\n \nDescription\n----------- \nPerforms date arithmetic. The date argument specifies the\nstarting date or datetime value. expr is an expression\nspecifying the\ninterval value to be added or subtracted from the starting\ndate. expr is a\nstring; it may start with a \"-\" for negative intervals.\nunit is a\nkeyword indicating the units in which the expression should\nbe interpreted. See Date and Time Units for a complete list\nof permitted units. \n \nSee also DATE_ADD().\n \nExamples\n-------- \nSELECT DATE_SUB(\'1998-01-02\', INTERVAL 31 DAY);\n+-----------------------------------------+\n| DATE_SUB(\'1998-01-02\', INTERVAL 31 DAY) |\n+-----------------------------------------+\n| 1997-12-02 |\n+-----------------------------------------+\n \nSELECT DATE_SUB(\'2005-01-01 00:00:00\', INTERVAL \'1\n1:1:1\' DAY_SECOND);\n+----------------------------------------------------------------+\n| DATE_SUB(\'2005-01-01 00:00:00\', INTERVAL \'1 1:1:1\'\nDAY_SECOND) |\n+----------------------------------------------------------------+\n| 2004-12-30 22:58:59 |\n+----------------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/date_sub/','','https://mariadb.com/kb/en/library/date_sub/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (478,31,'DAY','Syntax\n------ \nDAY(date)\n \nDescription\n----------- \nDAY() is a synonym for DAYOFMONTH().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/day/','','https://mariadb.com/kb/en/library/day/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (479,31,'DAYNAME','Syntax\n------ \nDAYNAME(date)\n \nDescription\n----------- \nReturns the name of the weekday for date. The language used\nfor the name is controlled by the value\nof the lc_time_names system variable. See server locale for\nmore on the supported locales.\n \nExamples\n-------- \nSELECT DAYNAME(\'2007-02-03\');\n+-----------------------+\n| DAYNAME(\'2007-02-03\') |\n+-----------------------+\n| Saturday |\n+-----------------------+\n \nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n (\"2007-01-30 21:31:07\"),\n (\"1983-10-15 06:42:51\"),\n (\"2011-04-21 12:34:56\"),\n (\"2011-10-30 06:31:41\"),\n (\"2011-01-30 14:03:25\"),\n (\"2004-10-07 11:19:34\");\n \nSELECT d, DAYNAME(d) FROM t1;\n \n+---------------------+------------+\n| d | DAYNAME(d) |\n+---------------------+------------+\n| 2007-01-30 21:31:07 | Tuesday |\n| 1983-10-15 06:42:51 | Saturday |\n| 2011-04-21 12:34:56 | Thursday |\n| 2011-10-30 06:31:41 | Sunday |\n| 2011-01-30 14:03:25 | Sunday |\n| 2004-10-07 11:19:34 | Thursday |\n+---------------------+------------+\n \nChanging the locale:\n \nSET lc_time_names = \'fr_CA\';\n \nSELECT DAYNAME(\'2013-04-01\');\n+-----------------------+\n| DAYNAME(\'2013-04-01\') |\n+-----------------------+\n| lundi |\n+-----------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/dayname/','','https://mariadb.com/kb/en/library/dayname/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (480,31,'DAYOFMONTH','Syntax\n------ \nDAYOFMONTH(date)\n \nDescription\n----------- \nReturns the day of the month for date, in the range 1 to 31,\nor 0\nfor dates such as \'0000-00-00\' or \'2008-00-00\' which\nhave a zero day\npart.\n \nDAY() is a synonym.\n \nExamples\n-------- \nSELECT DAYOFMONTH(\'2007-02-03\');\n+--------------------------+\n| DAYOFMONTH(\'2007-02-03\') |\n+--------------------------+\n| 3 |\n+--------------------------+\n \nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n (\"2007-01-30 21:31:07\"),\n (\"1983-10-15 06:42:51\"),\n (\"2011-04-21 12:34:56\"),\n (\"2011-10-30 06:31:41\"),\n (\"2011-01-30 14:03:25\"),\n (\"2004-10-07 11:19:34\");\n \nSELECT d FROM t1 where DAYOFMONTH(d) = 30;\n \n+---------------------+\n| d |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n+---------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/dayofmonth/','','https://mariadb.com/kb/en/library/dayofmonth/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (481,31,'DAYOFWEEK','Syntax\n------ \nDAYOFWEEK(date)\n \nDescription\n----------- \nReturns the day of the week index for the date (1 = Sunday,\n2 = Monday, ..., 7 =\nSaturday). These index values correspond to the ODBC\nstandard.\n \nThis contrasts with WEEKDAY() which follows a different\nindex numbering\n(0 = Monday, 1 = Tuesday, ... 6 = Sunday).\n \nExamples\n-------- \nSELECT DAYOFWEEK(\'2007-02-03\');\n+-------------------------+\n| DAYOFWEEK(\'2007-02-03\') |\n+-------------------------+\n| 7 |\n+-------------------------+\n \nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n (\"2007-01-30 21:31:07\"),\n (\"1983-10-15 06:42:51\"),\n (\"2011-04-21 12:34:56\"),\n (\"2011-10-30 06:31:41\"),\n (\"2011-01-30 14:03:25\"),\n (\"2004-10-07 11:19:34\");\n \nSELECT d, DAYNAME(d), DAYOFWEEK(d), WEEKDAY(d) from t1;\n \n+---------------------+------------+--------------+------------+\n| d | DAYNAME(d) | DAYOFWEEK(d) | WEEKDAY(d) |\n+---------------------+------------+--------------+------------+\n| 2007-01-30 21:31:07 | Tuesday | 3 | 1 |\n| 1983-10-15 06:42:51 | Saturday | 7 | 5 |\n| 2011-04-21 12:34:56 | Thursday | 5 | 3 |\n| 2011-10-30 06:31:41 | Sunday | 1 | 6 |\n| 2011-01-30 14:03:25 | Sunday | 1 | 6 |\n| 2004-10-07 11:19:34 | Thursday | 5 | 3 |\n+---------------------+------------+--------------+------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/dayofweek/','','https://mariadb.com/kb/en/library/dayofweek/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (482,31,'DAYOFYEAR','Syntax\n------ \nDAYOFYEAR(date)\n \nDescription\n----------- \nReturns the day of the year for date, in the range 1 to 366.\n \nExamples\n-------- \nSELECT DAYOFYEAR(\'2018-02-16\');\n+-------------------------+\n| DAYOFYEAR(\'2018-02-16\') |\n+-------------------------+\n| 47 |\n+-------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/dayofyear/','','https://mariadb.com/kb/en/library/dayofyear/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (483,31,'EXTRACT','Syntax\n------ \nEXTRACT(unit FROM date)\n \nDescription\n----------- \nThe EXTRACT() function extracts the required unit from the\ndate. See Date and Time Units for a complete list of\npermitted units.\n \nIn MariaDB 10.0.7 and MariaDB 5.5.35, EXTRACT (HOUR FROM\n...) was changed to return a value from 0 to 23, adhering to\nthe SQL standard. Until MariaDB 10.0.6 and MariaDB 5.5.34,\nand in all versions of MySQL at least as of MySQL 5.7, it\ncould return a value > 23. HOUR() is not a standard\nfunction, so continues to adhere to the old behaviour\ninherited from MySQL.\n \nExamples\n-------- \nSELECT EXTRACT(YEAR FROM \'2009-07-02\');\n+---------------------------------+\n| EXTRACT(YEAR FROM \'2009-07-02\') |\n+---------------------------------+\n| 2009 |\n+---------------------------------+\n \nSELECT EXTRACT(YEAR_MONTH FROM \'2009-07-02 01:02:03\');\n+------------------------------------------------+\n| EXTRACT(YEAR_MONTH FROM \'2009-07-02 01:02:03\') |\n+------------------------------------------------+\n| 200907 |\n+------------------------------------------------+\n \nSELECT EXTRACT(DAY_MINUTE FROM \'2009-07-02 01:02:03\');\n+------------------------------------------------+\n| EXTRACT(DAY_MINUTE FROM \'2009-07-02 01:02:03\') |\n+------------------------------------------------+\n| 20102 |\n+------------------------------------------------+\n \nSELECT EXTRACT(MICROSECOND FROM \'2003-01-02\n10:30:00.000123\');\n+--------------------------------------------------------+\n| EXTRACT(MICROSECOND FROM \'2003-01-02 10:30:00.000123\') |\n+--------------------------------------------------------+\n| 123 |\n+--------------------------------------------------------+\n \nFrom MariaDB 10.0.7 and MariaDB 5.5.35, EXTRACT (HOUR\nFROM...) returns a value from 0 to 23, as per the SQL\nstandard. HOUR is not a standard function, so continues to\nadhere to the old behaviour inherited from MySQL.\n \nSELECT EXTRACT(HOUR FROM \'26:30:00\'), HOUR(\'26:30:00\');\n+-------------------------------+------------------+\n| EXTRACT(HOUR FROM \'26:30:00\') | HOUR(\'26:30:00\') |\n+-------------------------------+------------------+\n| 2 | 26 |\n+-------------------------------+------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/extract/','','https://mariadb.com/kb/en/library/extract/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (484,31,'FROM_DAYS','Syntax\n------ \nFROM_DAYS(N)\n \nDescription\n----------- \nGiven a day number N, returns a DATE value. The day count is\nbased on the number of days from the start of the standard\ncalendar (0000-00-00). \n \nThe function is not designed for use with dates before the\nadvent of the Gregorian calendar in October 1582. Results\nwill not be reliable since it doesn\'t account for the lost\ndays when the calendar changed from the Julian calendar.\n \nThis is the converse of the TO_DAYS() function.\n \nExamples\n-------- \nSELECT FROM_DAYS(730669);\n+-------------------+\n| FROM_DAYS(730669) |\n+-------------------+\n| 2000-07-03 |\n+-------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/from_days/','','https://mariadb.com/kb/en/library/from_days/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (485,31,'FROM_UNIXTIME','Syntax\n------ \nFROM_UNIXTIME(unix_timestamp),\nFROM_UNIXTIME(unix_timestamp,format)\n \nDescription\n----------- \nReturns a representation of the unix_timestamp argument as a\nvalue in\n\'YYYY-MM-DD HH:MM:SS\' or YYYYMMDDHHMMSS.uuuuuu format,\ndepending on\nwhether the function is used in a string or numeric context.\nThe value\nis expressed in the current time zone. unix_timestamp is an\ninternal\ntimestamp value such as is produced by the UNIX_TIMESTAMP()\nfunction.\n \nIf format is given, the result is formatted according to the\nformat\nstring, which is used the same way as listed in the entry\nfor the\nDATE_FORMAT() function.\n \nTimestamps in MariaDB have a maximum value of 2147483647,\nequivalent to 2038-01-19 05:14:07. This is due to the\nunderlying 32-bit limitation. Using the function on a\ntimestamp beyond this will result in NULL being returned.\nUse DATETIME as a storage type if you require dates beyond\nthis.\n \nThe options that can be used by FROM_UNIXTIME(), as well as\nDATE_FORMAT() and STR_TO_DATE(), are:\n \nOption | Description | \n \n%a | Short weekday name in current locale (Variable\nlc_time_names). | \n \n%b | Short form month name in current locale. For locale\nen_US this is one of:\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov or Dec. | \n \n%c | Month with 1 or 2 digits. | \n \n%D | Day with English suffix \'th\', \'nd\', \'st\' or\n\'rd\'\'. (1st, 2nd, 3rd...). | \n \n%d | Day with 2 digits. | \n \n%e | Day with 1 or 2 digits. | \n \n%f | Sub seconds 6 digits. | \n \n%H | Hour with 2 digits between 00-23. | \n \n%h | Hour with 2 digits between 01-12. | \n \n%I | Hour with 2 digits between 01-12. | \n \n%i | Minute with 2 digits. | \n \n%j | Day of the year (001-366) | \n \n%k | Hour with 1 digits between 0-23. | \n \n%l | Hour with 1 digits between 1-12. | \n \n%M | Full month name in current locale (Variable\nlc_time_names). | \n \n%m | Month with 2 digits. | \n \n%p | AM/PM according to current locale (Variable\nlc_time_names). | \n \n%r | Time in 12 hour format, followed by AM/PM. Short for\n\'%I:%i:%S %p\'. | \n \n%S | Seconds with 2 digits. | \n \n%s | Seconds with 2 digits. | \n \n%T | Time in 24 hour format. Short for \'%H:%i:%S\'. | \n \n%U | Week number (00-53), when first day of the week is\nSunday. | \n \n%u | Week number (00-53), when first day of the week is\nMonday. | \n \n%V | Week number (01-53), when first day of the week is\nSunday. Used with %X. | \n \n%v | Week number (01-53), when first day of the week is\nMonday. Used with %x. | \n \n%W | Full weekday name in current locale (Variable\nlc_time_names). | \n \n%w | Day of the week. 0 = Sunday, 1 = Saturday. | \n \n%X | Year with 4 digits when first day of the week is\nSunday. Used with %V. | \n \n%x | Year with 4 digits when first day of the week is\nSunday. Used with %v. | \n \n%Y | Year with 4 digits. | \n \n%y | Year with 2 digits. | \n \n%# | For str_to_date(), skip all numbers. | \n \n%. | For str_to_date(), skip all punctation characters. | \n \n%@ | For str_to_date(), skip all alpha characters. | \n \n%% | A literal % character. | \n \nPerformance Considerations\n \nIf your session time zone is set to SYSTEM (the default),\nFROM_UNIXTIME() will call the OS function to convert the\ndata using the system time zone. At least on Linux, the\ncorresponding function (localtime_r) uses a global mutex\ninside glibc that can cause contention under high concurrent\nload.\n \nSet your time zone to a named time zone to avoid this issue.\nSee mysql time zone tables for details on how to do this.\n \nExamples\n-------- \nSELECT FROM_UNIXTIME(1196440219);\n+---------------------------+\n| FROM_UNIXTIME(1196440219) |\n+---------------------------+\n| 2007-11-30 11:30:19 |\n+---------------------------+\n \nSELECT FROM_UNIXTIME(1196440219) + 0;\n \n+-------------------------------+\n| FROM_UNIXTIME(1196440219) + 0 |\n+-------------------------------+\n| 20071130113019.000000 |\n+-------------------------------+\n \nSELECT FROM_UNIXTIME(UNIX_TIMESTAMP(), \'%Y %D %M %h:%i:%s\n%x\');\n+---------------------------------------------------------+\n| FROM_UNIXTIME(UNIX_TIMESTAMP(), \'%Y %D %M %h:%i:%s %x\')\n|\n+---------------------------------------------------------+\n| 2010 27th March 01:03:47 2010 |\n+---------------------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/from_unixtime/','','https://mariadb.com/kb/en/library/from_unixtime/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (486,31,'GET_FORMAT','Syntax\n------ \nGET_FORMAT({DATE|DATETIME|TIME},\n{\'EUR\'|\'USA\'|\'JIS\'|\'ISO\'|\'INTERNAL\'})\n \nDescription\n----------- \nReturns a format string. This function is useful in\ncombination with\nthe DATE_FORMAT() and the STR_TO_DATE() functions.\n \nPossible result formats are:\n \nFunction Call | Result Format | \n \nGET_FORMAT(DATE,\'EUR\') | \'%d.%m.%Y\' | \n \nGET_FORMAT(DATE,\'USA\') | \'%m.%d.%Y\' | \n \nGET_FORMAT(DATE,\'JIS\') | \'%Y-%m-%d\' | \n \nGET_FORMAT(DATE,\'ISO\') | \'%Y-%m-%d\' | \n \nGET_FORMAT(DATE,\'INTERNAL\') | \'%Y%m%d\' | \n \nGET_FORMAT(DATETIME,\'EUR\') | \'%Y-%m-%d %H.%i.%s\' | \n \nGET_FORMAT(DATETIME,\'USA\') | \'%Y-%m-%d %H.%i.%s\' | \n \nGET_FORMAT(DATETIME,\'JIS\') | \'%Y-%m-%d %H:%i:%s\' | \n \nGET_FORMAT(DATETIME,\'ISO\') | \'%Y-%m-%d %H:%i:%s\' | \n \nGET_FORMAT(DATETIME,\'INTERNAL\') | \'%Y%m%d%H%i%s\' | \n \nGET_FORMAT(TIME,\'EUR\') | \'%H.%i.%s\' | \n \nGET_FORMAT(TIME,\'USA\') | \'%h:%i:%s %p\' | \n \nGET_FORMAT(TIME,\'JIS\') | \'%H:%i:%s\' | \n \nGET_FORMAT(TIME,\'ISO\') | \'%H:%i:%s\' | \n \nGET_FORMAT(TIME,\'INTERNAL\') | \'%H%i%s\' | \n \nExamples\n-------- \nObtaining the string matching to the standard European date\nformat:\n \nSELECT GET_FORMAT(DATE, \'EUR\');\n+-------------------------+\n| GET_FORMAT(DATE, \'EUR\') |\n+-------------------------+\n| %d.%m.%Y |\n+-------------------------+\n \nUsing the same string to format a date:\n \nSELECT DATE_FORMAT(\'2003-10-03\',GET_FORMAT(DATE,\'EUR\'));\n+--------------------------------------------------+\n| DATE_FORMAT(\'2003-10-03\',GET_FORMAT(DATE,\'EUR\')) |\n+--------------------------------------------------+\n| 03.10.2003 |\n+--------------------------------------------------+\n \nSELECT STR_TO_DATE(\'10.31.2003\',GET_FORMAT(DATE,\'USA\'));\n+--------------------------------------------------+\n| STR_TO_DATE(\'10.31.2003\',GET_FORMAT(DATE,\'USA\')) |\n+--------------------------------------------------+\n| 2003-10-31 |\n+--------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/get_format/','','https://mariadb.com/kb/en/library/get_format/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (487,31,'HOUR','Syntax\n------ \nHOUR(time)\n \nDescription\n----------- \nReturns the hour for time. The range of the return value is\n0 to 23\nfor time-of-day values. However, the range of TIME values\nactually is\nmuch larger, so HOUR can return values greater than 23.\n \nThe return value is always positive, even if a negative TIME\nvalue is provided.\n \nExamples\n-------- \nSELECT HOUR(\'10:05:03\');\n+------------------+\n| HOUR(\'10:05:03\') |\n+------------------+\n| 10 |\n+------------------+\n \nSELECT HOUR(\'272:59:59\');\n+-------------------+\n| HOUR(\'272:59:59\') |\n+-------------------+\n| 272 |\n+-------------------+\n \nDifference between EXTRACT (HOUR FROM ...) (>= MariaDB\n10.0.7 and MariaDB 5.5.35) and HOUR:\n \nSELECT EXTRACT(HOUR FROM \'26:30:00\'), HOUR(\'26:30:00\');\n+-------------------------------+------------------+\n| EXTRACT(HOUR FROM \'26:30:00\') | HOUR(\'26:30:00\') |\n+-------------------------------+------------------+\n| 2 | 26 |\n+-------------------------------+------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/hour/','','https://mariadb.com/kb/en/library/hour/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (488,31,'LAST_DAY','Syntax\n------ \nLAST_DAY(date)\n \nDescription\n----------- \nTakes a date or datetime value and returns the corresponding\nvalue for\nthe last day of the month. Returns NULL if the argument is\ninvalid.\n \nExamples\n-------- \nSELECT LAST_DAY(\'2003-02-05\');\n+------------------------+\n| LAST_DAY(\'2003-02-05\') |\n+------------------------+\n| 2003-02-28 |\n+------------------------+\n \nSELECT LAST_DAY(\'2004-02-05\');\n+------------------------+\n| LAST_DAY(\'2004-02-05\') |\n+------------------------+\n| 2004-02-29 |\n+------------------------+\n \nSELECT LAST_DAY(\'2004-01-01 01:01:01\');\n+---------------------------------+\n| LAST_DAY(\'2004-01-01 01:01:01\') |\n+---------------------------------+\n| 2004-01-31 |\n+---------------------------------+\n \nSELECT LAST_DAY(\'2003-03-32\');\n+------------------------+\n| LAST_DAY(\'2003-03-32\') |\n+------------------------+\n| NULL |\n+------------------------+\n1 row in set, 1 warning (0.00 sec)\n \nWarning (Code 1292): Incorrect datetime value:\n\'2003-03-32\'\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/last_day/','','https://mariadb.com/kb/en/library/last_day/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (489,31,'LOCALTIME','Syntax\n------ \nLOCALTIME\nLOCALTIME([precision])\n \nDescription\n----------- \nLOCALTIME and LOCALTIME() are synonyms for NOW().\n \n\n\nURL: https://mariadb.com/kb/en/library/localtime/','','https://mariadb.com/kb/en/library/localtime/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (490,31,'LOCALTIMESTAMP','Syntax\n------ \nLOCALTIMESTAMP\nLOCALTIMESTAMP([precision])\n \nDescription\n----------- \nLOCALTIMESTAMP and LOCALTIMESTAMP() are synonyms for NOW().\n \n\n\nURL: https://mariadb.com/kb/en/library/localtimestamp/','','https://mariadb.com/kb/en/library/localtimestamp/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (491,31,'MAKEDATE','Syntax\n------ \nMAKEDATE(year,dayofyear)\n \nDescription\n----------- \nReturns a date, given year and day-of-year values. dayofyear\nmust be\ngreater than 0 or the result is NULL.\n \nExamples\n-------- \nSELECT MAKEDATE(2011,31), MAKEDATE(2011,32);\n+-------------------+-------------------+\n| MAKEDATE(2011,31) | MAKEDATE(2011,32) |\n+-------------------+-------------------+\n| 2011-01-31 | 2011-02-01 |\n+-------------------+-------------------+\n \nSELECT MAKEDATE(2011,365), MAKEDATE(2014,365);\n+--------------------+--------------------+\n| MAKEDATE(2011,365) | MAKEDATE(2014,365) |\n+--------------------+--------------------+\n| 2011-12-31 | 2014-12-31 |\n+--------------------+--------------------+\n \nSELECT MAKEDATE(2011,0);\n+------------------+\n| MAKEDATE(2011,0) |\n+------------------+\n| NULL |\n+------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/makedate/','','https://mariadb.com/kb/en/library/makedate/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (492,31,'MAKETIME','Syntax\n------ \nMAKETIME(hour,minute,second)\n \nDescription\n----------- \nReturns a time value calculated from the hour, minute, and\nsecond arguments.\n \nIf minute or second are out of the range 0 to 60, NULL is\nreturned. The hour can be in the range -838 to 838, outside\nof which the value is truncated with a warning.\n \nExamples\n-------- \nSELECT MAKETIME(13,57,33);\n+--------------------+\n| MAKETIME(13,57,33) |\n+--------------------+\n| 13:57:33 |\n+--------------------+\n \nSELECT MAKETIME(-13,57,33);\n+---------------------+\n| MAKETIME(-13,57,33) |\n+---------------------+\n| -13:57:33 |\n+---------------------+\n \nSELECT MAKETIME(13,67,33);\n+--------------------+\n| MAKETIME(13,67,33) |\n+--------------------+\n| NULL |\n+--------------------+\n \nSELECT MAKETIME(-1000,57,33);\n+-----------------------+\n| MAKETIME(-1000,57,33) |\n+-----------------------+\n| -838:59:59 |\n+-----------------------+\n1 row in set, 1 warning (0.00 sec)\n \nSHOW WARNINGS;\n \n+---------+------+-----------------------------------------------+\n| Level | Code | Message |\n+---------+------+-----------------------------------------------+\n| Warning | 1292 | Truncated incorrect time value:\n\'-1000:57:33\' |\n+---------+------+-----------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/maketime/','','https://mariadb.com/kb/en/library/maketime/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (493,31,'MICROSECOND','Syntax\n------ \nMICROSECOND(expr)\n \nDescription\n----------- \nReturns the microseconds from the time or datetime\nexpression expr as a number in the range from 0 to 999999.\n \nIf expr is a time with no microseconds, zero is returned,\nwhile if expr is a date with no time, zero with a warning is\nreturned.\n \nExamples\n-------- \nSELECT MICROSECOND(\'12:00:00.123456\');\n+--------------------------------+\n| MICROSECOND(\'12:00:00.123456\') |\n+--------------------------------+\n| 123456 |\n+--------------------------------+\n \nSELECT MICROSECOND(\'2009-12-31 23:59:59.000010\');\n+-------------------------------------------+\n| MICROSECOND(\'2009-12-31 23:59:59.000010\') |\n+-------------------------------------------+\n| 10 |\n+-------------------------------------------+\n \nSELECT MICROSECOND(\'2013-08-07 12:13:14\');\n+------------------------------------+\n| MICROSECOND(\'2013-08-07 12:13:14\') |\n+------------------------------------+\n| 0 |\n+------------------------------------+\n \nSELECT MICROSECOND(\'2013-08-07\');\n+---------------------------+\n| MICROSECOND(\'2013-08-07\') |\n+---------------------------+\n| 0 |\n+---------------------------+\n1 row in set, 1 warning (0.00 sec)\n \nSHOW WARNINGS;\n \n+---------+------+----------------------------------------------+\n| Level | Code | Message |\n+---------+------+----------------------------------------------+\n| Warning | 1292 | Truncated incorrect time value:\n\'2013-08-07\' |\n+---------+------+----------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/microsecond/','','https://mariadb.com/kb/en/library/microsecond/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (494,31,'MINUTE','Syntax\n------ \nMINUTE(time)\n \nDescription\n----------- \nReturns the minute for time, in the range 0 to 59. \n \nExamples\n-------- \nSELECT MINUTE(\'2013-08-03 11:04:03\');\n+-------------------------------+\n| MINUTE(\'2013-08-03 11:04:03\') |\n+-------------------------------+\n| 4 |\n+-------------------------------+\n \n SELECT MINUTE (\'23:12:50\');\n+---------------------+\n| MINUTE (\'23:12:50\') |\n+---------------------+\n| 12 |\n+---------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/minute/','','https://mariadb.com/kb/en/library/minute/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (495,31,'MONTH','Syntax\n------ \nMONTH(date)\n \nDescription\n----------- \nReturns the month for date in the range 1 to 12 for January\nto\nDecember, or 0 for dates such as \'0000-00-00\' or\n\'2008-00-00\' that\nhave a zero month part.\n \nExamples\n-------- \nSELECT MONTH(\'2019-01-03\');\n+---------------------+\n| MONTH(\'2019-01-03\') |\n+---------------------+\n| 1 |\n+---------------------+\n \nSELECT MONTH(\'2019-00-03\');\n+---------------------+\n| MONTH(\'2019-00-03\') |\n+---------------------+\n| 0 |\n+---------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/month/','','https://mariadb.com/kb/en/library/month/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (496,31,'MONTHNAME','Syntax\n------ \nMONTHNAME(date)\n \nDescription\n----------- \nReturns the full name of the month for date. The language\nused for the name is controlled by the value of the\nlc_time_names system variable. See server locale for more on\nthe supported locales.\n \nExamples\n-------- \nSELECT MONTHNAME(\'2019-02-03\');\n+-------------------------+\n| MONTHNAME(\'2019-02-03\') |\n+-------------------------+\n| February |\n+-------------------------+\n \nChanging the locale:\n \nSET lc_time_names = \'fr_CA\';\n \nSELECT MONTHNAME(\'2019-05-21\');\n+-------------------------+\n| MONTHNAME(\'2019-05-21\') |\n+-------------------------+\n| mai |\n+-------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/monthname/','','https://mariadb.com/kb/en/library/monthname/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (497,31,'NOW','Syntax\n------ \nNOW([precision])\nCURRENT_TIMESTAMP\nCURRENT_TIMESTAMP([precision])\nLOCALTIME, LOCALTIME([precision])\nLOCALTIMESTAMP\nLOCALTIMESTAMP([precision])\n \nDescription\n----------- \nReturns the current date and time as a value in \'YYYY-MM-DD\nHH:MM:SS\'\nor YYYYMMDDHHMMSS.uuuuuu format, depending on whether the\nfunction is\nused in a string or numeric context. The value is expressed\nin the\ncurrent time zone.\n \nThe optional precision determines the microsecond precision.\nSee Microseconds in MariaDB.\n \nNOW() (or its synonyms) can be used as the default value for\nTIMESTAMP columns as well as, since MariaDB 10.0.1, DATETIME\ncolumns. Before MariaDB 10.0.1, it was only possible for a\nsingle TIMESTAMP column per table to contain the\nCURRENT_TIMESTAMP as its default.\n \nWhen displayed in the INFORMATION_SCHEMA.COLUMNS table, a\ndefault CURRENT TIMESTAMP is displayed as CURRENT_TIMESTAMP\nup until MariaDB 10.2.2, and as current_timestamp() from\nMariaDB 10.2.3, due to to MariaDB 10.2 accepting expressions\nin the DEFAULT clause.\n \nExamples\n-------- \nSELECT NOW();\n+---------------------+\n| NOW() |\n+---------------------+\n| 2010-03-27 13:13:25 |\n+---------------------+\n \nSELECT NOW() + 0;\n \n+-----------------------+\n| NOW() + 0 |\n+-----------------------+\n| 20100327131329.000000 |\n+-----------------------+\n \nWith precision:\n \nSELECT CURRENT_TIMESTAMP(2);\n+------------------------+\n| CURRENT_TIMESTAMP(2) |\n+------------------------+\n| 2018-07-10 09:47:26.24 |\n+------------------------+\n \nUsed as a default TIMESTAMP:\n \nCREATE TABLE t (createdTS TIMESTAMP NOT NULL DEFAULT\nCURRENT_TIMESTAMP);\n \nFrom MariaDB 10.2.2:\n \nSELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE\nTABLE_SCHEMA=\'test\'\n AND COLUMN_NAME LIKE \'%ts%\'\\G\n*************************** 1. row\n***************************\n TABLE_CATALOG: def\n TABLE_SCHEMA: test\n TABLE_NAME: t\n COLUMN_NAME: ts\n ORDINAL_POSITION: 1\n COLUMN_DEFAULT: current_timestamp()\n...\n \n\n\nURL: https://mariadb.com/kb/en/library/now/','','https://mariadb.com/kb/en/library/now/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (498,31,'PERIOD_ADD','Syntax\n------ \nPERIOD_ADD(P,N)\n \nDescription\n----------- \nAdds N months to period P. P is in the format YYMM or\nYYYYMM, and is not a date value. If P contains a two-digit\nyear, values from 00 to 69 are converted to from 2000 to\n2069, while values from 70 are converted to 1970 upwards.\n \nReturns a value in the format YYYYMM.\n \nExamples\n-------- \nSELECT PERIOD_ADD(200801,2);\n+----------------------+\n| PERIOD_ADD(200801,2) |\n+----------------------+\n| 200803 |\n+----------------------+\n \nSELECT PERIOD_ADD(6910,2);\n+--------------------+\n| PERIOD_ADD(6910,2) |\n+--------------------+\n| 206912 |\n+--------------------+\n \nSELECT PERIOD_ADD(7010,2);\n+--------------------+\n| PERIOD_ADD(7010,2) |\n+--------------------+\n| 197012 |\n+--------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/period_add/','','https://mariadb.com/kb/en/library/period_add/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (499,31,'PERIOD_DIFF','Syntax\n------ \nPERIOD_DIFF(P1,P2)\n \nDescription\n----------- \nReturns the number of months between periods P1 and P2. P1\nand P2 \ncan be in the format YYMM or YYYYMM, and are not date\nvalues.\n \nIf P1 or P2 contains a two-digit year, values from 00 to 69\nare converted to from 2000 to 2069, while values from 70 are\nconverted to 1970 upwards.\n \nExamples\n-------- \nSELECT PERIOD_DIFF(200802,200703);\n+----------------------------+\n| PERIOD_DIFF(200802,200703) |\n+----------------------------+\n| 11 |\n+----------------------------+\n \nSELECT PERIOD_DIFF(6902,6803);\n+------------------------+\n| PERIOD_DIFF(6902,6803) |\n+------------------------+\n| 11 |\n+------------------------+\n \nSELECT PERIOD_DIFF(7002,6803);\n+------------------------+\n| PERIOD_DIFF(7002,6803) |\n+------------------------+\n| -1177 |\n+------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/period_diff/','','https://mariadb.com/kb/en/library/period_diff/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (500,31,'QUARTER','Syntax\n------ \nQUARTER(date)\n \nDescription\n----------- \nReturns the quarter of the year for date, in the range 1 to\n4. Returns 0 if month contains a zero value, or NULL if the\ngiven value is not otherwise a valid date (zero values are\naccepted).\n \nExamples\n-------- \nSELECT QUARTER(\'2008-04-01\');\n+-----------------------+\n| QUARTER(\'2008-04-01\') |\n+-----------------------+\n| 2 |\n+-----------------------+\n \nSELECT QUARTER(\'2019-00-01\');\n+-----------------------+\n| QUARTER(\'2019-00-01\') |\n+-----------------------+\n| 0 |\n+-----------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/quarter/','','https://mariadb.com/kb/en/library/quarter/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (501,31,'SECOND','Syntax\n------ \nSECOND(time)\n \nDescription\n----------- \nReturns the second for a given time (which can include\nmicroseconds), in the range 0 to 59, or NULL if not given a\nvalid time value.\n \nExamples\n-------- \nSELECT SECOND(\'10:05:03\');\n+--------------------+\n| SECOND(\'10:05:03\') |\n+--------------------+\n| 3 |\n+--------------------+\n \nSELECT SECOND(\'10:05:01.999999\');\n+---------------------------+\n| SECOND(\'10:05:01.999999\') |\n+---------------------------+\n| 1 |\n+---------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/second/','','https://mariadb.com/kb/en/library/second/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (502,31,'SEC_TO_TIME','Syntax\n------ \nSEC_TO_TIME(seconds)\n \nDescription\n----------- \nReturns the seconds argument, converted to hours, minutes,\nand\nseconds, as a TIME value. The range of the result is\nconstrained to\nthat of the TIME data type. A warning occurs if the argument\ncorresponds to a value outside that range.\n \nThe time will be returned in the format hh:mm:ss, or hhmmss\nif used in a numeric calculation.\n \nExamples\n-------- \nSELECT SEC_TO_TIME(12414);\n+--------------------+\n| SEC_TO_TIME(12414) |\n+--------------------+\n| 03:26:54 |\n+--------------------+\n \nSELECT SEC_TO_TIME(12414)+0;\n \n+----------------------+\n| SEC_TO_TIME(12414)+0 |\n+----------------------+\n| 32654 |\n+----------------------+\n \nSELECT SEC_TO_TIME(9999999);\n+----------------------+\n| SEC_TO_TIME(9999999) |\n+----------------------+\n| 838:59:59 |\n+----------------------+\n1 row in set, 1 warning (0.00 sec)\n \nSHOW WARNINGS;\n \n+---------+------+-------------------------------------------+\n| Level | Code | Message |\n+---------+------+-------------------------------------------+\n| Warning | 1292 | Truncated incorrect time value:\n\'9999999\' |\n+---------+------+-------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/sec_to_time/','','https://mariadb.com/kb/en/library/sec_to_time/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (503,31,'STR_TO_DATE','Syntax\n------ \nSTR_TO_DATE(str,format)\n \nDescription\n----------- \nThis is the inverse of the DATE_FORMAT() function. It takes\na string str and a format string format. STR_TO_DATE()\nreturns a\nDATETIME value if the format string contains both date and\ntime parts, or a\nDATE or TIME value if the string contains only date or time\nparts.\n \nThe date, time, or datetime values contained in str should\nbe given in the format indicated by format. If str contains\nan illegal date, time, or datetime value, STR_TO_DATE()\nreturns NULL. An illegal value also produces a warning.\n \nThe options that can be used by STR_TO_DATE(), as well as\nits inverse DATE_FORMAT() and the FROM_UNIXTIME() function,\nare:\n \nOption | Description | \n \n%a | Short weekday name in current locale (Variable\nlc_time_names). | \n \n%b | Short form month name in current locale. For locale\nen_US this is one of:\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov or Dec. | \n \n%c | Month with 1 or 2 digits. | \n \n%D | Day with English suffix \'th\', \'nd\', \'st\' or\n\'rd\'\'. (1st, 2nd, 3rd...). | \n \n%d | Day with 2 digits. | \n \n%e | Day with 1 or 2 digits. | \n \n%f | Sub seconds 6 digits. | \n \n%H | Hour with 2 digits between 00-23. | \n \n%h | Hour with 2 digits between 01-12. | \n \n%I | Hour with 2 digits between 01-12. | \n \n%i | Minute with 2 digits. | \n \n%j | Day of the year (001-366) | \n \n%k | Hour with 1 digits between 0-23. | \n \n%l | Hour with 1 digits between 1-12. | \n \n%M | Full month name in current locale (Variable\nlc_time_names). | \n \n%m | Month with 2 digits. | \n \n%p | AM/PM according to current locale (Variable\nlc_time_names). | \n \n%r | Time in 12 hour format, followed by AM/PM. Short for\n\'%I:%i:%S %p\'. | \n \n%S | Seconds with 2 digits. | \n \n%s | Seconds with 2 digits. | \n \n%T | Time in 24 hour format. Short for \'%H:%i:%S\'. | \n \n%U | Week number (00-53), when first day of the week is\nSunday. | \n \n%u | Week number (00-53), when first day of the week is\nMonday. | \n \n%V | Week number (01-53), when first day of the week is\nSunday. Used with %X. | \n \n%v | Week number (01-53), when first day of the week is\nMonday. Used with %x. | \n \n%W | Full weekday name in current locale (Variable\nlc_time_names). | \n \n%w | Day of the week. 0 = Sunday, 6 = Saturday. | \n \n%X | Year with 4 digits when first day of the week is\nSunday. Used with %V. | \n \n%x | Year with 4 digits when first day of the week is\nMonday. Used with %v. | \n \n%Y | Year with 4 digits. | \n \n%y | Year with 2 digits. | \n \n%# | For str_to_date(), skip all numbers. | \n \n%. | For str_to_date(), skip all punctation characters. | \n \n%@ | For str_to_date(), skip all alpha characters. | \n \n%% | A literal % character. | \n \nExamples\n-------- \nSELECT STR_TO_DATE(\'Wednesday, June 2, 2014\', \'%W, %M %e,\n%Y\');\n+---------------------------------------------------------+\n| STR_TO_DATE(\'Wednesday, June 2, 2014\', \'%W, %M %e,\n%Y\') |\n+---------------------------------------------------------+\n| 2014-06-02 |\n+---------------------------------------------------------+\n \nSELECT STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W,\n%M %e, %Y\');\n+--------------------------------------------------------------+\n| STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W, %M %e,\n%Y\') |\n+--------------------------------------------------------------+\n| NULL |\n+--------------------------------------------------------------+\n1 row in set, 1 warning (0.00 sec)\n \nSHOW WARNINGS;\n \n+---------+------+-----------------------------------------------------------------------------------+\n| Level | Code | Message |\n+---------+------+-----------------------------------------------------------------------------------+\n| Warning | 1411 | Incorrect datetime value:\n\'Wednesday23423, June 2, 2014\' for function str_to_date |\n+---------+------+-----------------------------------------------------------------------------------+\n \nSELECT STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W%#,\n%M %e, %Y\');\n+----------------------------------------------------------------+\n| STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W%#, %M\n%e, %Y\') |\n+----------------------------------------------------------------+\n| 2014-06-02 |\n+----------------------------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/str_to_date/','','https://mariadb.com/kb/en/library/str_to_date/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (504,31,'SUBDATE','Syntax\n------ \nSUBDATE(date,INTERVAL expr unit), SUBDATE(expr,days)\n \nDescription\n----------- \nWhen invoked with the INTERVAL form of the second argument,\nSUBDATE()\nis a synonym for DATE_SUB(). See Date and Time Units for a\ncomplete list of permitted units. \n \nThe second form allows the use of an integer value for days.\nIn such\ncases, it is interpreted as the number of days to be\nsubtracted from\nthe date or datetime expression expr.\n \nExamples\n-------- \nSELECT DATE_SUB(\'2008-01-02\', INTERVAL 31 DAY);\n+-----------------------------------------+\n| DATE_SUB(\'2008-01-02\', INTERVAL 31 DAY) |\n+-----------------------------------------+\n| 2007-12-02 |\n+-----------------------------------------+\n \nSELECT SUBDATE(\'2008-01-02\', INTERVAL 31 DAY);\n+----------------------------------------+\n| SUBDATE(\'2008-01-02\', INTERVAL 31 DAY) |\n+----------------------------------------+\n| 2007-12-02 |\n+----------------------------------------+\n \nSELECT SUBDATE(\'2008-01-02 12:00:00\', 31);\n+------------------------------------+\n| SUBDATE(\'2008-01-02 12:00:00\', 31) |\n+------------------------------------+\n| 2007-12-02 12:00:00 |\n+------------------------------------+\n \nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n (\"2007-01-30 21:31:07\"),\n (\"1983-10-15 06:42:51\"),\n (\"2011-04-21 12:34:56\"),\n (\"2011-10-30 06:31:41\"),\n (\"2011-01-30 14:03:25\"),\n (\"2004-10-07 11:19:34\");\n \nSELECT d, SUBDATE(d, 10) from t1;\n \n+---------------------+---------------------+\n| d | SUBDATE(d, 10) |\n+---------------------+---------------------+\n| 2007-01-30 21:31:07 | 2007-01-20 21:31:07 |\n| 1983-10-15 06:42:51 | 1983-10-05 06:42:51 |\n| 2011-04-21 12:34:56 | 2011-04-11 12:34:56 |\n| 2011-10-30 06:31:41 | 2011-10-20 06:31:41 |\n| 2011-01-30 14:03:25 | 2011-01-20 14:03:25 |\n| 2004-10-07 11:19:34 | 2004-09-27 11:19:34 |\n+---------------------+---------------------+\n \nSELECT d, SUBDATE(d, INTERVAL 10 MINUTE) from t1;\n \n+---------------------+--------------------------------+\n| d | SUBDATE(d, INTERVAL 10 MINUTE) |\n+---------------------+--------------------------------+\n| 2007-01-30 21:31:07 | 2007-01-30 21:21:07 |\n| 1983-10-15 06:42:51 | 1983-10-15 06:32:51 |\n| 2011-04-21 12:34:56 | 2011-04-21 12:24:56 |\n| 2011-10-30 06:31:41 | 2011-10-30 06:21:41 |\n| 2011-01-30 14:03:25 | 2011-01-30 13:53:25 |\n| 2004-10-07 11:19:34 | 2004-10-07 11:09:34 |\n+---------------------+--------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/subdate/','','https://mariadb.com/kb/en/library/subdate/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (505,31,'SUBTIME','Syntax\n------ \nSUBTIME(expr1,expr2)\n \nDescription\n----------- \nSUBTIME() returns expr1 - expr2 expressed as a value in the\nsame\nformat as expr1. expr1 is a time or datetime expression, and\nexpr2 is\na time expression.\n \nExamples\n-------- \nSELECT SUBTIME(\'2007-12-31 23:59:59.999999\',\'1\n1:1:1.000002\');\n+--------------------------------------------------------+\n| SUBTIME(\'2007-12-31 23:59:59.999999\',\'1 1:1:1.000002\')\n|\n+--------------------------------------------------------+\n| 2007-12-30 22:58:58.999997 |\n+--------------------------------------------------------+\n \nSELECT SUBTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n+-----------------------------------------------+\n| SUBTIME(\'01:00:00.999999\', \'02:00:00.999998\') |\n+-----------------------------------------------+\n| -00:59:59.999999 |\n+-----------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/subtime/','','https://mariadb.com/kb/en/library/subtime/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (506,31,'SYSDATE','Syntax\n------ \nSYSDATE([precision])\n \nDescription\n----------- \nReturns the current date and time as a value in \'YYYY-MM-DD\nHH:MM:SS\'\nor YYYYMMDDHHMMSS.uuuuuu format, depending on whether the\nfunction is\nused in a string or numeric context.\n \nThe optional precision determines the microsecond precision.\nSee Microseconds in MariaDB.\n \nSYSDATE() returns the time at which it executes. This\ndiffers from the\nbehavior for NOW(), which returns a constant time that\nindicates the\ntime at which the statement began to execute. (Within a\nstored routine\nor trigger, NOW() returns the time at which the routine or\ntriggering\nstatement began to execute.)\n \nIn addition, changing the timestamp system variable with a\nSET timestamp statement affects the value returned by\nNOW() but not by SYSDATE(). This means that timestamp\nsettings in the\nbinary log have no effect on invocations of SYSDATE().\n \nBecause SYSDATE() can return different values even within\nthe same\nstatement, and is not affected by SET TIMESTAMP, it is\nnon-deterministic and therefore unsafe for replication if\nstatement-based binary logging is used. If that is a\nproblem, you can\nuse row-based logging, or start the server with the mysqld\noption --sysdate-is-now to cause SYSDATE() to be an alias\nfor NOW(). The non-deterministic nature of SYSDATE() also\nmeans that indexes cannot be used for evaluating expressions\nthat refer to it, and that statements using the SYSDATE()\nfunction are unsafe for statement-based replication.\n \nExamples\n-------- \nDifference between NOW() and SYSDATE():\n \nSELECT NOW(), SLEEP(2), NOW();\n+---------------------+----------+---------------------+\n| NOW() | SLEEP(2) | NOW() |\n+---------------------+----------+---------------------+\n| 2010-03-27 13:23:40 | 0 | 2010-03-27 13:23:40 |\n+---------------------+----------+---------------------+\n \nSELECT SYSDATE(), SLEEP(2), SYSDATE();\n+---------------------+----------+---------------------+\n| SYSDATE() | SLEEP(2) | SYSDATE() |\n+---------------------+----------+---------------------+\n| 2010-03-27 13:23:52 | 0 | 2010-03-27 13:23:54 |\n+---------------------+----------+---------------------+\n \nWith precision:\n \nSELECT SYSDATE(4);\n+--------------------------+\n| SYSDATE(4) |\n+--------------------------+\n| 2018-07-10 10:17:13.1689 |\n+--------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/sysdate/','','https://mariadb.com/kb/en/library/sysdate/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (507,31,'TIME Function','Syntax\n------ \nTIME(expr)\n \nDescription\n----------- \nExtracts the time part of the time or datetime expression\nexpr and\nreturns it as a string.\n \nExamples\n-------- \nSELECT TIME(\'2003-12-31 01:02:03\');\n+-----------------------------+\n| TIME(\'2003-12-31 01:02:03\') |\n+-----------------------------+\n| 01:02:03 |\n+-----------------------------+\n \nSELECT TIME(\'2003-12-31 01:02:03.000123\');\n+------------------------------------+\n| TIME(\'2003-12-31 01:02:03.000123\') |\n+------------------------------------+\n| 01:02:03.000123 |\n+------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/time-function/','','https://mariadb.com/kb/en/library/time-function/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (508,31,'TIMEDIFF','Syntax\n------ \nTIMEDIFF(expr1,expr2)\n \nDescription\n----------- \nTIMEDIFF() returns expr1 - expr2 expressed as a time value.\nexpr1 and\nexpr2 are time or date-and-time expressions, but both must\nbe of the\nsame type.\n \nExamples\n-------- \nSELECT TIMEDIFF(\'2000:01:01 00:00:00\', \'2000:01:01\n00:00:00.000001\');\n+---------------------------------------------------------------+\n| TIMEDIFF(\'2000:01:01 00:00:00\', \'2000:01:01\n00:00:00.000001\') |\n+---------------------------------------------------------------+\n| -00:00:00.000001 |\n+---------------------------------------------------------------+\n \nSELECT TIMEDIFF(\'2008-12-31 23:59:59.000001\', \'2008-12-30\n01:01:01.000002\');\n+----------------------------------------------------------------------+\n| TIMEDIFF(\'2008-12-31 23:59:59.000001\', \'2008-12-30\n01:01:01.000002\') |\n+----------------------------------------------------------------------+\n| 46:58:57.999999 |\n+----------------------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/timediff/','','https://mariadb.com/kb/en/library/timediff/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (509,31,'TIMESTAMP FUNCTION','Syntax\n------ \nTIMESTAMP(expr), TIMESTAMP(expr1,expr2)\n \nDescription\n----------- \nWith a single argument, this function returns the date or\ndatetime\nexpression expr as a datetime value. With two arguments, it\nadds the\ntime expression expr2 to the date or datetime expression\nexpr1 and\nreturns the result as a datetime value.\n \nExamples\n-------- \nSELECT TIMESTAMP(\'2003-12-31\');\n+-------------------------+\n| TIMESTAMP(\'2003-12-31\') |\n+-------------------------+\n| 2003-12-31 00:00:00 |\n+-------------------------+\n \nSELECT TIMESTAMP(\'2003-12-31 12:00:00\',\'6:30:00\');\n+--------------------------------------------+\n| TIMESTAMP(\'2003-12-31 12:00:00\',\'6:30:00\') |\n+--------------------------------------------+\n| 2003-12-31 18:30:00 |\n+--------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/timestamp-function/','','https://mariadb.com/kb/en/library/timestamp-function/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (510,31,'TIMESTAMPADD','Syntax\n------ \nTIMESTAMPADD(unit,interval,datetime_expr)\n \nDescription\n----------- \nAdds the integer expression interval to the date or datetime\nexpression datetime_expr. The unit for interval is given by\nthe unit\nargument, which should be one of the following values:\nMICROSECOND, SECOND, MINUTE, HOUR, DAY, WEEK, MONTH,\nQUARTER, or YEAR.\n \nThe unit value may be specified using one of keywords as\nshown, or\nwith a prefix of SQL_TSI_. For example, DAY and SQL_TSI_DAY\nboth are\nlegal.\n \nBefore MariaDB 5.5, FRAC_SECOND was permitted as a synonym\nfor MICROSECOND.\n \nExamples\n-------- \nSELECT TIMESTAMPADD(MINUTE,1,\'2003-01-02\');\n+-------------------------------------+\n| TIMESTAMPADD(MINUTE,1,\'2003-01-02\') |\n+-------------------------------------+\n| 2003-01-02 00:01:00 |\n+-------------------------------------+\n \nSELECT TIMESTAMPADD(WEEK,1,\'2003-01-02\');\n+-----------------------------------+\n| TIMESTAMPADD(WEEK,1,\'2003-01-02\') |\n+-----------------------------------+\n| 2003-01-09 |\n+-----------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/timestampadd/','','https://mariadb.com/kb/en/library/timestampadd/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (511,31,'TIMESTAMPDIFF','Syntax\n------ \nTIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2)\n \nDescription\n----------- \nReturns datetime_expr2 - datetime_expr1, where\ndatetime_expr1 and\ndatetime_expr2 are date or datetime expressions. One\nexpression may be\na date and the other a datetime; a date value is treated as\na datetime\nhaving the time part \'00:00:00\' where necessary. The unit\nfor the\nresult (an integer) is given by the unit argument. The legal\nvalues\nfor unit are the same as those listed in the description of\nthe\nTIMESTAMPADD() function, i.e MICROSECOND, SECOND, MINUTE,\nHOUR, DAY, WEEK, MONTH, QUARTER, or YEAR.\n \nTIMESTAMPDIFF can also be used to calculate age.\n \nExamples\n-------- \nSELECT TIMESTAMPDIFF(MONTH,\'2003-02-01\',\'2003-05-01\');\n+------------------------------------------------+\n| TIMESTAMPDIFF(MONTH,\'2003-02-01\',\'2003-05-01\') |\n+------------------------------------------------+\n| 3 |\n+------------------------------------------------+\n \nSELECT TIMESTAMPDIFF(YEAR,\'2002-05-01\',\'2001-01-01\');\n+-----------------------------------------------+\n| TIMESTAMPDIFF(YEAR,\'2002-05-01\',\'2001-01-01\') |\n+-----------------------------------------------+\n| -1 |\n+-----------------------------------------------+\n \nSELECT TIMESTAMPDIFF(MINUTE,\'2003-02-01\',\'2003-05-01\n12:05:55\');\n+----------------------------------------------------------+\n| TIMESTAMPDIFF(MINUTE,\'2003-02-01\',\'2003-05-01\n12:05:55\') |\n+----------------------------------------------------------+\n| 128885 |\n+----------------------------------------------------------+\n \nCalculating age:\n \nSELECT CURDATE();\n+------------+\n| CURDATE() |\n+------------+\n| 2019-05-27 |\n+------------+\n \nSELECT TIMESTAMPDIFF(YEAR, \'1971-06-06\', CURDATE()) AS\nage;\n \n+------+\n| age |\n+------+\n| 47 |\n+------+\n \nSELECT TIMESTAMPDIFF(YEAR, \'1971-05-06\', CURDATE()) AS\nage;\n \n+------+\n| age |\n+------+\n| 48 |\n+------+\n \nAge as of 2014-08-02:\n \nSELECT name, date_of_birth,\nTIMESTAMPDIFF(YEAR,date_of_birth,\'2014-08-02\') AS age \n FROM student_details;\n \n+---------+---------------+------+\n| name | date_of_birth | age |\n+---------+---------------+------+\n| Chun | 1993-12-31 | 20 |\n| Esben | 1946-01-01 | 68 |\n| Kaolin | 1996-07-16 | 18 |\n| Tatiana | 1988-04-13 | 26 |\n+---------+---------------+------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/timestampdiff/','','https://mariadb.com/kb/en/library/timestampdiff/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (512,31,'TIME_FORMAT','Syntax\n------ \nTIME_FORMAT(time,format)\n \nDescription\n----------- \nThis is used like the DATE_FORMAT() function, but the format\nstring\nmay contain format specifiers only for hours, minutes, and\nseconds.\nOther specifiers produce a NULL value or 0.\n \nExamples\n-------- \nSELECT TIME_FORMAT(\'100:00:00\', \'%H %k %h %I %l\');\n+--------------------------------------------+\n| TIME_FORMAT(\'100:00:00\', \'%H %k %h %I %l\') |\n+--------------------------------------------+\n| 100 100 04 04 4 |\n+--------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/time_format/','','https://mariadb.com/kb/en/library/time_format/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (513,31,'TIME_TO_SEC','Syntax\n------ \nTIME_TO_SEC(time)\n \nDescription\n----------- \nReturns the time argument, converted to seconds.\n \nThe value returned by TIME_TO_SEC is of type DOUBLE. Before\nMariaDB 5.3 (and MySQL 5.6), the type was INT. See\nMicroseconds in MariaDB.\n \nExamples\n-------- \nSELECT TIME_TO_SEC(\'22:23:00\');\n+-------------------------+\n| TIME_TO_SEC(\'22:23:00\') |\n+-------------------------+\n| 80580 |\n+-------------------------+\n \nSELECT TIME_TO_SEC(\'00:39:38\');\n+-------------------------+\n| TIME_TO_SEC(\'00:39:38\') |\n+-------------------------+\n| 2378 |\n+-------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/time_to_sec/','','https://mariadb.com/kb/en/library/time_to_sec/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (514,31,'TO_DAYS','Syntax\n------ \nTO_DAYS(date)\n \nDescription\n----------- \nGiven a date date, returns the number of days since the\nstart of the current calendar (0000-00-00).\n \nThe function is not designed for use with dates before the\nadvent of the Gregorian calendar in October 1582. Results\nwill not be reliable since it doesn\'t account for the lost\ndays when the calendar changed from the Julian calendar.\n \nThis is the converse of the FROM_DAYS() function.\n \nExamples\n-------- \nSELECT TO_DAYS(\'2007-10-07\');\n+-----------------------+\n| TO_DAYS(\'2007-10-07\') |\n+-----------------------+\n| 733321 |\n+-----------------------+\n \nSELECT TO_DAYS(\'0000-01-01\');\n+-----------------------+\n| TO_DAYS(\'0000-01-01\') |\n+-----------------------+\n| 1 |\n+-----------------------+\n \nSELECT TO_DAYS(950501);\n+-----------------+\n| TO_DAYS(950501) |\n+-----------------+\n| 728779 |\n+-----------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/to_days/','','https://mariadb.com/kb/en/library/to_days/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (515,31,'TO_SECONDS','Syntax\n------ \nTO_SECONDS(expr)\n \nDescription\n----------- \nReturns the number of seconds from year 0 till expr, or NULL\nif expr is not a valid date or datetime.\n \nExamples\n-------- \nSELECT TO_SECONDS(\'2013-06-13\');\n+--------------------------+\n| TO_SECONDS(\'2013-06-13\') |\n+--------------------------+\n| 63538300800 |\n+--------------------------+\n \nSELECT TO_SECONDS(\'2013-06-13 21:45:13\');\n+-----------------------------------+\n| TO_SECONDS(\'2013-06-13 21:45:13\') |\n+-----------------------------------+\n| 63538379113 |\n+-----------------------------------+\n \nSELECT TO_SECONDS(NOW());\n+-------------------+\n| TO_SECONDS(NOW()) |\n+-------------------+\n| 63543530875 |\n+-------------------+\n \nSELECT TO_SECONDS(20130513);\n+----------------------+\n| TO_SECONDS(20130513) |\n+----------------------+\n| 63535622400 |\n+----------------------+\n1 row in set (0.00 sec)\n \nSELECT TO_SECONDS(130513);\n+--------------------+\n| TO_SECONDS(130513) |\n+--------------------+\n| 63535622400 |\n+--------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/to_seconds/','','https://mariadb.com/kb/en/library/to_seconds/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (516,31,'UNIX_TIMESTAMP','Syntax\n------ \nUNIX_TIMESTAMP()\nUNIX_TIMESTAMP(date)\n \nDescription\n----------- \nIf called with no argument, returns a Unix timestamp\n(seconds since\n\'1970-01-01 00:00:00\' UTC) as an unsigned integer. If\nUNIX_TIMESTAMP()\nis called with a date argument, it returns the value of the\nargument as seconds\nsince \'1970-01-01 00:00:00\' UTC. date may be a DATE\nstring, a\nDATETIME string, a TIMESTAMP, or a number in\nthe format YYMMDD or YYYYMMDD. The server interprets date as\na value in the\ncurrent time zone and converts it to an internal value in\nUTC. Clients can set\ntheir time zone as described in time zones.\n \nThe inverse function of UNIX_TIMESTAMP() is FROM_UNIXTIME()\n \nUNIX_TIMESTAMP() supports microseconds.\n \nTimestamps in MariaDB have a maximum value of 2147483647,\nequivalent to 2038-01-19 05:14:07. This is due to the\nunderlying 32-bit limitation. Using the function on a date\nbeyond this will result in NULL being returned. Use DATETIME\nas a storage type if you require dates beyond this.\n \nError Handling\n \nReturns NULL for wrong arguments to UNIX_TIMESTAMP(). In\nMySQL and MariaDB before 5.3 wrong arguments to\nUNIX_TIMESTAMP() returned 0. \n \nCompatibility\n \nAs you can see in the examples above,\nUNIX_TIMESTAMP(constant-date-string) returns a timestamp\nwith 6 decimals while MariaDB 5.2 and before returns it\nwithout decimals. This can cause a problem if you are using\nUNIX_TIMESTAMP() as a partitioning function. You can fix\nthis by using FLOOR(UNIX_TIMESTAMP(..)) or changing the date\nstring to a date number, like 20080101000000. \n \nExamples\n-------- \nSELECT UNIX_TIMESTAMP();\n+------------------+\n| UNIX_TIMESTAMP() |\n+------------------+\n| 1269711082 |\n+------------------+\n \nSELECT UNIX_TIMESTAMP(\'2007-11-30 10:30:19\');\n+---------------------------------------+\n| UNIX_TIMESTAMP(\'2007-11-30 10:30:19\') |\n+---------------------------------------+\n| 1196436619.000000 |\n+---------------------------------------+\n \nSELECT UNIX_TIMESTAMP(\"2007-11-30 10:30:19.123456\");\n+----------------------------------------------+\n| unix_timestamp(\"2007-11-30 10:30:19.123456\") |\n+----------------------------------------------+\n| 1196411419.123456 |\n+----------------------------------------------+\n \nSELECT FROM_UNIXTIME(UNIX_TIMESTAMP(\'2007-11-30\n10:30:19\'));\n+------------------------------------------------------+\n| FROM_UNIXTIME(UNIX_TIMESTAMP(\'2007-11-30 10:30:19\')) |\n+------------------------------------------------------+\n| 2007-11-30 10:30:19.000000 |\n+------------------------------------------------------+\n \nSELECT FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(\'2007-11-30\n10:30:19\')));\n+-------------------------------------------------------------+\n| FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(\'2007-11-30\n10:30:19\'))) |\n+-------------------------------------------------------------+\n| 2007-11-30 10:30:19 |\n+-------------------------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/unix_timestamp/','','https://mariadb.com/kb/en/library/unix_timestamp/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (517,31,'UTC_DATE','Syntax\n------ \nUTC_DATE, UTC_DATE()\n \nDescription\n----------- \nReturns the current UTC date as a value in \'YYYY-MM-DD\' or\nYYYYMMDD\nformat, depending on whether the function is used in a\nstring or numeric context. \n \nExamples\n-------- \nSELECT UTC_DATE(), UTC_DATE() + 0;\n \n+------------+----------------+\n| UTC_DATE() | UTC_DATE() + 0 |\n+------------+----------------+\n| 2010-03-27 | 20100327 |\n+------------+----------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/utc_date/','','https://mariadb.com/kb/en/library/utc_date/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (518,31,'UTC_TIME','Syntax\n------ \nUTC_TIME\nUTC_TIME([precision])\n \nDescription\n----------- \nReturns the current UTC time as a value in \'HH:MM:SS\' or\nHHMMSS.uuuuuu format, depending on whether the function is\nused in a string or numeric context. \n \nThe optional precision determines the microsecond precision.\nSee Microseconds in MariaDB.\n \nExamples\n-------- \nSELECT UTC_TIME(), UTC_TIME() + 0;\n \n+------------+----------------+\n| UTC_TIME() | UTC_TIME() + 0 |\n+------------+----------------+\n| 17:32:34 | 173234.000000 |\n+------------+----------------+\n \nWith precision:\n \nSELECT UTC_TIME(5);\n+----------------+\n| UTC_TIME(5) |\n+----------------+\n| 07:52:50.78369 |\n+----------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/utc_time/','','https://mariadb.com/kb/en/library/utc_time/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (519,31,'UTC_TIMESTAMP','Syntax\n------ \nUTC_TIMESTAMP\nUTC_TIMESTAMP([precision])\n \nDescription\n----------- \nReturns the current UTC date and time as a value in\n\'YYYY-MM-DD\nHH:MM:SS\' or YYYYMMDDHHMMSS.uuuuuu format, depending on\nwhether the\nfunction is used in a string or numeric context.\n \nThe optional precision determines the microsecond precision.\nSee Microseconds in MariaDB.\n \nExamples\n-------- \nSELECT UTC_TIMESTAMP(), UTC_TIMESTAMP() + 0;\n \n+---------------------+-----------------------+\n| UTC_TIMESTAMP() | UTC_TIMESTAMP() + 0 |\n+---------------------+-----------------------+\n| 2010-03-27 17:33:16 | 20100327173316.000000 |\n+---------------------+-----------------------+\n \nWith precision:\n \nSELECT UTC_TIMESTAMP(4);\n+--------------------------+\n| UTC_TIMESTAMP(4) |\n+--------------------------+\n| 2018-07-10 07:51:09.1019 |\n+--------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/utc_timestamp/','','https://mariadb.com/kb/en/library/utc_timestamp/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (520,31,'WEEK','Syntax\n------ \nWEEK(date[,mode])\n \nDescription\n----------- \nThis function returns the week number for date. The\ntwo-argument form of\nWEEK() allows you to specify whether the week starts on\nSunday or Monday\nand whether the return value should be in the range from 0\nto 53 or from 1 to\n53. If the mode argument is omitted, the value of the\ndefault_week_format system variable is used.\n \nModes\n \nMode | 1st day of week | Range | Week 1 is the 1st week with\n| \n \n0 | Sunday | 0-53 | a Sunday in this year | \n \n1 | Monday | 0-53 | more than 3 days this year | \n \n2 | Sunday | 1-53 | a Sunday in this year | \n \n3 | Monday | 1-53 | more than 3 days this year | \n \n4 | Sunday | 0-53 | more than 3 days this year | \n \n5 | Monday | 0-53 | a Monday in this year | \n \n6 | Sunday | 1-53 | more than 3 days this year | \n \n7 | Monday | 1-53 | a Monday in this year | \n \nExamples\n-------- \nSELECT WEEK(\'2008-02-20\');\n+--------------------+\n| WEEK(\'2008-02-20\') |\n+--------------------+\n| 7 |\n+--------------------+\n \nSELECT WEEK(\'2008-02-20\',0);\n+----------------------+\n| WEEK(\'2008-02-20\',0) |\n+----------------------+\n| 7 |\n+----------------------+\n \nSELECT WEEK(\'2008-02-20\',1);\n+----------------------+\n| WEEK(\'2008-02-20\',1) |\n+----------------------+\n| 8 |\n+----------------------+\n \nSELECT WEEK(\'2008-12-31\',0);\n+----------------------+\n| WEEK(\'2008-12-31\',0) |\n+----------------------+\n| 52 |\n+----------------------+\n \nSELECT WEEK(\'2008-12-31\',1);\n+----------------------+\n| WEEK(\'2008-12-31\',1) |\n+----------------------+\n| 53 |\n+----------------------+\n \nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n (\"2007-01-30 21:31:07\"),\n (\"1983-10-15 06:42:51\"),\n (\"2011-04-21 12:34:56\"),\n (\"2011-10-30 06:31:41\"),\n (\"2011-01-30 14:03:25\"),\n (\"2004-10-07 11:19:34\");\n \nSELECT d, WEEK(d,0), WEEK(d,1) from t1;\n \n+---------------------+-----------+-----------+\n| d | WEEK(d,0) | WEEK(d,1) |\n+---------------------+-----------+-----------+\n| 2007-01-30 21:31:07 | 4 | 5 |\n| 1983-10-15 06:42:51 | 41 | 41 |\n| 2011-04-21 12:34:56 | 16 | 16 |\n| 2011-10-30 06:31:41 | 44 | 43 |\n| 2011-01-30 14:03:25 | 5 | 4 |\n| 2004-10-07 11:19:34 | 40 | 41 |\n+---------------------+-----------+-----------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/week/','','https://mariadb.com/kb/en/library/week/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (521,31,'WEEKDAY','Syntax\n------ \nWEEKDAY(date)\n \nDescription\n----------- \nReturns the weekday index for date \n(0 = Monday, 1 = Tuesday, ... 6 = Sunday).\n \nThis contrasts with DAYOFWEEK() which follows the ODBC\nstandard\n(1 = Sunday, 2 = Monday, ..., 7 = Saturday).\n \nExamples\n-------- \nSELECT WEEKDAY(\'2008-02-03 22:23:00\');\n+--------------------------------+\n| WEEKDAY(\'2008-02-03 22:23:00\') |\n+--------------------------------+\n| 6 |\n+--------------------------------+\n \nSELECT WEEKDAY(\'2007-11-06\');\n+-----------------------+\n| WEEKDAY(\'2007-11-06\') |\n+-----------------------+\n| 1 |\n+-----------------------+\n \nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n (\"2007-01-30 21:31:07\"),\n (\"1983-10-15 06:42:51\"),\n (\"2011-04-21 12:34:56\"),\n (\"2011-10-30 06:31:41\"),\n (\"2011-01-30 14:03:25\"),\n (\"2004-10-07 11:19:34\");\n \nSELECT d FROM t1 where WEEKDAY(d) = 6;\n \n+---------------------+\n| d |\n+---------------------+\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n+---------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/weekday/','','https://mariadb.com/kb/en/library/weekday/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (522,31,'WEEKOFYEAR','Syntax\n------ \nWEEKOFYEAR(date)\n \nDescription\n----------- \nReturns the calendar week of the date as a number in the\nrange from 1\nto 53. WEEKOFYEAR() is a compatibility function that is\nequivalent to\nWEEK(date,3).\n \nExamples\n-------- \nSELECT WEEKOFYEAR(\'2008-02-20\');\n+--------------------------+\n| WEEKOFYEAR(\'2008-02-20\') |\n+--------------------------+\n| 8 |\n+--------------------------+\n \nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n (\"2007-01-30 21:31:07\"),\n (\"1983-10-15 06:42:51\"),\n (\"2011-04-21 12:34:56\"),\n (\"2011-10-30 06:31:41\"),\n (\"2011-01-30 14:03:25\"),\n (\"2004-10-07 11:19:34\");\n \n select * from t1;\n \n+---------------------+\n| d |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 1983-10-15 06:42:51 |\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n| 2004-10-07 11:19:34 |\n+---------------------+\n \nSELECT d, WEEKOFYEAR(d), WEEK(d,3) from t1;\n \n+---------------------+---------------+-----------+\n| d | WEEKOFYEAR(d) | WEEK(d,3) |\n+---------------------+---------------+-----------+\n| 2007-01-30 21:31:07 | 5 | 5 |\n| 1983-10-15 06:42:51 | 41 | 41 |\n| 2011-04-21 12:34:56 | 16 | 16 |\n| 2011-10-30 06:31:41 | 43 | 43 |\n| 2011-01-30 14:03:25 | 4 | 4 |\n| 2004-10-07 11:19:34 | 41 | 41 |\n+---------------------+---------------+-----------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/weekofyear/','','https://mariadb.com/kb/en/library/weekofyear/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (523,31,'YEAR','Syntax\n------ \nYEAR(date)\n \nDescription\n----------- \nReturns the year for the given date, in the range 1000 to\n9999, or 0 for the\n\"zero\" date.\n \nExamples\n-------- \nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n (\"2007-01-30 21:31:07\"),\n (\"1983-10-15 06:42:51\"),\n (\"2011-04-21 12:34:56\"),\n (\"2011-10-30 06:31:41\"),\n (\"2011-01-30 14:03:25\"),\n (\"2004-10-07 11:19:34\");\n \nSELECT * FROM t1;\n \n+---------------------+\n| d |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 1983-10-15 06:42:51 |\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n| 2004-10-07 11:19:34 |\n+---------------------+\n \nSELECT * FROM t1 WHERE YEAR(d) = 2011;\n \n+---------------------+\n| d |\n+---------------------+\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n+---------------------+\n \nSELECT YEAR(\'1987-01-01\');\n+--------------------+\n| YEAR(\'1987-01-01\') |\n+--------------------+\n| 1987 |\n+--------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/year/','','https://mariadb.com/kb/en/library/year/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (524,31,'YEARWEEK','Syntax\n------ \nYEARWEEK(date), YEARWEEK(date,mode)\n \nDescription\n----------- \nReturns year and week for a date. The mode argument works\nexactly like the mode\nargument to WEEK(). The year in the result may be different\nfrom the\nyear in the date argument for the first and the last week of\nthe year.\n \nExamples\n-------- \nSELECT YEARWEEK(\'1987-01-01\');\n+------------------------+\n| YEARWEEK(\'1987-01-01\') |\n+------------------------+\n| 198652 |\n+------------------------+\n \nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n (\"2007-01-30 21:31:07\"),\n (\"1983-10-15 06:42:51\"),\n (\"2011-04-21 12:34:56\"),\n (\"2011-10-30 06:31:41\"),\n (\"2011-01-30 14:03:25\"),\n (\"2004-10-07 11:19:34\");\n \nSELECT * FROM t1;\n \n+---------------------+\n| d |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 1983-10-15 06:42:51 |\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n| 2004-10-07 11:19:34 |\n+---------------------+\n6 rows in set (0.02 sec)\n \nSELECT YEARWEEK(d) FROM t1 WHERE YEAR(d) = 2011;\n \n+-------------+\n| YEARWEEK(d) |\n+-------------+\n| 201116 |\n| 201144 |\n| 201105 |\n+-------------+\n3 rows in set (0.03 sec)\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/yearweek/','','https://mariadb.com/kb/en/library/yearweek/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (525,32,'Well-Known Binary (WKB) Format','WKB stands for Well-Known Binary, a format for representing\ngeographical and geometrical data.\n \nWKB uses 1-byte unsigned integers, 4-byte unsigned integers,\nand 8-byte double-precision numbers.\nThe first byte indicates the byte order. 00 for big endian,\nor 01 for little endian.\nThe next 4 bytes indicate the geometry type. Values from 1\nto 7 indicate whether the type is Point, LineString,\nPolygon, MultiPoint, MultiLineString, MultiPolygon, or\nGeometryCollection respectively. \nThe 8-byte floats represent the co-ordinates.\n \nTake the following example, a sequence of 21 bytes each\nrepresented by two hex digits:\n \n000000000140000000000000004010000000000000\nIt\'s big endian\n000000000140000000000000004010000000000000\n \nIt\'s a POINT\n000000000140000000000000004010000000000000\n \nThe X co-ordinate is 2.0\n000000000140000000000000004010000000000000\n \nThe Y-co-ordinate is 4.0\n000000000140000000000000004010000000000000\n \n\n \n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/well-known-binary-wkb-format/','','https://mariadb.com/kb/en/library/well-known-binary-wkb-format/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (526,32,'AsBinary','A synonym for ST_AsBinary().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/wkb-asbinary/','','https://mariadb.com/kb/en/library/wkb-asbinary/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (527,32,'AsWKB','A synonym for ST_AsBinary().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/aswkb/','','https://mariadb.com/kb/en/library/aswkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (528,32,'MLineFromWKB','Syntax\n------ \nMLineFromWKB(wkb[,srid])\nMultiLineStringFromWKB(wkb[,srid])\n \nDescription\n----------- \nConstructs a MULTILINESTRING value using its WKB\nrepresentation and SRID.\n \nMLineFromWKB() and MultiLineStringFromWKB() are synonyms.\n \nExamples\n-------- \nSET @g = ST_AsBinary(MLineFromText(\'MULTILINESTRING((10\n48,10 21,10 0),(16 0,16 23,16 48))\'));\n \nSELECT ST_AsText(MLineFromWKB(@g));\n+--------------------------------------------------------+\n| ST_AsText(MLineFromWKB(@g)) |\n+--------------------------------------------------------+\n| MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) |\n+--------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mlinefromwkb/','','https://mariadb.com/kb/en/library/mlinefromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (529,32,'MPointFromWKB','Syntax\n------ \nMPointFromWKB(wkb[,srid])\nMultiPointFromWKB(wkb[,srid])\n \nDescription\n----------- \nConstructs a MULTIPOINT value using its WKB representation\nand SRID.\n \nMPointFromWKB() and MultiPointFromWKB() are synonyms.\n \nExamples\n-------- \nSET @g = ST_AsBinary(MPointFromText(\'MultiPoint( 1 1, 2 2,\n5 3, 7 2, 9 3, 8 4, 6 6, 6 9, 4 9, 1 5 )\'));\n \nSELECT ST_AsText(MPointFromWKB(@g));\n+-----------------------------------------------------+\n| ST_AsText(MPointFromWKB(@g)) |\n+-----------------------------------------------------+\n| MULTIPOINT(1 1,2 2,5 3,7 2,9 3,8 4,6 6,6 9,4 9,1 5) |\n+-----------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mpointfromwkb/','','https://mariadb.com/kb/en/library/mpointfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (530,32,'MPolyFromWKB','Syntax\n------ \nMPolyFromWKB(wkb[,srid])\nMultiPolygonFromWKB(wkb[,srid])\n \nDescription\n----------- \nConstructs a MULTIPOLYGON value using its WKB representation\nand SRID.\n \nMPolyFromWKB() and MultiPolygonFromWKB() are synonyms.\n \nExamples\n-------- \nSET @g = ST_AsBinary(MPointFromText(\'MULTIPOLYGON(((28\n26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52\n18)),((59 18,67 18,67 13,59 13,59 18)))\'));\n \nSELECT ST_AsText(MPolyFromWKB(@g));\n+---------------------------------------------------------------------------------------------------------------+\n| ST_AsText(MPolyFromWKB(@g)) |\n+---------------------------------------------------------------------------------------------------------------+\n| MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66\n23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) |\n+---------------------------------------------------------------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mpolyfromwkb/','','https://mariadb.com/kb/en/library/mpolyfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (531,32,'GeomCollFromWKB','A synonym for ST_GeomCollFromWKB.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/wkb-geomcollfromwkb/','','https://mariadb.com/kb/en/library/wkb-geomcollfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (532,32,'GeometryCollectionFromWKB','A synonym for ST_GeomCollFromWKB.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/geometrycollectionfromwkb/','','https://mariadb.com/kb/en/library/geometrycollectionfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (533,32,'GeometryFromWKB','A synonym for ST_GeomFromWKB.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/geometryfromwkb/','','https://mariadb.com/kb/en/library/geometryfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (534,32,'GeomFromWKB','A synonym for ST_GeomFromWKB.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/wkb-geomfromwkb/','','https://mariadb.com/kb/en/library/wkb-geomfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (535,32,'LineFromWKB','A synonym for ST_LineFromWKB.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/wkb-linefromwkb/','','https://mariadb.com/kb/en/library/wkb-linefromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (536,32,'LineStringFromWKB','A synonym for ST_LineFromWKB.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/linestringfromwkb/','','https://mariadb.com/kb/en/library/linestringfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (537,32,'MultiLineStringFromWKB','A synonym for MLineFromWKB().\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/multilinestringfromwkb/','','https://mariadb.com/kb/en/library/multilinestringfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (538,32,'MultiPointFromWKB','A synonym for MPointFromWKB.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/multipointfromwkb/','','https://mariadb.com/kb/en/library/multipointfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (539,32,'MultiPolygonFromWKB','Synonym for MPolyFromWKB.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/multipolygonfromwkb/','','https://mariadb.com/kb/en/library/multipolygonfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (540,32,'PointFromWKB','A synonym for ST_PointFromWKB.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/wkb-pointfromwkb/','','https://mariadb.com/kb/en/library/wkb-pointfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (541,32,'PolyFromWKB','A synonym for ST_PolyFromWKB.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/wkb-polyfromwkb/','','https://mariadb.com/kb/en/library/wkb-polyfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (542,32,'PolygonFromWKB','A synonym for ST_PolyFromWKB.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/polygonfromwkb/','','https://mariadb.com/kb/en/library/polygonfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (543,32,'ST_AsBinary','Syntax\n------ \nST_AsBinary(g)\nAsBinary(g)\nST_AsWKB(g)\nAsWKB(g)\n \nDescription\n----------- \nConverts a value in internal geometry format to its WKB\nrepresentation and returns the binary result.\n \nST_AsBinary(), AsBinary(), ST_AsWKB() and AsWKB() are\nsynonyms,\n \nExamples\n-------- \nSET @poly = ST_GeomFromText(\'POLYGON((0 0,0 1,1 1,1 0,0\n0))\');\nSELECT ST_AsBinary(@poly);\n \nSELECT ST_AsText(ST_GeomFromWKB(ST_AsWKB(@poly)));\n+--------------------------------------------+\n| ST_AsText(ST_GeomFromWKB(ST_AsWKB(@poly))) |\n+--------------------------------------------+\n| POLYGON((0 0,0 1,1 1,1 0,0 0)) |\n+--------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_asbinary/','','https://mariadb.com/kb/en/library/st_asbinary/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (544,32,'ST_AsWKB','A synonym for ST_AsBinary().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_aswkb/','','https://mariadb.com/kb/en/library/st_aswkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (545,32,'ST_GeomCollFromWKB','Syntax\n------ \nST_GeomCollFromWKB(wkb[,srid])\nST_GeometryCollectionFromWKB(wkb[,srid])\nGeomCollFromWKB(wkb[,srid])\nGeometryCollectionFromWKB(wkb[,srid])\n \nDescription\n----------- \nConstructs a GEOMETRYCOLLECTION value using its WKB\nrepresentation and SRID.\n \nST_GeomCollFromWKB(), ST_GeometryCollectionFromWKB(),\nGeomCollFromWKB() and GeometryCollectionFromWKB() are\nsynonyms.\n \nExamples\n-------- \nSET @g =\nST_AsBinary(ST_GeomFromText(\'GEOMETRYCOLLECTION(POLYGON((5\n5,10 5,10 10,5 5)),POINT(10 10))\'));\n \nSELECT ST_AsText(ST_GeomCollFromWKB(@g));\n+----------------------------------------------------------------+\n| ST_AsText(ST_GeomCollFromWKB(@g)) |\n+----------------------------------------------------------------+\n| GEOMETRYCOLLECTION(POLYGON((5 5,10 5,10 10,5 5)),POINT(10\n10)) |\n+----------------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_geomcollfromwkb/','','https://mariadb.com/kb/en/library/st_geomcollfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (546,32,'ST_GeometryCollectionFromWKB','A synonym for ST_GeomCollFromWKB.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/st_geometrycollectionfromwkb/','','https://mariadb.com/kb/en/library/st_geometrycollectionfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (547,32,'ST_GeometryFromWKB','A synonym for ST_GeomFromWKB.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_geometryfromwkb/','','https://mariadb.com/kb/en/library/st_geometryfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (548,32,'ST_GeomFromWKB','Syntax\n------ \nST_GeomFromWKB(wkb[,srid])\nST_GeometryFromWKB(wkb[,srid])\nGeomFromWKB(wkb[,srid])\nGeometryFromWKB(wkb[,srid])\n \nDescription\n----------- \nConstructs a geometry value of any type using its WKB\nrepresentation and SRID.\n \nST_GeomFromWKB(), ST_GeometryFromWKB(), GeomFromWKB() and\nGeometryFromWKB() are synonyms.\n \nExamples\n-------- \nSET @g = ST_AsBinary(ST_LineFromText(\'LINESTRING(0 4, 4\n6)\'));\n \nSELECT ST_AsText(ST_GeomFromWKB(@g));\n+-------------------------------+\n| ST_AsText(ST_GeomFromWKB(@g)) |\n+-------------------------------+\n| LINESTRING(0 4,4 6) |\n+-------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_geomfromwkb/','','https://mariadb.com/kb/en/library/st_geomfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (549,32,'ST_LineFromWKB','Syntax\n------ \nST_LineFromWKB(wkb[,srid])\nLineFromWKB(wkb[,srid])\nST_LineStringFromWKB(wkb[,srid])\nLineStringFromWKB(wkb[,srid])\n \nDescription\n----------- \nConstructs a LINESTRING value using its WKB representation\nand SRID.\n \nST_LineFromWKB(), LineFromWKB(), ST_LineStringFromWKB(), and\nLineStringFromWKB() are synonyms.\n \nExamples\n-------- \nSET @g = ST_AsBinary(ST_LineFromText(\'LineString(0 4,4\n6)\'));\n \nSELECT ST_AsText(ST_LineFromWKB(@g)) AS l;\n \n+---------------------+\n| l |\n+---------------------+\n| LINESTRING(0 4,4 6) |\n+---------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_linefromwkb/','','https://mariadb.com/kb/en/library/st_linefromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (550,32,'ST_LineStringFromWKB','A synonym for ST_LineFromWKB.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_linestringfromwkb/','','https://mariadb.com/kb/en/library/st_linestringfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (551,32,'ST_PointFromWKB','Syntax\n------ \nST_PointFromWKB(wkb[,srid])\nPointFromWKB(wkb[,srid])\n \nDescription\n----------- \nConstructs a POINT value using its WKB representation and\nSRID.\n \nST_PointFromWKB() and PointFromWKB() are synonyms.\n \nExamples\n-------- \nSET @g = ST_AsBinary(ST_PointFromText(\'POINT(0 4)\'));\n \nSELECT ST_AsText(ST_PointFromWKB(@g)) AS p;\n \n+------------+\n| p |\n+------------+\n| POINT(0 4) |\n+------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_pointfromwkb/','','https://mariadb.com/kb/en/library/st_pointfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (552,32,'ST_PolyFromWKB','Syntax\n------ \nST_PolyFromWKB(wkb[,srid])\nST_PolygonFromWKB(wkb[,srid])\nPolyFromWKB(wkb[,srid])\nPolygonFromWKB(wkb[,srid])\n \nDescription\n----------- \nConstructs a POLYGON value using its WKB representation and\nSRID.\n \nST_PolyFromWKB(), ST_PolygonFromWKB(), PolyFromWKB() and\nPolygonFromWKB() are synonyms.\n \nExamples\n-------- \nSET @g = ST_AsBinary(ST_PolyFromText(\'POLYGON((1 1,1 5,4\n9,6 9,9 3,7 2,1 1))\'));\n \nSELECT ST_AsText(ST_PolyFromWKB(@g)) AS p;\n \n+----------------------------------------+\n| p |\n+----------------------------------------+\n| POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1 1)) |\n+----------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_polyfromwkb/','','https://mariadb.com/kb/en/library/st_polyfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (553,32,'ST_PolygonFromWKB','A synonym for ST_PolyFromWKB.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_polygonfromwkb/','','https://mariadb.com/kb/en/library/st_polygonfromwkb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (554,36,'BOUNDARY','A synonym for ST_BOUNDARY.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/geometry-properties-boundary/','','https://mariadb.com/kb/en/library/geometry-properties-boundary/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (555,36,'DIMENSION','A synonym for ST_DIMENSION.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/dimension/','','https://mariadb.com/kb/en/library/dimension/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (556,36,'ENVELOPE','A synonym for ST_ENVELOPE.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/geometry-properties-envelope/','','https://mariadb.com/kb/en/library/geometry-properties-envelope/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (557,36,'GeometryN','A synonym for ST_GeometryN.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/geometry-properties-geometryn/','','https://mariadb.com/kb/en/library/geometry-properties-geometryn/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (558,36,'GeometryType','A synonym for ST_GeometryType.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/geometry-properties-geometrytype/','','https://mariadb.com/kb/en/library/geometry-properties-geometrytype/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (559,36,'IsClosed','A synonym for ST_IsClosed.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/isclosed/','','https://mariadb.com/kb/en/library/isclosed/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (560,36,'IsEmpty','A synonym for ST_IsEmpty.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/geometry-properties-isempty/','','https://mariadb.com/kb/en/library/geometry-properties-isempty/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (561,36,'IsRing','A synonym for ST_IsRing.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/isring/','','https://mariadb.com/kb/en/library/isring/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (562,36,'IsSimple','A synonym for ST_IsSImple.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/geometry-properties-issimple/','','https://mariadb.com/kb/en/library/geometry-properties-issimple/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (563,36,'NumGeometries','A synonym for ST_NumGeometries.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/geometry-properties-numgeometries/','','https://mariadb.com/kb/en/library/geometry-properties-numgeometries/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (564,36,'SRID','A synonym for ST_SRID.\n \n\n \n \n \n \n \n \n \n\nURL:\nhttps://mariadb.com/kb/en/library/geometry-properties-srid/','','https://mariadb.com/kb/en/library/geometry-properties-srid/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (565,36,'ST_BOUNDARY','The ST_BOUNDARY function was introduced in MariaDB 10.1.2\n \nSyntax\n------ \nST_BOUNDARY(g)\nBOUNDARY(g)\n \nDescription\n----------- \nReturns a geometry that is the closure of the combinatorial\nboundary of the geometry value g.\n \nBOUNDARY() is a synonym.\n \nExamples\n-------- \nSELECT ST_AsText(ST_Boundary(ST_GeomFromText(\'LINESTRING(3\n3,0 0, -3 3)\')));\n+----------------------------------------------------------------------+\n| ST_AsText(ST_Boundary(ST_GeomFromText(\'LINESTRING(3 3,0\n0, -3 3)\'))) |\n+----------------------------------------------------------------------+\n| MULTIPOINT(3 3,-3 3) |\n+----------------------------------------------------------------------+\n \nSELECT ST_AsText(ST_Boundary(ST_GeomFromText(\'POLYGON((3\n3,0 0, -3 3, 3 3))\')));\n+--------------------------------------------------------------------------+\n| ST_AsText(ST_Boundary(ST_GeomFromText(\'POLYGON((3 3,0 0,\n-3 3, 3 3))\'))) |\n+--------------------------------------------------------------------------+\n| LINESTRING(3 3,0 0,-3 3,3 3) |\n+--------------------------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_boundary/','','https://mariadb.com/kb/en/library/st_boundary/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (566,36,'ST_DIMENSION','Syntax\n------ \nST_Dimension(g)\nDimension(g)\n \nDescription\n----------- \nReturns the inherent dimension of the geometry value g. The\nresult can\nbe\n \nDimension | Definition | \n \n -1 | empty geometry | \n \n 0 | geometry with no length or area | \n \n 1 | geometry with no area but nonzero length | \n \n 2 | geometry with nonzero area | \n \nST_Dimension() and Dimension() are synonyms.\n \nExamples\n-------- \nSELECT Dimension(GeomFromText(\'LineString(1 1,2 2)\'));\n+------------------------------------------------+\n| Dimension(GeomFromText(\'LineString(1 1,2 2)\')) |\n+------------------------------------------------+\n| 1 |\n+------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_dimension/','','https://mariadb.com/kb/en/library/st_dimension/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (567,36,'ST_ENVELOPE','Syntax\n------ \nST_ENVELOPE(g)\nENVELOPE(g)\n \nDescription\n----------- \nReturns the Minimum Bounding Rectangle (MBR) for the\ngeometry value g. The result is returned as a Polygon value.\n \nThe polygon is defined by the corner points of the bounding\nbox:\n \nPOLYGON((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX\nMINY))\n \nST_ENVELOPE() and ENVELOPE() are synonyms.\n \nExamples\n-------- \nSELECT AsText(ST_ENVELOPE(GeomFromText(\'LineString(1 1,4\n4)\')));\n+----------------------------------------------------------+\n| AsText(ST_ENVELOPE(GeomFromText(\'LineString(1 1,4 4)\')))\n|\n+----------------------------------------------------------+\n| POLYGON((1 1,4 1,4 4,1 4,1 1)) |\n+----------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_envelope/','','https://mariadb.com/kb/en/library/st_envelope/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (568,36,'ST_GEOMETRYN','Syntax\n------ \nST_GeometryN(gc,N)\nGeometryN(gc,N)\n \nDescription\n----------- \nReturns the N-th geometry in the GeometryCollection gc.\nGeometries are numbered beginning with 1.\n \nST_GeometryN() and GeometryN() are synonyms.\n \nExample\n \nSET @gc = \'GeometryCollection(Point(1 1),LineString(12 14,\n9 11))\';\n \nSELECT AsText(GeometryN(GeomFromText(@gc),1));\n+----------------------------------------+\n| AsText(GeometryN(GeomFromText(@gc),1)) |\n+----------------------------------------+\n| POINT(1 1) |\n+----------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_geometryn/','','https://mariadb.com/kb/en/library/st_geometryn/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (569,36,'ST_GEOMETRYTYPE','Syntax\n------ \nST_GeometryType(g)\nGeometryType(g)\n \nDescription\n----------- \nReturns as a string the name of the geometry type of which\nthe\ngeometry instance g is a member. The name corresponds to one\nof the\ninstantiable Geometry subclasses.\n \nST_GeometryType() and GeometryType() are synonyms.\n \nExamples\n-------- \nSELECT GeometryType(GeomFromText(\'POINT(1 1)\'));\n+------------------------------------------+\n| GeometryType(GeomFromText(\'POINT(1 1)\')) |\n+------------------------------------------+\n| POINT |\n+------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_geometrytype/','','https://mariadb.com/kb/en/library/st_geometrytype/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (570,36,'ST_ISCLOSED','Syntax\n------ \nST_IsClosed(g)\nIsClosed(g)\n \nDescription\n----------- \nReturns 1 if a given LINESTRING\'s start and end points are\nthe same, or 0 if they are not the same. Before MariaDB\n10.1.5, returns NULL if not given a LINESTRING. After\nMariaDB 10.1.5, returns -1.\n \nST_IsClosed() and IsClosed() are synonyms.\n \nExamples\n-------- \nSET @ls = \'LineString(0 0, 0 4, 4 4, 0 0)\';\n \nSELECT ST_ISCLOSED(GEOMFROMTEXT(@ls));\n+--------------------------------+\n| ST_ISCLOSED(GEOMFROMTEXT(@ls)) |\n+--------------------------------+\n| 1 |\n+--------------------------------+\n \nSET @ls = \'LineString(0 0, 0 4, 4 4, 0 1)\';\n \nSELECT ST_ISCLOSED(GEOMFROMTEXT(@ls));\n+--------------------------------+\n| ST_ISCLOSED(GEOMFROMTEXT(@ls)) |\n+--------------------------------+\n| 0 |\n+--------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_isclosed/','','https://mariadb.com/kb/en/library/st_isclosed/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (571,36,'ST_ISEMPTY','Syntax\n------ \nST_IsEmpty(g)\nIsEmpty(g)\n \nDescription\n----------- \nIsEmpty is a function defined by the OpenGIS specification,\nbut is not fully implemented by MariaDB or MySQL. \n \nSince MariaDB and MySQL do not support GIS EMPTY values such\nas POINT EMPTY, as implemented it simply returns 1 if the\ngeometry value g is invalid, 0 if it is valid, and NULL if\nthe argument is NULL.\n \nST_IsEmpty() and IsEmpty() are synonyms.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_isempty/','','https://mariadb.com/kb/en/library/st_isempty/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (572,36,'ST_IsRing','The ST_IsRing function was introduced in MariaDB 10.1.2\n \nSyntax\n------ \nST_IsRing(g)\nIsRing(g)\n \nDescription\n----------- \nReturns true if a given LINESTRING is a ring, that is, both\nST_IsClosed and ST_IsSimple. A simple curve does not pass\nthrough the same point more than once. However, see\nMDEV-7510.\n \nSt_IsRing() and IsRing() are synonyms.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_isring/','','https://mariadb.com/kb/en/library/st_isring/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (573,36,'ST_IsSimple','Syntax\n------ \nST_IsSimple(g)\nIsSimple(g)\n \nDescription\n----------- \nReturns true if the given Geometry has no anomalous\ngeometric points, false if it does, or NULL if given a NULL\nvalue.\n \nST_IsSimple() and IsSimple() are synonyms.\n \nExamples\n-------- \nA POINT is always simple.\n \nSET @g = \'Point(1 2)\';\n \nSELECT ST_ISSIMPLE(GEOMFROMTEXT(@g));\n+-------------------------------+\n| ST_ISSIMPLE(GEOMFROMTEXT(@g)) |\n+-------------------------------+\n| 1 |\n+-------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_issimple/','','https://mariadb.com/kb/en/library/st_issimple/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (574,36,'ST_NUMGEOMETRIES','Syntax\n------ \nST_NumGeometries(gc)\nNumGeometries(gc)\n \nDescription\n----------- \nReturns the number of geometries in the GeometryCollection\ngc.\n \nST_NumGeometries() and NumGeometries() are synonyms.\n \nExample\n \nSET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3\n3))\';\n \nSELECT NUMGEOMETRIES(GeomFromText(@gc));\n+----------------------------------+\n| NUMGEOMETRIES(GeomFromText(@gc)) |\n+----------------------------------+\n| 2 |\n+----------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_numgeometries/','','https://mariadb.com/kb/en/library/st_numgeometries/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (575,36,'ST_RELATE','The ST_RELATE() function was introduced in MariaDB 10.1.2\n \nSyntax\n------ \nST_Relate(g1, g2, i)\n \nDescription\n----------- \nReturns true if Geometry g1 is spatially related to\nGeometryg2 by testing for intersections between the\ninterior, boundary and exterior of the two geometries as\nspecified by the values in intersection matrix pattern i.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_relate/','','https://mariadb.com/kb/en/library/st_relate/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (576,36,'ST_SRID','Syntax\n------ \nST_SRID(g)\nSRID(g)\n \nDescription\n----------- \nReturns an integer indicating the Spatial Reference System\nID for the\ngeometry value g.\n \nIn MariaDB, the SRID value is just an integer associated\nwith the\ngeometry value. All calculations are done assuming Euclidean\n(planar)\ngeometry.\n \nST_SRID() and SRID() are synonyms.\n \nExamples\n-------- \nSELECT SRID(GeomFromText(\'LineString(1 1,2 2)\',101));\n+-----------------------------------------------+\n| SRID(GeomFromText(\'LineString(1 1,2 2)\',101)) |\n+-----------------------------------------------+\n| 101 |\n+-----------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/st_srid/','','https://mariadb.com/kb/en/library/st_srid/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (577,37,'ASCII','Syntax\n------ \nASCII(str)\n \nDescription\n----------- \nReturns the numeric ASCII value of the leftmost character of\nthe string argument. Returns 0 if the given string is empty\nand NULL if it is NULL.\n \nASCII() works for 8-bit characters.\n \nExamples\n-------- \nSELECT ASCII(9);\n+----------+\n| ASCII(9) |\n+----------+\n| 57 |\n+----------+\n \nSELECT ASCII(\'9\');\n+------------+\n| ASCII(\'9\') |\n+------------+\n| 57 |\n+------------+\n \nSELECT ASCII(\'abc\');\n+--------------+\n| ASCII(\'abc\') |\n+--------------+\n| 97 |\n+--------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/ascii/','','https://mariadb.com/kb/en/library/ascii/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (578,37,'BIN','Syntax\n------ \nBIN(N)\n \nDescription\n----------- \nReturns a string representation of the binary value of the\ngiven longlong (that is, BIGINT) number. This is equivalent\nto CONV(N,10,2). The argument should be positive. If it is a\nFLOAT, it will be truncated. Returns NULL if the argument is\nNULL.\n \nExamples\n-------- \nSELECT BIN(12);\n+---------+\n| BIN(12) |\n+---------+\n| 1100 |\n+---------+\n \n\n\nURL: https://mariadb.com/kb/en/library/bin/','','https://mariadb.com/kb/en/library/bin/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (579,37,'BINARY Operator','Syntax\n------ \nBINARY\n \nDescription\n----------- \nThe BINARY operator casts the string following it to a\nbinary string. This is an easy way to force a column\ncomparison to be done byte by byte rather than character by\ncharacter. This causes the comparison to be case sensitive\neven if the column isn\'t defined as BINARY or BLOB. \n \nBINARY also causes trailing spaces to be significant.\n \nExamples\n-------- \nSELECT \'a\' = \'A\';\n \n+-----------+\n| \'a\' = \'A\' |\n+-----------+\n| 1 |\n+-----------+\n \nSELECT BINARY \'a\' = \'A\';\n \n+------------------+\n| BINARY \'a\' = \'A\' |\n+------------------+\n| 0 |\n+------------------+\n \nSELECT \'a\' = \'a \';\n \n+------------+\n| \'a\' = \'a \' |\n+------------+\n| 1 |\n+------------+\n \nSELECT BINARY \'a\' = \'a \';\n \n+-------------------+\n| BINARY \'a\' = \'a \' |\n+-------------------+\n| 0 |\n+-------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/binary-operator/','','https://mariadb.com/kb/en/library/binary-operator/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (580,37,'BIT_LENGTH','Syntax\n------ \nBIT_LENGTH(str)\n \nDescription\n----------- \nReturns the length of the given string argument in bits. If\nthe argument is not a string, it will be converted to\nstring. If the argument is NULL, it returns NULL.\n \nExamples\n-------- \nSELECT BIT_LENGTH(\'text\');\n+--------------------+\n| BIT_LENGTH(\'text\') |\n+--------------------+\n| 32 |\n+--------------------+\n \nSELECT BIT_LENGTH(\'\');\n+----------------+\n| BIT_LENGTH(\'\') |\n+----------------+\n| 0 |\n+----------------+\n \nCompatibility\n \nPostgreSQL and Sybase support BIT_LENGTH().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/bit_length/','','https://mariadb.com/kb/en/library/bit_length/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (581,37,'CAST','Syntax\n------ \nCAST(expr AS type)\n \nDescription\n----------- \nThe CAST() function takes a value of one type and produces a\nvalue of another type, similar to the CONVERT() function.\nFor more information, see the description of CONVERT(). \n \nThe main difference between the CAST() and CONVERT() is that\nCONVERT(expr,type) is ODBC syntax while CAST(expr as type)\nand CONVERT(... USING ...) are SQL92 syntax.\n \nIn MariaDB 10.4 and later, you can use the CAST() function\nwith the INTERVAL keyword.\n \nUntil MariaDB 5.5.31, X\'HHHH\', the standard SQL syntax for\nbinary string literals, erroneously worked in the same way\nas 0xHHHH. In 5.5.31 it was intentionally changed to behave\nas a string in all contexts (and never as a number).\n \nThis introduces an incompatibility with previous versions of\nMariaDB, and all versions of MySQL (see the example below). \n \nExamples\n-------- \nSimple casts:\n \nSELECT CAST(\"abc\" AS BINARY);\nSELECT CAST(\"1\" AS UNSIGNED INTEGER);\nSELECT CAST(123 AS CHAR CHARACTER SET utf8)\n \nNote that when one casts to CHAR without specifying the\ncharacter set, the collation_connection character set\ncollation will be used. When used with CHAR CHARACTER SET,\nthe default collation for that character set will be used.\n \nSELECT COLLATION(CAST(123 AS CHAR));\n+------------------------------+\n| COLLATION(CAST(123 AS CHAR)) |\n+------------------------------+\n| latin1_swedish_ci |\n+------------------------------+\n \nSELECT COLLATION(CAST(123 AS CHAR CHARACTER SET utf8));\n+-------------------------------------------------+\n| COLLATION(CAST(123 AS CHAR CHARACTER SET utf8)) |\n+-------------------------------------------------+\n| utf8_general_ci |\n+-------------------------------------------------+\n \nIf you also want to change the collation, you have to use\nthe COLLATE operator:\n \nSELECT COLLATION(CAST(123 AS CHAR CHARACTER SET utf8) \n COLLATE utf8_unicode_ci);\n+-------------------------------------------------------------------------+\n| COLLATION(CAST(123 AS CHAR CHARACTER SET utf8) COLLATE\nutf8_unicode_ci) |\n+-------------------------------------------------------------------------+\n| utf8_unicode_ci |\n+-------------------------------------------------------------------------+\n \nUsing CAST() to order an ENUM field as a CHAR rather than\nthe internal numerical value:\n \nCREATE TABLE enum_list (enum_field enum(\'c\',\'a\',\'b\'));\n \nINSERT INTO enum_list (enum_field) \nVALUES(\'c\'),(\'a\'),(\'c\'),(\'b\');\n \nSELECT * FROM enum_list \nORDER BY enum_field;\n \n+------------+\n| enum_field |\n+------------+\n| c |\n| c |\n| a |\n| b |\n+------------+\n \nSELECT * FROM enum_list \nORDER BY CAST(enum_field AS CHAR);\n+------------+\n| enum_field |\n+------------+\n| a |\n| b |\n| c |\n| c |\n+------------+\n \nFrom MariaDB 5.5.31, the following will trigger warnings,\nsince x\'aa\' and \'X\'aa\' no longer behave as a number.\nPreviously, and in all versions of MySQL, no warnings are\ntriggered since they did erroneously behave as a number:\n \nSELECT CAST(0xAA AS UNSIGNED), CAST(x\'aa\' AS UNSIGNED),\nCAST(X\'aa\' AS UNSIGNED);\n+------------------------+-------------------------+-------------------------+\n| CAST(0xAA AS UNSIGNED) | CAST(x\'aa\' AS UNSIGNED) |\nCAST(X\'aa\' AS UNSIGNED) |\n+------------------------+-------------------------+-------------------------+\n| 170 | 0 | 0 |\n+------------------------+-------------------------+-------------------------+\n1 row in set, 2 warnings (0.00 sec)\n \nWarning (Code 1292): Truncated incorrect INTEGER value:\n\'\\xAA\'\nWarning (Code 1292): Truncated incorrect INTEGER value:\n\'\\xAA\'\n \nCasting to intervals:\n \nSELECT CAST(2019-01-04 INTERVAL AS DAY_SECOND(2)) AS\n\"Cast\";\n \n+-------------+\n| Cast |\n+-------------+\n| 00:20:17.00 |\n+-------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/cast/','','https://mariadb.com/kb/en/library/cast/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (582,37,'CHAR Function','Syntax\n------ \nCHAR(N,... [USING charset_name])\n \nDescription\n----------- \nCHAR() interprets each argument as an INT and returns a\nstring consisting of the characters given by the code values\nof those integers. NULL values are skipped. By default,\nCHAR() returns a binary string. To produce a string in a\ngiven character set, use the optional USING clause:\n \nSELECT CHARSET(CHAR(0x65)), CHARSET(CHAR(0x65 USING utf8));\n+---------------------+--------------------------------+\n| CHARSET(CHAR(0x65)) | CHARSET(CHAR(0x65 USING utf8)) |\n+---------------------+--------------------------------+\n| binary | utf8 |\n+---------------------+--------------------------------+\n \nIf USING is given and the result string is illegal for the\ngiven character set, a warning is issued. Also, if strict\nSQL mode is enabled, the result from CHAR() becomes NULL.\n \nExamples\n-------- \nSELECT CHAR(77,97,114,\'105\',97,\'68\',66);\n+----------------------------------+\n| CHAR(77,97,114,\'105\',97,\'68\',66) |\n+----------------------------------+\n| MariaDB |\n+----------------------------------+\n \nSELECT CHAR(77,77.3,\'77.3\');\n+----------------------+\n| CHAR(77,77.3,\'77.3\') |\n+----------------------+\n| MMM |\n+----------------------+\n1 row in set, 1 warning (0.00 sec)\n \nWarning (Code 1292): Truncated incorrect INTEGER value:\n\'77.3\'\n \n\n\nURL: https://mariadb.com/kb/en/library/char-function/','','https://mariadb.com/kb/en/library/char-function/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (583,37,'CHARACTER_LENGTH','Syntax\n------ \nCHARACTER_LENGTH(str)\n \nDescription\n----------- \nCHARACTER_LENGTH() is a synonym for CHAR_LENGTH().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/character_length/','','https://mariadb.com/kb/en/library/character_length/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (584,37,'CHAR_LENGTH','Syntax\n------ \nCHAR_LENGTH(str)\n \nDescription\n----------- \nReturns the length of the given string argument, measured in\ncharacters. A multi-byte character counts as a single\ncharacter. This means that for a string containing five\ntwo-byte characters, LENGTH() (or OCTET_LENGTH() in Oracle\nmode) returns 10, whereas CHAR_LENGTH() returns 5. If the\nargument is NULL, it returns NULL. \n \nIf the argument is not a string value, it is converted into\na string.\n \nIt is synonymous with the CHARACTER_LENGTH() function.\n \nUntil MariaDB 10.3.1, returns MYSQL_TYPE_LONGLONG, or\nbigint(10), in all cases. From MariaDB 10.3.1, returns\nMYSQL_TYPE_LONG, or int(10), when the result would fit\nwithin 32-bits.\n \nExamples\n-------- \nSELECT CHAR_LENGTH(\'MariaDB\');\n+------------------------+\n| CHAR_LENGTH(\'MariaDB\') |\n+------------------------+\n| 7 |\n+------------------------+\n \nSELECT CHAR_LENGTH(\'π\');\n+-------------------+\n| CHAR_LENGTH(\'π\') |\n+-------------------+\n| 1 |\n+-------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/char_length/','','https://mariadb.com/kb/en/library/char_length/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (585,37,'CHR','The CHR() function was introduced in MariaDB 10.3.1 to\nprovide Oracle compatibility\n \nSyntax\n------ \nCHR(N)\n \nDescription\n----------- \nCHR() interprets each argument N as an integer and returns a\nVARCHAR(1) string consisting of the character given by the\ncode values of the integer. The character set and collation\nof the string are set according to the values of the\ncharacter_set_database and collation_database system\nvariables.\n \nCHR() is similar to the CHAR() function, but only accepts a\nsingle argument.\n \nCHR() is available in all sql_modes.\n \nExamples\n-------- \nSELECT CHR(67);\n+---------+\n| CHR(67) |\n+---------+\n| C |\n+---------+\n \nSELECT CHR(\'67\');\n+-----------+\n| CHR(\'67\') |\n+-----------+\n| C |\n+-----------+\n \nSELECT CHR(\'C\');\n+----------+\n| CHR(\'C\') |\n+----------+\n| |\n+----------+\n1 row in set, 1 warning (0.000 sec)\n \nSHOW WARNINGS;\n \n+---------+------+----------------------------------------+\n| Level | Code | Message |\n+---------+------+----------------------------------------+\n| Warning | 1292 | Truncated incorrect INTEGER value: \'C\'\n|\n+---------+------+----------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/chr/','','https://mariadb.com/kb/en/library/chr/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (586,37,'CONCAT','Syntax\n------ \nCONCAT(str1,str2,...)\n \nDescription\n----------- \nReturns the string that results from concatenating the\narguments. May have one or more arguments. If all arguments\nare non-binary strings, the result is a non-binary string.\nIf the arguments include any binary strings, the result is a\nbinary string. A numeric argument is converted to its\nequivalent binary string form; if you want to avoid that,\nyou can use an explicit type cast, as in this example:\n \nSELECT CONCAT(CAST(int_col AS CHAR), char_col);\n \nCONCAT() returns NULL if any argument is NULL.\n \nA NULL parameter hides all information contained in other\nparameters from the result. Sometimes this is not desirable;\nto avoid this, you can:\nUse the CONCAT_WS() function with an empty separator,\nbecause that function is NULL-safe.\nUse IFNULL() to turn NULLs into empty strings.\n \nOracle Mode\n \nIn Oracle mode from MariaDB 10.3, CONCAT ignores NULL.\n \nExamples\n-------- \nSELECT CONCAT(\'Ma\', \'ria\', \'DB\');\n+---------------------------+\n| CONCAT(\'Ma\', \'ria\', \'DB\') |\n+---------------------------+\n| MariaDB |\n+---------------------------+\n \nSELECT CONCAT(\'Ma\', \'ria\', NULL, \'DB\');\n+---------------------------------+\n| CONCAT(\'Ma\', \'ria\', NULL, \'DB\') |\n+---------------------------------+\n| NULL |\n+---------------------------------+\n \nSELECT CONCAT(42.0);\n+--------------+\n| CONCAT(42.0) |\n+--------------+\n| 42.0 |\n+--------------+\n \nUsing IFNULL() to handle NULLs:\n \nSELECT CONCAT(\'The value of @v is: \', IFNULL(@v, \'\'));\n+------------------------------------------------+\n| CONCAT(\'The value of @v is: \', IFNULL(@v, \'\')) |\n+------------------------------------------------+\n| The value of @v is: |\n+------------------------------------------------+\n \nIn Oracle mode, from MariaDB 10.3:\n \nSELECT CONCAT(\'Ma\', \'ria\', NULL, \'DB\');\n+---------------------------------+\n| CONCAT(\'Ma\', \'ria\', NULL, \'DB\') |\n+---------------------------------+\n| MariaDB |\n+---------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/concat/','','https://mariadb.com/kb/en/library/concat/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (587,37,'CONCAT_WS','Syntax\n------ \nCONCAT_WS(separator,str1,str2,...)\n \nDescription\n----------- \nCONCAT_WS() stands for Concatenate With Separator and is a\nspecial form of CONCAT(). The first argument is the\nseparator for the rest of the arguments. The separator is\nadded between the strings to be concatenated. The separator\ncan be a string, as can the rest of the arguments.\n \nIf the separator is NULL, the result is NULL; all other NULL\nvalues are skipped. This makes CONCAT_WS() suitable when you\nwant to concatenate some values and avoid losing all\ninformation if one of them is NULL.\n \nExamples\n-------- \nSELECT CONCAT_WS(\',\',\'First name\',\'Second name\',\'Last\nName\');\n+-------------------------------------------------------+\n| CONCAT_WS(\',\',\'First name\',\'Second name\',\'Last\nName\') |\n+-------------------------------------------------------+\n| First name,Second name,Last Name |\n+-------------------------------------------------------+\n \nSELECT CONCAT_WS(\'-\',\'Floor\',NULL,\'Room\');\n+------------------------------------+\n| CONCAT_WS(\'-\',\'Floor\',NULL,\'Room\') |\n+------------------------------------+\n| Floor-Room |\n+------------------------------------+\n \nIn some cases, remember to include a space in the separator\nstring:\n \nSET @a = \'gnu\', @b = \'penguin\', @c = \'sea lion\';\n \nQuery OK, 0 rows affected (0.00 sec)\n \nSELECT CONCAT_WS(\', \', @a, @b, @c);\n+-----------------------------+\n| CONCAT_WS(\', \', @a, @b, @c) |\n+-----------------------------+\n| gnu, penguin, sea lion |\n+-----------------------------+\n \nUsing CONCAT_WS() to handle NULLs:\n \nSET @a = \'a\', @b = NULL, @c = \'c\';\n \nSELECT CONCAT_WS(\'\', @a, @b, @c);\n+---------------------------+\n| CONCAT_WS(\'\', @a, @b, @c) |\n+---------------------------+\n| ac |\n+---------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/concat_ws/','','https://mariadb.com/kb/en/library/concat_ws/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (588,37,'CONVERT','Syntax\n------ \nCONVERT(expr,type), CONVERT(expr USING transcoding_name)\n \nDescription\n----------- \nThe CONVERT() and CAST() functions take a value of one type\nand produce a value of another type.\n \nThe type can be one of the following values:\nBINARY\nCHAR\nDATE\nDATETIME \nDECIMAL[(M[,D])]\nDOUBLE \nFLOAT — From MariaDB 10.4.5\nINTEGER \nShort for SIGNED INTEGER\n \nSIGNED [INTEGER]\nTIME \nUNSIGNED [INTEGER]\n \nNote that in MariaDB, INT and INTEGER are the same thing.\n \nBINARY produces a string with the BINARY data type. If the\noptional length is given, BINARY(N) causes the cast to use\nno more than N bytes of the argument. Values shorter than\nthe given number in bytes are padded with 0x00 bytes to make\nthem equal the length value.\n \nCHAR(N) causes the cast to use no more than the number of\ncharacters given in the argument.\n \nThe main difference between the CAST() and CONVERT() is that\nCONVERT(expr,type) is ODBC syntax while CAST(expr as type)\nand CONVERT(... USING ...) are SQL92 syntax.\n \nCONVERT() with USING is used to convert data between\ndifferent character sets. In MariaDB, transcoding names are\nthe same as the\ncorresponding character set names. For example, this\nstatement\nconverts the string \'abc\' in the default character set to\nthe\ncorresponding string in the utf8 character set:\n \nSELECT CONVERT(\'abc\' USING utf8);\n \nExamples\n-------- \nSELECT enum_col FROM tbl_name \nORDER BY CAST(enum_col AS CHAR);\n \nConverting a BINARY to string to permit the LOWER function\nto work:\n \nSET @x = \'AardVark\';\n \nSET @x = BINARY \'AardVark\';\n \nSELECT LOWER(@x), LOWER(CONVERT (@x USING latin1));\n+-----------+----------------------------------+\n| LOWER(@x) | LOWER(CONVERT (@x USING latin1)) |\n+-----------+----------------------------------+\n| AardVark | aardvark |\n+-----------+----------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/convert/','','https://mariadb.com/kb/en/library/convert/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (589,37,'ELT','Syntax\n------ \nELT(N, str1[, str2, str3,...])\n \nDescription\n----------- \nTakes a numeric argument and a series of string arguments.\nReturns the string that corresponds to the given numeric\nposition. For instance, it returns str1 if N is 1, str2 if N\nis 2, and so on. If the numeric argument is a FLOAT, MariaDB\nrounds it to the nearest INTEGER. If the numeric argument is\nless than 1, greater than the total number of arguments, or\nnot a number, ELT() returns NULL. It must have at least two\narguments.\n \nIt is complementary to the FIELD() function.\n \nExamples\n-------- \nSELECT ELT(1, \'ej\', \'Heja\', \'hej\', \'foo\');\n+------------------------------------+\n| ELT(1, \'ej\', \'Heja\', \'hej\', \'foo\') |\n+------------------------------------+\n| ej |\n+------------------------------------+\n \nSELECT ELT(4, \'ej\', \'Heja\', \'hej\', \'foo\');\n+------------------------------------+\n| ELT(4, \'ej\', \'Heja\', \'hej\', \'foo\') |\n+------------------------------------+\n| foo |\n+------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/elt/','','https://mariadb.com/kb/en/library/elt/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (590,37,'EXPORT_SET','Syntax\n------ \nEXPORT_SET(bits, on, off[, separator[, number_of_bits]])\n \nDescription\n----------- \nTakes a minimum of three arguments. Returns a string where\neach bit in the given bits argument is returned, with the\nstring values given for on and off. \n \nBits are examined from right to left, (from low-order to\nhigh-order bits). Strings are added to the result from left\nto right, separated by a separator string (defaults as\n\',\'). You can optionally limit the number of bits the\nEXPORT_SET() function examines using the number_of_bits\noption. \n \nIf any of the arguments are set as NULL, the function\nreturns NULL.\n \nExamples\n-------- \nSELECT EXPORT_SET(5,\'Y\',\'N\',\',\',4);\n+-----------------------------+\n| EXPORT_SET(5,\'Y\',\'N\',\',\',4) |\n+-----------------------------+\n| Y,N,Y,N |\n+-----------------------------+\n \nSELECT EXPORT_SET(6,\'1\',\'0\',\',\',10);\n+------------------------------+\n| EXPORT_SET(6,\'1\',\'0\',\',\',10) |\n+------------------------------+\n| 0,1,1,0,0,0,0,0,0,0 |\n+------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/export_set/','','https://mariadb.com/kb/en/library/export_set/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (591,37,'EXTRACTVALUE','Syntax\n------ \nEXTRACTVALUE(xml_frag, xpath_expr)\n \nDescription\n----------- \nThe EXTRACTVALUE() function takes two string arguments: a\nfragment of XML markup and an XPath expression, (also known\nas a locator). It returns the text (That is, CDDATA), of the\nfirst text node which is a child of the element or elements\nmatching the XPath expression. \n \nIn cases where a valid XPath expression does not match any\ntext nodes in a valid XML fragment, (including the implicit\n/text() expression), the EXTRACTVALUE() function returns an\nempty string.\n \nInvalid Arguments\n \nWhen either the XML fragment or the XPath expression is\nNULL, the EXTRACTVALUE() function returns NULL. When the XML\nfragment is invalid, it raises a warning Code 1525:\n \nWarning (Code 1525): Incorrect XML value: \'parse error at\nline 1 pos 11: unexpected END-OF-INPUT\'\n \nWhen the XPath value is invalid, it generates an Error 1105:\n \nERROR 1105 (HY000): XPATH syntax error: \')\'\n \nExplicit text() Expressions\n \nThis function is the equivalent of performing a match using\nthe XPath expression after appending /text(). In other\nwords:\n \nSELECT\n EXTRACTVALUE(\'example\', \'/cases/case\') AS \'Base\nExample\',\n EXTRACTVALUE(\'example\', \'/cases/case/text()\') AS\n\'text() Example\';\n \n+--------------+----------------+\n| Base Example | text() Example |\n+--------------+----------------+\n| example | example |\n+--------------+----------------+\n \nCount Matches\n \nWhen EXTRACTVALUE() returns multiple matches, it returns the\ncontent of the first child text node of each matching\nelement, in the matched order, as a single, space-delimited\nstring.\n \nBy design, the EXTRACTVALUE() function makes no distinction\nbetween a match on an empty element and no match at all. If\nyou need to determine whether no matching element was found\nin the XML fragment or if an element was found that\ncontained no child text nodes, use the XPath count()\nfunction. \n \nFor instance, when looking for a value that exists, but\ncontains no child text nodes, you would get a count of the\nnumber of matching instances:\n \nSELECT\n EXTRACTVALUE(\'\', \'/cases/case\') AS \'Empty Example\',\n EXTRACTVALUE(\'\', \'/cases/case/count()\') AS \'count()\nExample\';\n \n+---------------+-----------------+\n| Empty Example | count() Example |\n+---------------+-----------------+\n| | 1 |\n+---------------+-----------------+\n \nAlternatively, when looking for a value that doesn\'t exist,\ncount() returns 0.\n \nSELECT\n EXTRACTVALUE(\'\', \'/cases/person\') AS \'No Match\nExample\',\n EXTRACTVALUE(\'\', \'/cases/person/count()\') AS \'count()\nExample\';\n \n+------------------+-----------------+\n| No Match Example | count() Example |\n+------------------+-----------------+\n| | 0|\n+------------------+-----------------+\n \nMatches\n \nImportant: The EXTRACTVALUE() function only returns CDDATA.\nIt does not return tags that the element might contain or\nthe text that these child elements contain.\n \nSELECT EXTRACTVALUE(\'Personx@example.com\', \'/cases\') AS\nCase;\n \n+--------+\n| Case |\n+--------+\n| Person |\n+--------+\n \nNote, in the above example, while the XPath expression\nmatches to the parent instance, it does not return the\ncontained tag or its content.\n \nExamples\n-------- \nSELECT\n ExtractValue(\'cccddd\', \'/a\') AS val1,\n ExtractValue(\'cccddd\', \'/a/b\') AS val2,\n ExtractValue(\'cccddd\', \'//b\') AS val3,\n ExtractValue(\'cccddd\', \'/b\') AS val4,\n ExtractValue(\'cccdddeee\', \'//b\') AS val5;\n \n+------+------+------+------+---------+\n| val1 | val2 | val3 | val4 | val5 |\n+------+------+------+------+---------+\n| ccc | ddd | ddd | | ddd eee |\n+------+------+------+------+---------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/extractvalue/','','https://mariadb.com/kb/en/library/extractvalue/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (592,37,'FIELD','Syntax\n------ \nFIELD(pattern, str1[,str2,...])\n \nDescription\n----------- \nReturns the index position of the string or number matching\nthe given pattern. Returns 0 in the event that none of the\narguments match the pattern. Raises an Error 1582 if not\ngiven at least two arguments.\n \nWhen all arguments given to the FIELD() function are\nstrings, they are treated as case-insensitive. When all the\narguments are numbers, they are treated as numbers.\nOtherwise, they are treated as doubles. \n \nIf the given pattern occurs more than once, the FIELD()\nfunction only returns the index of the first instance. If\nthe given pattern is NULL, the function returns 0, as a NULL\npattern always fails to match.\n \nThis function is complementary to the ELT() function.\n \nExamples\n-------- \nSELECT FIELD(\'ej\', \'Hej\', \'ej\', \'Heja\', \'hej\',\n\'foo\') \n AS \'Field Results\';\n \n+---------------+\n| Field Results | \n+---------------+\n| 2 |\n+---------------+\n \nSELECT FIELD(\'fo\', \'Hej\', \'ej\', \'Heja\', \'hej\',\n\'foo\')\n AS \'Field Results\';\n \n+---------------+\n| Field Results | \n+---------------+\n| 0 |\n+---------------+\n \nSELECT FIELD(1, 2, 3, 4, 5, 1) AS \'Field Results\';\n \n+---------------+\n| Field Results |\n+---------------+\n| 5 |\n+---------------+\n \nSELECT FIELD(NULL, 2, 3) AS \'Field Results\';\n \n+---------------+\n| Field Results |\n+---------------+\n| 0 |\n+---------------+\n \nSELECT FIELD(\'fail\') AS \'Field Results\';\n \nError 1582 (42000): Incorrect parameter count in call\nto native function \'field\'\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/field/','','https://mariadb.com/kb/en/library/field/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (593,37,'FIND_IN_SET','Syntax\n------ \nFIND_IN_SET(pattern, strlist)\n \nDescription\n----------- \nReturns the index position where the given pattern occurs in\na string list. The first argument is the pattern you want to\nsearch for. The second argument is a string containing\ncomma-separated variables. If the second argument is of the\nSET data-type, the function is optimized to use bit\narithmetic.\n \nIf the pattern does not occur in the string list or if the\nstring list is an empty string, the function returns 0. If\neither argument is NULL, the function returns NULL. The\nfunction does not return the correct result if the pattern\ncontains a comma (\",\") character.\n \nExamples\n-------- \nSELECT FIND_IN_SET(\'b\',\'a,b,c,d\') AS \"Found Results\";\n \n+---------------+\n| Found Results |\n+---------------+\n| 2 |\n+---------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/find_in_set/','','https://mariadb.com/kb/en/library/find_in_set/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (594,37,'FORMAT','Syntax\n------ \nFORMAT(num, decimal_position[, locale])\n \nDescription\n----------- \nFormats the given number for display as a string, adding\nseparators to appropriate position and rounding the results\nto the given decimal position. For instance, it would format\n15233.345 to 15,233.35.\n \nIf the given decimal position is 0, it rounds to return no\ndecimal point or fractional part. You can optionally specify\na locale value to format numbers to the pattern appropriate\nfor the given region.\n \nExamples\n-------- \nSELECT FORMAT(1234567890.09876543210, 4) AS \'Format\';\n \n+--------------------+\n| Format |\n+--------------------+\n| 1,234,567,890.0988 |\n+--------------------+\n \nSELECT FORMAT(1234567.89, 4) AS \'Format\';\n \n+----------------+\n| Format |\n+----------------+\n| 1,234,567.8900 |\n+----------------+\n \nSELECT FORMAT(1234567.89, 0) AS \'Format\';\n \n+-----------+\n| Format |\n+-----------+\n| 1,234,568 |\n+-----------+\n \nSELECT FORMAT(123456789,2,\'rm_CH\') AS \'Format\';\n \n+----------------+\n| Format |\n+----------------+\n| 123\'456\'789,00 |\n+----------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/format/','','https://mariadb.com/kb/en/library/format/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (595,37,'FROM_BASE64','The FROM_BASE64() function was introduced in MariaDB 10.0.5.\n \nSyntax\n------ \nFROM_BASE64(str)\n \nDescription\n----------- \nDecodes the given base-64 encode string, returning the\nresult as a binary string. Returns NULL if the given string\nis NULL or if it\'s invalid.\n \nIt is the reverse of the TO_BASE64 function.\n \nThere are numerous methods to base-64 encode a string.\nMariaDB uses the following:\nIt encodes alphabet value 64 as \'+\'.\nIt encodes alphabet value 63 as \'/\'.\nIt codes output in groups of four printable characters. Each\nthree byte of data encoded uses four characters. If the\nfinal group is incomplete, it pads the difference with the\n\'=\' character.\nIt divides long output, adding a new line very 76\ncharacters.\nIn decoding, it recognizes and ignores newlines, carriage\nreturns, tabs and space whitespace characters.\n \nSELECT TO_BASE64(\'Maria\') AS \'Input\';\n \n+-----------+\n| Input |\n+-----------+\n| TWFyaWE= |\n+-----------+\n \nSELECT FROM_BASE64(\'TWFyaWE=\') AS \'Output\';\n \n+--------+\n| Output |\n+--------+\n| Maria |\n+--------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/from_base64/','','https://mariadb.com/kb/en/library/from_base64/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (596,37,'HEX','Syntax\n------ \nHEX(N_or_S)\n \nDescription\n----------- \nIf N_or_S is a number, returns a string representation of\nthe hexadecimal\nvalue of N, where N is a longlong (BIGINT) number. This is\nequivalent to CONV(N,10,16).\n \nIf N_or_S is a string, returns a hexadecimal string\nrepresentation of\nN_or_S where each byte of each character in N_or_S is\nconverted to two hexadecimal\ndigits. If N_or_S is NULL, returns NULL. The inverse of this\noperation is performed by the UNHEX()\nfunction.\n \nExamples\n-------- \nSELECT HEX(255);\n+----------+\n| HEX(255) |\n+----------+\n| FF |\n+----------+\n \nSELECT 0x4D617269614442;\n \n+------------------+\n| 0x4D617269614442 |\n+------------------+\n| MariaDB |\n+------------------+\n \nSELECT HEX(\'MariaDB\');\n+----------------+\n| HEX(\'MariaDB\') |\n+----------------+\n| 4D617269614442 |\n+----------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/hex/','','https://mariadb.com/kb/en/library/hex/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (597,37,'INSERT Function','Syntax\n------ \nINSERT(str,pos,len,newstr)\n \nDescription\n----------- \nReturns the string str, with the substring beginning at\nposition pos\nand len characters long replaced by the string newstr.\nReturns the\noriginal string if pos is not within the length of the\nstring.\nReplaces the rest of the string from position pos if len is\nnot within\nthe length of the rest of the string. Returns NULL if any\nargument is\nNULL.\n \nExamples\n-------- \nSELECT INSERT(\'Quadratic\', 3, 4, \'What\');\n+-----------------------------------+\n| INSERT(\'Quadratic\', 3, 4, \'What\') |\n+-----------------------------------+\n| QuWhattic |\n+-----------------------------------+\n \nSELECT INSERT(\'Quadratic\', -1, 4, \'What\');\n+------------------------------------+\n| INSERT(\'Quadratic\', -1, 4, \'What\') |\n+------------------------------------+\n| Quadratic |\n+------------------------------------+\n \nSELECT INSERT(\'Quadratic\', 3, 100, \'What\');\n+-------------------------------------+\n| INSERT(\'Quadratic\', 3, 100, \'What\') |\n+-------------------------------------+\n| QuWhat |\n+-------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/insert-function/','','https://mariadb.com/kb/en/library/insert-function/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (598,37,'INSTR','Syntax\n------ \nINSTR(str,substr)\n \nDescription\n----------- \nReturns the position of the first occurrence of substring\nsubstr in\nstring str. This is the same as the two-argument form of\nLOCATE(),\nexcept that the order of the arguments is reversed.\n \nINSTR() performs a case-insensitive search.\n \nIf any argument is NULL, returns NULL.\n \nExamples\n-------- \nSELECT INSTR(\'foobarbar\', \'bar\');\n+---------------------------+\n| INSTR(\'foobarbar\', \'bar\') |\n+---------------------------+\n| 4 |\n+---------------------------+\n \nSELECT INSTR(\'My\', \'Maria\');\n+----------------------+\n| INSTR(\'My\', \'Maria\') |\n+----------------------+\n| 0 |\n+----------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/instr/','','https://mariadb.com/kb/en/library/instr/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (599,37,'LCASE','Syntax\n------ \nLCASE(str)\n \nDescription\n----------- \nLCASE() is a synonym for LOWER().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/lcase/','','https://mariadb.com/kb/en/library/lcase/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (600,37,'LEFT','Syntax\n------ \nLEFT(str,len)\n \nDescription\n----------- \nReturns the leftmost len characters from the string str, or\nNULL if\nany argument is NULL.\n \nExamples\n-------- \nSELECT LEFT(\'MariaDB\', 5);\n+--------------------+\n| LEFT(\'MariaDB\', 5) |\n+--------------------+\n| Maria |\n+--------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/left/','','https://mariadb.com/kb/en/library/left/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (601,37,'LENGTH','Syntax\n------ \nLENGTH(str)\n \nDescription\n----------- \nReturns the length of the string str, measured in bytes. A\nmulti-byte\ncharacter counts as multiple bytes. This means that for a\nstring\ncontaining five two-byte characters, LENGTH() returns 10,\nwhereas\nCHAR_LENGTH() returns 5. \n \nIf str is not a string value, it is converted into a string.\nIf str is NULL, the function returns NULL.\n \nUntil MariaDB 10.3.1, returns MYSQL_TYPE_LONGLONG, or\nbigint(10), in all cases. From MariaDB 10.3.1, returns\nMYSQL_TYPE_LONG, or int(10), when the result would fit\nwithin 32-bits.\n \nOracle Mode\n \nWhen running Oracle mode from MariaDB 10.3, LENGTH() is a\nsynonym for CHAR_LENGTH().\n \nExamples\n-------- \nSELECT LENGTH(\'MariaDB\');\n+-------------------+\n| LENGTH(\'MariaDB\') |\n+-------------------+\n| 7 |\n+-------------------+\n \nSELECT LENGTH(\'π\');\n+--------------+\n| LENGTH(\'π\') |\n+--------------+\n| 2 |\n+--------------+\n \nIn Oracle mode from MariaDB 10.3:\n \nSELECT LENGTH(\'π\');\n+--------------+\n| LENGTH(\'π\') |\n+--------------+\n| 1 |\n+--------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/length/','','https://mariadb.com/kb/en/library/length/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (602,37,'LENGTHB','Introduced in MariaDB 10.3.1 as part of the Oracle\ncompatibility enhancements.\n \nSyntax\n------ \nLENGTHB(str)\n \nDescription\n----------- \nLENGTHB() is a synonym for LENGTH().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/lengthb/','','https://mariadb.com/kb/en/library/lengthb/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (603,37,'LIKE','Syntax\n------ \nexpr LIKE pat [ESCAPE \'escape_char\']\nexpr NOT LIKE pat [ESCAPE \'escape_char\']\n \nDescription\n----------- \nTests whether expr matches the pattern pat. Returns either 1\n(TRUE) or 0 (FALSE).\nBoth expr and pat may be any valid expression and are\nevaluated to strings.\nPatterns may use the following wildcard characters:\n% matches any number of characters, including zero.\n_ matches any single character.\n \nUse NOT LIKE to test if a string does not match a pattern.\nThis is equivalent to using\nthe NOT operator on the entire LIKE expression.\n \nIf either the expression or the pattern is NULL, the result\nis NULL.\n \nLIKE performs case-insensitive substring matches if the\ncollation for the\nexpression and pattern is case-insensitive. For\ncase-sensitive matches, declare either argument\nto use a binary collation using COLLATE, or coerce either of\nthem to a BINARY\nstring using CAST. Use SHOW COLLATION to get a list of\navailable collations. Collations ending in _bin are\ncase-sensitive.\n \nNumeric arguments are coerced to binary strings.\n \nThe _ wildcard matches a single character, not byte. It will\nonly match a multi-byte character\nif it is valid in the expression\'s character set. For\nexample, _ will match _utf8\"€\", but it\nwill not match _latin1\"€\" because the Euro sign is not a\nvalid latin1 character. If necessary,\nuse CONVERT to use the expression in a different character\nset.\n \nIf you need to match the characters _ or %, you must escape\nthem. By default,\nyou can prefix the wildcard characters the backslash\ncharacter \\ to escape them.\nThe backslash is used both to encode special characters like\nnewlines when a string is\nparsed as well as to escape wildcards in a pattern after\nparsing. Thus, to match an\nactual backslash, you sometimes need to double-escape it as\n\"\\\\\\\\\".\n \nTo avoid difficulties with the backslash character, you can\nchange the wildcard escape\ncharacter using ESCAPE in a LIKE expression. The argument to\nESCAPE\nmust be a single-character string.\n \nExamples\n-------- \nSelect the days that begin with \"T\":\n \nCREATE TABLE t1 (d VARCHAR(16));\nINSERT INTO t1 VALUES (\"Monday\"), (\"Tuesday\"),\n(\"Wednesday\"), (\"Thursday\"), (\"Friday\"),\n(\"Saturday\"), (\"Sunday\");\nSELECT * FROM t1 WHERE d LIKE \"T%\";\n \nSELECT * FROM t1 WHERE d LIKE \"T%\";\n+----------+\n| d |\n+----------+\n| Tuesday |\n| Thursday |\n+----------+\n \nSelect the days that contain the substring \"es\":\n \nSELECT * FROM t1 WHERE d LIKE \"%es%\";\n \nSELECT * FROM t1 WHERE d LIKE \"%es%\";\n+-----------+\n| d |\n+-----------+\n| Tuesday |\n| Wednesday |\n+-----------+\n \nSelect the six-character day names:\n \nSELECT * FROM t1 WHERE d like \"___day\";\n \nSELECT * FROM t1 WHERE d like \"___day\";\n+---------+\n| d |\n+---------+\n| Monday |\n| Friday |\n| Sunday |\n+---------+\n \nWith the default collations, LIKE is case-insensitive:\n \nSELECT * FROM t1 where d like \"t%\";\n \nSELECT * FROM t1 where d like \"t%\";\n+----------+\n| d |\n+----------+\n| Tuesday |\n| Thursday |\n+----------+\n \nUse COLLATE to specify a binary collation, forcing\ncase-sensitive matches:\n \nSELECT * FROM t1 WHERE d like \"t%\" COLLATE latin1_bin;\n \nSELECT * FROM t1 WHERE d like \"t%\" COLLATE latin1_bin;\nEmpty set (0.00 sec)\n \nYou can include functions and operators in the expression to\nmatch. Select dates\nbased on their day name:\n \nCREATE TABLE t2 (d DATETIME);\nINSERT INTO t2 VALUES\n (\"2007-01-30 21:31:07\"),\n (\"1983-10-15 06:42:51\"),\n (\"2011-04-21 12:34:56\"),\n (\"2011-10-30 06:31:41\"),\n (\"2011-01-30 14:03:25\"),\n (\"2004-10-07 11:19:34\");\nSELECT * FROM t2 WHERE DAYNAME(d) LIKE \"T%\";\n \nSELECT * FROM t2 WHERE DAYNAME(d) LIKE \"T%\";\n+------------------+\n| d |\n+------------------+\n| 2007-01-30 21:31 |\n| 2011-04-21 12:34 |\n| 2004-10-07 11:19 |\n+------------------+\n3 rows in set, 7 warnings (0.00 sec)\n \nOptimizing LIKE\n \nMariaDB can use indexes for LIKE on string columns in the\ncase where the LIKE doesn\'t start with % or _.\nStarting from MariaDB 10.0, one can set the\noptimizer_use_condition_selectivity variable to 5. If this\nis done, then the optimizer will read\noptimizer_selectivity_sampling_limit rows to calculate the\nselectivity of the LIKE expression before starting to\ncalculate the query plan. This can help speed up some LIKE\nqueries by providing the optimizer with more information\nabout your data.\n \n\n\nURL: https://mariadb.com/kb/en/library/like/','','https://mariadb.com/kb/en/library/like/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (604,37,'LOAD_FILE','Syntax\n------ \nLOAD_FILE(file_name)\n \nDescription\n----------- \nReads the file and returns the file contents as a string. To\nuse this function, the file must be located on the server\nhost, you must specify the full path name to the file, and\nyou must have the FILE privilege. The file must be readable\nby all and it must be less than the size, in bytes, of the\nmax_allowed_packet system variable. If the secure_file_priv\nsystem variable is set to a non-empty directory name, the\nfile to be loaded must be located in that directory.\n \nIf the file does not exist or cannot be read because one of\nthe preceding conditions is not satisfied, the function\nreturns NULL.\n \nSince MariaDB 5.1, the character_set_filesystem system\nvariable has controlled interpretation of file names that\nare given as literal strings.\n \nStatements using the LOAD_FILE() function are not safe for\nstatement based replication. This is because the slave will\nexecute the LOAD_FILE() command itself. If the file doesn\'t\nexist on the slave, the function will return NULL.\n \nExamples\n-------- \nUPDATE t SET blob_col=LOAD_FILE(\'/tmp/picture\') WHERE\nid=1;\n \n\n\nURL: https://mariadb.com/kb/en/library/load_file/','','https://mariadb.com/kb/en/library/load_file/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (605,37,'LOCATE','Syntax\n------ \nLOCATE(substr,str), LOCATE(substr,str,pos)\n \nDescription\n----------- \nThe first syntax returns the position of the first\noccurrence of\nsubstring substr in string str. The second syntax returns\nthe position\nof the first occurrence of substring substr in string str,\nstarting at\nposition pos. Returns 0 if substr is not in str.\n \nLOCATE() performs a case-insensitive search.\n \nIf any argument is NULL, returns NULL.\n \nINSTR() is a synonym of LOCATE() without the third argument.\n \nExamples\n-------- \nSELECT LOCATE(\'bar\', \'foobarbar\');\n+----------------------------+\n| LOCATE(\'bar\', \'foobarbar\') |\n+----------------------------+\n| 4 |\n+----------------------------+\n \nSELECT LOCATE(\'My\', \'Maria\');\n+-----------------------+\n| LOCATE(\'My\', \'Maria\') |\n+-----------------------+\n| 0 |\n+-----------------------+\n \nSELECT LOCATE(\'bar\', \'foobarbar\', 5);\n+-------------------------------+\n| LOCATE(\'bar\', \'foobarbar\', 5) |\n+-------------------------------+\n| 7 |\n+-------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/locate/','','https://mariadb.com/kb/en/library/locate/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (606,37,'LOWER','Syntax\n------ \nLOWER(str)\n \nDescription\n----------- \nReturns the string str with all characters changed to\nlowercase\naccording to the current character set mapping. The default\nis latin1\n(cp1252 West European).\n \nExamples\n-------- \n SELECT LOWER(\'QUADRATICALLY\');\n+------------------------+\n| LOWER(\'QUADRATICALLY\') |\n+------------------------+\n| quadratically |\n+------------------------+\n \nLOWER() (and UPPER()) are ineffective when applied to binary\nstrings (BINARY, VARBINARY, BLOB). \nTo perform lettercase conversion, CONVERT the string to a\nnon-binary string:\n \nSET @str = BINARY \'North Carolina\';\n \nSELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));\n+----------------+-----------------------------------+\n| LOWER(@str) | LOWER(CONVERT(@str USING latin1)) |\n+----------------+-----------------------------------+\n| North Carolina | north carolina |\n+----------------+-----------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/lower/','','https://mariadb.com/kb/en/library/lower/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (607,37,'LPAD','Syntax\n------ \nLPAD(str, len [,padstr])\n \nDescription\n----------- \nReturns the string str, left-padded with the string padstr\nto a length\nof len characters. If str is longer than len, the return\nvalue is\nshortened to len characters. If padstr is omitted, the LPAD\nfunction pads spaces.\n \nPrior to MariaDB 10.3.1, the padstr parameter was mandatory.\n \nReturns NULL if given a NULL argument. If the result is\nempty (zero length), returns either an empty string or, from\nMariaDB 10.3.6 with SQL_MODE=Oracle, NULL.\n \nThe Oracle mode version of the function can be accessed\noutside of Oracle mode by using LPAD_ORACLE as the function\nname.\n \nExamples\n-------- \nSELECT LPAD(\'hello\',10,\'.\');\n+----------------------+\n| LPAD(\'hello\',10,\'.\') |\n+----------------------+\n| .....hello |\n+----------------------+\n \nSELECT LPAD(\'hello\',2,\'.\');\n+---------------------+\n| LPAD(\'hello\',2,\'.\') |\n+---------------------+\n| he |\n+---------------------+\n \nFrom MariaDB 10.3.1, with the pad string defaulting to\nspace.\n \nSELECT LPAD(\'hello\',10);\n+------------------+\n| LPAD(\'hello\',10) |\n+------------------+\n| hello |\n+------------------+\n \nOracle mode version from MariaDB 10.3.6:\n \nSELECT LPAD(\'\',0),LPAD_ORACLE(\'\',0);\n+------------+-------------------+\n| LPAD(\'\',0) | LPAD_ORACLE(\'\',0) |\n+------------+-------------------+\n| | NULL |\n+------------+-------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/lpad/','','https://mariadb.com/kb/en/library/lpad/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (608,37,'LTRIM','Syntax\n------ \nLTRIM(str)\n \nDescription\n----------- \nReturns the string str with leading space characters\nremoved.\n \nReturns NULL if given a NULL argument. If the result is\nempty, returns either an empty string, or, from MariaDB\n10.3.6 with SQL_MODE=Oracle, NULL.\n \nThe Oracle mode version of the function can be accessed\noutside of Oracle mode by using LTRIM_ORACLE as the function\nname.\n \nExamples\n-------- \nSELECT QUOTE(LTRIM(\' MariaDB \'));\n+-------------------------------+\n| QUOTE(LTRIM(\' MariaDB \')) |\n+-------------------------------+\n| \'MariaDB \' |\n+-------------------------------+\n \nOracle mode version from MariaDB 10.3.6:\n \nSELECT LTRIM(\'\'),LTRIM_ORACLE(\'\');\n+-----------+------------------+\n| LTRIM(\'\') | LTRIM_ORACLE(\'\') |\n+-----------+------------------+\n| | NULL |\n+-----------+------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/ltrim/','','https://mariadb.com/kb/en/library/ltrim/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (609,37,'MAKE_SET','Syntax\n------ \nMAKE_SET(bits,str1,str2,...)\n \nDescription\n----------- \nReturns a set value (a string containing substrings\nseparated by \",\"\ncharacters) consisting of the strings that have the\ncorresponding bit\nin bits set. str1 corresponds to bit 0, str2 to bit 1, and\nso on. NULL\nvalues in str1, str2, ... are not appended to the result.\n \nExamples\n-------- \nSELECT MAKE_SET(1,\'a\',\'b\',\'c\');\n+-------------------------+\n| MAKE_SET(1,\'a\',\'b\',\'c\') |\n+-------------------------+\n| a |\n+-------------------------+\n \nSELECT MAKE_SET(1 | 4,\'hello\',\'nice\',\'world\');\n+----------------------------------------+\n| MAKE_SET(1 | 4,\'hello\',\'nice\',\'world\') |\n+----------------------------------------+\n| hello,world |\n+----------------------------------------+\n \nSELECT MAKE_SET(1 | 4,\'hello\',\'nice\',NULL,\'world\');\n+---------------------------------------------+\n| MAKE_SET(1 | 4,\'hello\',\'nice\',NULL,\'world\') |\n+---------------------------------------------+\n| hello |\n+---------------------------------------------+\n \nSELECT QUOTE(MAKE_SET(0,\'a\',\'b\',\'c\'));\n+--------------------------------+\n| QUOTE(MAKE_SET(0,\'a\',\'b\',\'c\')) |\n+--------------------------------+\n| \'\' |\n+--------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/make_set/','','https://mariadb.com/kb/en/library/make_set/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (610,37,'MATCH AGAINST','Syntax\n------ \nMATCH (col1,col2,...) AGAINST (expr [search_modifier])\n \nDescription\n----------- \nA special construct used to perform a fulltext search on a\nfulltext index.\n \nSee Fulltext Index Overview for a full description, and\nFull-text Indexes for more articles on the topic.\n \nExamples\n-------- \nCREATE TABLE ft_myisam(copy TEXT,FULLTEXT(copy))\nENGINE=MyISAM;\n \nINSERT INTO ft_myisam(copy) VALUES (\'Once upon a time\'),\n(\'There was a wicked witch\'), \n (\'Who ate everybody up\');\n \nSELECT * FROM ft_myisam WHERE MATCH(copy)\nAGAINST(\'wicked\');\n+--------------------------+\n| copy |\n+--------------------------+\n| There was a wicked witch |\n+--------------------------+\n \nSELECT id, body, MATCH (title,body) AGAINST\n (\'Security implications of running MySQL as root\'\n IN NATURAL LANGUAGE MODE) AS score\n FROM articles WHERE MATCH (title,body) AGAINST\n (\'Security implications of running MySQL as root\'\n IN NATURAL LANGUAGE MODE);\n+----+-------------------------------------+-----------------+\n| id | body | score |\n+----+-------------------------------------+-----------------+\n| 4 | 1. Never run mysqld as root. 2. ... | 1.5219271183014\n|\n| 6 | When configured properly, MySQL ... | 1.3114095926285\n|\n+----+-------------------------------------+-----------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/match-against/','','https://mariadb.com/kb/en/library/match-against/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (611,37,'MID','Syntax\n------ \nMID(str,pos,len)\n \nDescription\n----------- \nMID(str,pos,len) is a synonym for SUBSTRING(str,pos,len).\n \nExamples\n-------- \nSELECT MID(\'abcd\',4,1);\n+-----------------+\n| MID(\'abcd\',4,1) |\n+-----------------+\n| d |\n+-----------------+\n \nSELECT MID(\'abcd\',2,2);\n+-----------------+\n| MID(\'abcd\',2,2) |\n+-----------------+\n| bc |\n+-----------------+\n \nA negative starting position:\n \nSELECT MID(\'abcd\',-2,4);\n+------------------+\n| MID(\'abcd\',-2,4) |\n+------------------+\n| cd |\n+------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/mid/','','https://mariadb.com/kb/en/library/mid/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (612,37,'NOT LIKE','Syntax\n------ \nexpr NOT LIKE pat [ESCAPE \'escape_char\']\n \nDescription\n----------- \nThis is the same as NOT (expr LIKE pat [ESCAPE\n\'escape_char\']).\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/not-like/','','https://mariadb.com/kb/en/library/not-like/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (613,37,'NOT REGEXP','Syntax\n------ \nexpr NOT REGEXP pat, expr NOT RLIKE pat\n \nDescription\n----------- \nThis is the same as NOT (expr REGEXP pat).\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/not-regexp/','','https://mariadb.com/kb/en/library/not-regexp/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (614,37,'OCTET_LENGTH','Syntax\n------ \nOCTET_LENGTH(str)\n \nDescription\n----------- \nOCTET_LENGTH() is normally a synonym for LENGTH(). When\nrunning Oracle mode from MariaDB 10.3, they are not\nsynonyms, but OCTET_LENGTH() behaves as LENGTH() would when\nnot in Oracle mode.\n \n\n\nURL: https://mariadb.com/kb/en/library/octet_length/','','https://mariadb.com/kb/en/library/octet_length/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (615,37,'ORD','Syntax\n------ \nORD(str)\n \nDescription\n----------- \nIf the leftmost character of the string str is a multi-byte\ncharacter,\nreturns the code for that character, calculated from the\nnumeric\nvalues of its constituent bytes using this formula:\n \n (1st byte code)\n+ (2nd byte code x 256)\n+ (3rd byte code x 256 x 256) ...\n \nIf the leftmost character is not a multi-byte character,\nORD() returns\nthe same value as the ASCII() function.\n \nExamples\n-------- \nSELECT ORD(\'2\');\n+----------+\n| ORD(\'2\') |\n+----------+\n| 50 |\n+----------+\n \n\n\nURL: https://mariadb.com/kb/en/library/ord/','','https://mariadb.com/kb/en/library/ord/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (616,37,'POSITION','Syntax\n------ \nPOSITION(substr IN str)\n \nDescription\n----------- \nPOSITION(substr IN str) is a synonym for LOCATE(substr,str).\n \nIt\'s part of ODBC 3.0.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/position/','','https://mariadb.com/kb/en/library/position/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (617,37,'QUOTE','Syntax\n------ \nQUOTE(str)\n \nDescription\n----------- \nQuotes a string to produce a result that can be used as a\nproperly escaped data\nvalue in an SQL statement. The string is returned enclosed\nby single quotes and\nwith each instance of single quote (\"\'\"), backslash\n(\"\\\"),\nASCII NUL, and Control-Z preceded by a backslash. If the\nargument\nis NULL, the return value is the word \"NULL\" without\nenclosing single\nquotes.\n \nExamples\n-------- \nSELECT QUOTE(\"Don\'t!\");\n+-----------------+\n| QUOTE(\"Don\'t!\") |\n+-----------------+\n| \'Don\\\'t!\' |\n+-----------------+\n \nSELECT QUOTE(NULL); \n+-------------+\n| QUOTE(NULL) |\n+-------------+\n| NULL |\n+-------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/quote/','','https://mariadb.com/kb/en/library/quote/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (618,37,'REGEXP_INSTR','REGEXP_INSTR was introduced in MariaDB 10.0.5.\n \nSyntax\n------ \nREGEXP_INSTR(subject, pattern)\n \nReturns the position of the first occurrence of the regular\nexpression pattern in the string subject, or 0 if pattern\nwas not found.\n \nThe positions start with 1 and are measured in characters\n(i.e. not in bytes), which is important for multi-byte\ncharacter sets. You can cast a multi-byte character set to\nBINARY to get offsets in bytes.\n \nThe function follows the case sensitivity rules of the\neffective collation. Matching is performed case\ninsensitively for case insensitive collations, and case\nsensitively for case sensitive collations and for binary\ndata.\n \nThe collation case sensitivity can be overwritten using the\n(?i) and (?-i) PCRE flags.\n \nMariaDB 10.0.5 switched to the PCRE regular expression\nlibrary for enhanced regular expression performance, and\nREGEXP_INSTR was introduced as part of this enhancement.\n \nExamples\n-------- \nSELECT REGEXP_INSTR(\'abc\',\'b\');\n-> 2\n \nSELECT REGEXP_INSTR(\'abc\',\'x\');\n-> 0\n \nSELECT REGEXP_INSTR(\'BJÖRN\',\'N\');\n-> 5\n \nCasting a multi-byte character set as BINARY to get offsets\nin bytes:\n \nSELECT REGEXP_INSTR(BINARY \'BJÖRN\',\'N\') AS\ncast_utf8_to_binary;\n-> 6\n \nCase sensitivity:\n \nSELECT REGEXP_INSTR(\'ABC\',\'b\');\n-> 2\n \nSELECT REGEXP_INSTR(\'ABC\' COLLATE utf8_bin,\'b\');\n-> 0\n \nSELECT REGEXP_INSTR(BINARY\'ABC\',\'b\');\n-> 0\n \nSELECT REGEXP_INSTR(\'ABC\',\'(?-i)b\');\n-> 0\n \nSELECT REGEXP_INSTR(\'ABC\' COLLATE utf8_bin,\'(?i)b\');\n-> 2\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/regexp_instr/','','https://mariadb.com/kb/en/regexp_instr/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (619,37,'REGEXP_REPLACE','REGEXP_REPLACE was introduced in MariaDB 10.0.5.\n \nSyntax\n------ \nREGEXP_REPLACE(subject, pattern, replace)\n \nDescription\n----------- \nREGEXP_REPLACE returns the string subject with all\noccurrences of the regular expression pattern replaced by\nthe string replace. If no occurrences are found, then\nsubject is returned as is.\n \nThe replace string can have backreferences to the\nsubexpressions in the form \\N, where N is a number from 1\nto 9.\n \nThe function follows the case sensitivity rules of the\neffective collation. Matching is performed case\ninsensitively for case insensitive collations, and case\nsensitively for case sensitive collations and for binary\ndata.\n \nThe collation case sensitivity can be overwritten using the\n(?i) and (?-i) PCRE flags.\n \nMariaDB 10.0.5 switched to the PCRE regular expression\nlibrary for enhanced regular expression performance, and\nREGEXP_REPLACE was introduced as part of this enhancement.\n \nMariaDB 10.0.11 introduced the default_regex_flags variable\nto address the remaining compatibilities between PCRE and\nthe old regex library. \n \nExamples\n-------- \nSELECT REGEXP_REPLACE(\'ab12cd\',\'[0-9]\',\'\') AS\nremove_digits;\n-> abcd\n \nSELECT REGEXP_REPLACE(\'titlebody\', \'\',\' \')\nAS strip_html;\n-> title body\n \nBackreferences to the subexpressions in the form \\N, where\nN is a number from 1 to 9:\n \nSELECT REGEXP_REPLACE(\'James Bond\',\'^(.*)\n(.*)$\',\'\\\\2, \\\\1\') AS reorder_name;\n-> Bond, James\n \nCase insensitive and case sensitive matches:\n \nSELECT REGEXP_REPLACE(\'ABC\',\'b\',\'-\') AS\ncase_insensitive;\n-> A-C\n \nSELECT REGEXP_REPLACE(\'ABC\' COLLATE utf8_bin,\'b\',\'-\')\nAS case_sensitive;\n-> ABC\n \nSELECT REGEXP_REPLACE(BINARY \'ABC\',\'b\',\'-\') AS\nbinary_data;\n-> ABC\n \nOverwriting the collation case sensitivity using the (?i)\nand (?-i) PCRE flags.\n \nSELECT REGEXP_REPLACE(\'ABC\',\'(?-i)b\',\'-\') AS\nforce_case_sensitive;\n-> ABC\n \nSELECT REGEXP_REPLACE(BINARY \'ABC\',\'(?i)b\',\'-\') AS\nforce_case_insensitive;\n-> A-C\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/regexp_replace/','','https://mariadb.com/kb/en/regexp_replace/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (620,37,'REGEXP_SUBSTR','REGEXP_SUBSTR was introduced in MariaDB 10.0.5.\n \nSyntax\n------ \nREGEXP_SUBSTR(subject,pattern)\n \nDescription\n----------- \nReturns the part of the string subject that matches the\nregular expression pattern, or an empty string if pattern\nwas not found.\n \nThe function follows the case sensitivity rules of the\neffective collation. Matching is performed case\ninsensitively for case insensitive collations, and case\nsensitively for case sensitive collations and for binary\ndata.\n \nThe collation case sensitivity can be overwritten using the\n(?i) and (?-i) PCRE flags.\n \nMariaDB 10.0.5 switched to the PCRE regular expression\nlibrary for enhanced regular expression performance, and\nREGEXP_SUBSTR was introduced as part of this enhancement.\n \nMariaDB 10.0.11 introduced the default_regex_flags variable\nto address the remaining compatibilities between PCRE and\nthe old regex library. \n \nExamples\n-------- \nSELECT REGEXP_SUBSTR(\'ab12cd\',\'[0-9]+\');\n-> 12\n \nSELECT REGEXP_SUBSTR(\n \'See https://mariadb.org/en/foundation/ for details\',\n \'https?://[^/]*\');\n-> https://mariadb.org\n \nSELECT REGEXP_SUBSTR(\'ABC\',\'b\');\n-> B\n \nSELECT REGEXP_SUBSTR(\'ABC\' COLLATE utf8_bin,\'b\');\n->\n \nSELECT REGEXP_SUBSTR(BINARY\'ABC\',\'b\');\n->\n \nSELECT REGEXP_SUBSTR(\'ABC\',\'(?i)b\');\n-> B\n \nSELECT REGEXP_SUBSTR(\'ABC\' COLLATE utf8_bin,\'(?+i)b\');\n-> B\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/regexp_substr/','','https://mariadb.com/kb/en/regexp_substr/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (621,37,'REPEAT Function','Syntax\n------ \nREPEAT(str,count)\n \nDescription\n----------- \nReturns a string consisting of the string str repeated count\ntimes. If\ncount is less than 1, returns an empty string. Returns NULL\nif str or\ncount are NULL.\n \nExamples\n-------- \nSELECT QUOTE(REPEAT(\'MariaDB \',4));\n+------------------------------------+\n| QUOTE(REPEAT(\'MariaDB \',4)) |\n+------------------------------------+\n| \'MariaDB MariaDB MariaDB MariaDB \' |\n+------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/repeat-function/','','https://mariadb.com/kb/en/library/repeat-function/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (622,37,'REPLACE Function','Syntax\n------ \nREPLACE(str,from_str,to_str)\n \nDescription\n----------- \nReturns the string str with all occurrences of the string\nfrom_str\nreplaced by the string to_str. REPLACE() performs a\ncase-sensitive\nmatch when searching for from_str.\n \nExamples\n-------- \nSELECT REPLACE(\'www.mariadb.org\', \'w\', \'Ww\');\n+---------------------------------------+\n| REPLACE(\'www.mariadb.org\', \'w\', \'Ww\') |\n+---------------------------------------+\n| WwWwWw.mariadb.org |\n+---------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/replace-function/','','https://mariadb.com/kb/en/library/replace-function/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (623,37,'REVERSE','Syntax\n------ \nREVERSE(str)\n \nDescription\n----------- \nReturns the string str with the order of the characters\nreversed.\n \nExamples\n-------- \nSELECT REVERSE(\'desserts\');\n+---------------------+\n| REVERSE(\'desserts\') |\n+---------------------+\n| stressed |\n+---------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/reverse/','','https://mariadb.com/kb/en/library/reverse/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (624,37,'RIGHT','Syntax\n------ \nRIGHT(str,len)\n \nDescription\n----------- \nReturns the rightmost len characters from the string str, or\nNULL if\nany argument is NULL.\n \nExamples\n-------- \nSELECT RIGHT(\'MariaDB\', 2);\n+---------------------+\n| RIGHT(\'MariaDB\', 2) |\n+---------------------+\n| DB |\n+---------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/right/','','https://mariadb.com/kb/en/library/right/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (625,37,'RPAD','Syntax\n------ \nRPAD(str, len [, padstr])\n \nDescription\n----------- \nReturns the string str, right-padded with the string padstr\nto a\nlength of len characters. If str is longer than len, the\nreturn value\nis shortened to len characters. If padstr is omitted, the\nRPAD function pads spaces.\n \nPrior to MariaDB 10.3.1, the padstr parameter was mandatory.\n \nReturns NULL if given a NULL argument. If the result is\nempty (a length of zero), returns either an empty string,\nor, from MariaDB 10.3.6 with SQL_MODE=Oracle, NULL.\n \nThe Oracle mode version of the function can be accessed\noutside of Oracle mode by using RPAD_ORACLE as the function\nname.\n \nExamples\n-------- \nSELECT RPAD(\'hello\',10,\'.\');\n+----------------------+\n| RPAD(\'hello\',10,\'.\') |\n+----------------------+\n| hello..... |\n+----------------------+\n \nSELECT RPAD(\'hello\',2,\'.\');\n+---------------------+\n| RPAD(\'hello\',2,\'.\') |\n+---------------------+\n| he |\n+---------------------+\n \nFrom MariaDB 10.3.1, with the pad string defaulting to\nspace.\n \nSELECT RPAD(\'hello\',30);\n+--------------------------------+\n| RPAD(\'hello\',30) |\n+--------------------------------+\n| hello |\n+--------------------------------+\n \nOracle mode version from MariaDB 10.3.6:\n \nSELECT RPAD(\'\',0),RPAD_ORACLE(\'\',0);\n+------------+-------------------+\n| RPAD(\'\',0) | RPAD_ORACLE(\'\',0) |\n+------------+-------------------+\n| | NULL |\n+------------+-------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/rpad/','','https://mariadb.com/kb/en/library/rpad/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (626,37,'RTRIM','Syntax\n------ \nRTRIM(str)\n \nDescription\n----------- \nReturns the string str with trailing space characters\nremoved.\n \nReturns NULL if given a NULL argument. If the result is\nempty, returns either an empty string, or, from MariaDB\n10.3.6 with SQL_MODE=Oracle, NULL.\n \nThe Oracle mode version of the function can be accessed\noutside of Oracle mode by using RTRIM_ORACLE as the function\nname.\n \nExamples\n-------- \nSELECT QUOTE(RTRIM(\'MariaDB \'));\n+-----------------------------+\n| QUOTE(RTRIM(\'MariaDB \')) |\n+-----------------------------+\n| \'MariaDB\' |\n+-----------------------------+\n \nOracle mode version from MariaDB 10.3.6:\n \nSELECT RTRIM(\'\'),RTRIM_ORACLE(\'\');\n+-----------+------------------+\n| RTRIM(\'\') | RTRIM_ORACLE(\'\') |\n+-----------+------------------+\n| | NULL |\n+-----------+------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/rtrim/','','https://mariadb.com/kb/en/library/rtrim/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (627,37,'SOUNDEX','Syntax\n------ \nSOUNDEX(str)\n \nDescription\n----------- \nReturns a soundex string from str. Two strings that sound\nalmost the\nsame should have identical soundex strings. A standard\nsoundex string is four\ncharacters long, but the SOUNDEX() function returns an\narbitrarily long\nstring. You can use SUBSTRING() on the result to get a\nstandard soundex\nstring. All non-alphabetic characters in str are ignored.\nAll\ninternational alphabetic characters outside the A-Z range\nare treated as\nvowels.\n \nImportant: When using SOUNDEX(), you should be aware of the\nfollowing limitations:\nThis function, as currently implemented, is intended to work\nwell with\n strings that are in the English language only. Strings in\nother languages may\n not produce reliable results.\n \nExamples\n-------- \nSOUNDEX(\'Hello\');\n+------------------+\n| SOUNDEX(\'Hello\') |\n+------------------+\n| H400 |\n+------------------+\n \nSELECT SOUNDEX(\'MariaDB\');\n+--------------------+\n| SOUNDEX(\'MariaDB\') |\n+--------------------+\n| M631 |\n+--------------------+\n \nSELECT SOUNDEX(\'Knowledgebase\');\n+--------------------------+\n| SOUNDEX(\'Knowledgebase\') |\n+--------------------------+\n| K543212 |\n+--------------------------+\n \nSELECT givenname, surname FROM users WHERE\nSOUNDEX(givenname) = SOUNDEX(\"robert\");\n+-----------+---------+\n| givenname | surname |\n+-----------+---------+\n| Roberto | Castro |\n+-----------+---------+\n \n\n\nURL: https://mariadb.com/kb/en/library/soundex/','','https://mariadb.com/kb/en/library/soundex/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (628,37,'SOUNDS LIKE','Syntax\n------ \nexpr1 SOUNDS LIKE expr2\n \nDescription\n----------- \nThis is the same as SOUNDEX(expr1) = SOUNDEX(expr2).\n \nExample\n \nSELECT givenname, surname FROM users WHERE givenname SOUNDS\nLIKE \"robert\";\n \n+-----------+---------+\n| givenname | surname |\n+-----------+---------+\n| Roberto | Castro |\n+-----------+---------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/sounds-like/','','https://mariadb.com/kb/en/library/sounds-like/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (629,37,'SPACE','Syntax\n------ \nSPACE(N)\n \nDescription\n----------- \nReturns a string consisting of N space characters. If N is\nNULL, returns NULL.\n \nExamples\n-------- \nSELECT QUOTE(SPACE(6));\n+-----------------+\n| QUOTE(SPACE(6)) |\n+-----------------+\n| \' \' |\n+-----------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/space/','','https://mariadb.com/kb/en/library/space/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (630,37,'STRCMP','Syntax\n------ \nSTRCMP(expr1,expr2)\n \nDescription\n----------- \nSTRCMP() returns 0 if the strings are the same, -1 if the\nfirst\nargument is smaller than the second according to the current\nsort order,\nand 1 otherwise.\n \nExamples\n-------- \nSELECT STRCMP(\'text\', \'text2\');\n+-------------------------+\n| STRCMP(\'text\', \'text2\') |\n+-------------------------+\n| -1 |\n+-------------------------+\n \nSELECT STRCMP(\'text2\', \'text\');\n+-------------------------+\n| STRCMP(\'text2\', \'text\') |\n+-------------------------+\n| 1 |\n+-------------------------+\n \nSELECT STRCMP(\'text\', \'text\');\n+------------------------+\n| STRCMP(\'text\', \'text\') |\n+------------------------+\n| 0 |\n+------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/strcmp/','','https://mariadb.com/kb/en/library/strcmp/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (631,37,'SUBSTR','Description\n----------- \nSUBSTR() is a synonym for SUBSTRING().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/substr/','','https://mariadb.com/kb/en/library/substr/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (632,37,'SUBSTRING','Syntax\n------ \nSUBSTRING(str,pos), \nSUBSTRING(str FROM pos), \nSUBSTRING(str,pos,len),\nSUBSTRING(str FROM pos FOR len)\n \nSUBSTR(str,pos), \nSUBSTR(str FROM pos), \nSUBSTR(str,pos,len),\nSUBSTR(str FROM pos FOR len)\n \nDescription\n----------- \nThe forms without a len argument return a substring from\nstring str starting at position pos.\n \nThe forms with a len argument return a substring len\ncharacters long from string str, starting at position pos.\n \nThe forms that use FROM are standard SQL syntax.\n \nIt is also possible to use a negative value for pos. In this\ncase, the beginning of the substring is pos characters from\nthe end of the string, rather than the beginning. A negative\nvalue may be used for pos in any of the forms of this\nfunction.\n \nBy default, the position of the first character in the\nstring from which the substring is to be extracted is\nreckoned as 1. For Oracle-compatibility, from MariaDB\n10.3.3, when sql_mode is set to \'oracle\', position zero is\ntreated as position 1 (although the first character is still\nreckoned as 1).\n \nIf any argument is NULL, returns NULL.\n \nExamples\n-------- \nSELECT SUBSTRING(\'Knowledgebase\',5);\n+------------------------------+\n| SUBSTRING(\'Knowledgebase\',5) |\n+------------------------------+\n| ledgebase |\n+------------------------------+\n \nSELECT SUBSTRING(\'MariaDB\' FROM 6);\n+-----------------------------+\n| SUBSTRING(\'MariaDB\' FROM 6) |\n+-----------------------------+\n| DB |\n+-----------------------------+\n \nSELECT SUBSTRING(\'Knowledgebase\',3,7);\n+--------------------------------+\n| SUBSTRING(\'Knowledgebase\',3,7) |\n+--------------------------------+\n| owledge |\n+--------------------------------+\n \nSELECT SUBSTRING(\'Knowledgebase\', -4);\n+--------------------------------+\n| SUBSTRING(\'Knowledgebase\', -4) |\n+--------------------------------+\n| base |\n+--------------------------------+\n \nSELECT SUBSTRING(\'Knowledgebase\', -8, 4);\n+-----------------------------------+\n| SUBSTRING(\'Knowledgebase\', -8, 4) |\n+-----------------------------------+\n| edge |\n+-----------------------------------+\n \nSELECT SUBSTRING(\'Knowledgebase\' FROM -8 FOR 4);\n+------------------------------------------+\n| SUBSTRING(\'Knowledgebase\' FROM -8 FOR 4) |\n+------------------------------------------+\n| edge |\n+------------------------------------------+\n \nOracle mode from MariaDB 10.3.3:\n \nSELECT SUBSTR(\'abc\',0,3);\n+-------------------+\n| SUBSTR(\'abc\',0,3) |\n+-------------------+\n| |\n+-------------------+\n \nSELECT SUBSTR(\'abc\',1,2);\n+-------------------+\n| SUBSTR(\'abc\',1,2) |\n+-------------------+\n| ab |\n+-------------------+\n \nSET sql_mode=\'oracle\';\n \nSELECT SUBSTR(\'abc\',0,3);\n+-------------------+\n| SUBSTR(\'abc\',0,3) |\n+-------------------+\n| abc |\n+-------------------+\n \nSELECT SUBSTR(\'abc\',1,2);\n+-------------------+\n| SUBSTR(\'abc\',1,2) |\n+-------------------+\n| ab |\n+-------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/substring/','','https://mariadb.com/kb/en/library/substring/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (633,37,'SUBSTRING_INDEX','Syntax\n------ \nSUBSTRING_INDEX(str,delim,count)\n \nDescription\n----------- \nReturns the substring from string str before count\noccurrences of the\ndelimiter delim. If count is positive, everything to the\nleft\nof the final delimiter (counting from the left) is returned.\nIf count\nis negative, everything to the right of the final delimiter\n(counting from the\nright) is returned. SUBSTRING_INDEX() performs a\ncase-sensitive match when\nsearching for delim.\n \nIf any argument is NULL, returns NULL.\n \nExamples\n-------- \nSELECT SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', 2);\n+--------------------------------------------+\n| SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', 2) |\n+--------------------------------------------+\n| www.mariadb |\n+--------------------------------------------+\n \nSELECT SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', -2);\n+---------------------------------------------+\n| SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', -2) |\n+---------------------------------------------+\n| mariadb.org |\n+---------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/substring_index/','','https://mariadb.com/kb/en/library/substring_index/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (634,37,'TO_BASE64','The TO_BASE64() function was introduced in MariaDB 10.0.5.\n \nSyntax\n------ \nTO_BASE64(str)\n \nDescription\n----------- \nConverts the string argument str to its base-64 encoded\nform, returning the result as a character string in the\nconnection character set and collation.\n \nThe argument str will be converted to string first if it is\nnot a string. A NULL argument will return a NULL result.\n \nThe reverse function, FROM_BASE64(), decodes an encoded\nbase-64 string.\n \nThere are a numerous different methods to base-64 encode a\nstring. The following are used by MariaDB and MySQL:\nAlphabet value 64 is encoded as \'+\'.\nAlphabet value 63 is encoded as \'/\'.\nEncoding output is made up of groups of four printable\ncharacters, with each three bytes of data encoded using four\ncharacters. If the final group is not complete, it is padded\nwith \'=\' characters to make up a length of four.\nTo divide long output, a newline is added after every 76\ncharacters.\nDecoding will recognize and ignore newlines, carriage\nreturns, tabs, and spaces. \n \nExamples\n-------- \nSELECT TO_BASE64(\'Maria\');\n+--------------------+\n| TO_BASE64(\'Maria\') |\n+--------------------+\n| TWFyaWE= |\n+--------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/to_base64/','','https://mariadb.com/kb/en/library/to_base64/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (635,37,'TRIM','Syntax\n------ \nTRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str),\nTRIM([remstr FROM] str)\n \nDescription\n----------- \nReturns the string str with all remstr prefixes or suffixes\nremoved. If none of the specifiers BOTH, LEADING, or\nTRAILING is given, BOTH is assumed. remstr is optional and,\nif not specified, spaces are removed.\n \nReturns NULL if given a NULL argument. If the result is\nempty, returns either an empty string, or, from MariaDB\n10.3.6 with SQL_MODE=Oracle, NULL.\n \nThe Oracle mode version of the function can be accessed\noutside of Oracle mode by using TRIM_ORACLE as the function\nname.\n \nExamples\n-------- \nSELECT TRIM(\' bar \')\\G\n*************************** 1. row\n***************************\nTRIM(\' bar \'): bar\n \nSELECT TRIM(LEADING \'x\' FROM \'xxxbarxxx\')\\G\n*************************** 1. row\n***************************\nTRIM(LEADING \'x\' FROM \'xxxbarxxx\'): barxxx\n \nSELECT TRIM(BOTH \'x\' FROM \'xxxbarxxx\')\\G\n*************************** 1. row\n***************************\nTRIM(BOTH \'x\' FROM \'xxxbarxxx\'): bar\n \nSELECT TRIM(TRAILING \'xyz\' FROM \'barxxyz\')\\G\n*************************** 1. row\n***************************\nTRIM(TRAILING \'xyz\' FROM \'barxxyz\'): barx\n \nOracle mode version from MariaDB 10.3.6:\n \nSELECT TRIM(\'\'),TRIM_ORACLE(\'\');\n+----------+-----------------+\n| TRIM(\'\') | TRIM_ORACLE(\'\') |\n+----------+-----------------+\n| | NULL |\n+----------+-----------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/trim/','','https://mariadb.com/kb/en/library/trim/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (636,37,'UCASE','Syntax\n------ \nUCASE(str)\n \nDescription\n----------- \nUCASE() is a synonym for UPPER().\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/ucase/','','https://mariadb.com/kb/en/library/ucase/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (637,37,'UNHEX','Syntax\n------ \nUNHEX(str)\n \nDescription\n----------- \nPerforms the inverse operation of HEX(str). That is, it\ninterprets\neach pair of hexadecimal digits in the argument as a number\nand\nconverts it to the character represented by the number. The\nresulting\ncharacters are returned as a binary string.\n \nIf str is NULL, UNHEX() returns NULL.\n \nExamples\n-------- \nSELECT HEX(\'MariaDB\');\n+----------------+\n| HEX(\'MariaDB\') |\n+----------------+\n| 4D617269614442 |\n+----------------+\n \nSELECT UNHEX(\'4D617269614442\');\n+-------------------------+\n| UNHEX(\'4D617269614442\') |\n+-------------------------+\n| MariaDB |\n+-------------------------+\n \nSELECT 0x4D617269614442;\n \n+------------------+\n| 0x4D617269614442 |\n+------------------+\n| MariaDB |\n+------------------+\n \nSELECT UNHEX(HEX(\'string\'));\n+----------------------+\n| UNHEX(HEX(\'string\')) |\n+----------------------+\n| string |\n+----------------------+\n \nSELECT HEX(UNHEX(\'1267\'));\n+--------------------+\n| HEX(UNHEX(\'1267\')) |\n+--------------------+\n| 1267 |\n+--------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/unhex/','','https://mariadb.com/kb/en/library/unhex/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (638,37,'UPDATEXML','Syntax\n------ \nUpdateXML(xml_target, xpath_expr, new_xml)\n \nDescription\n----------- \nThis function replaces a single portion of a given fragment\nof XML markup\nxml_target with a new XML fragment new_xml, and then returns\nthe\nchanged XML. The portion of xml_target that is replaced\nmatches an XPath\nexpression xpath_expr supplied by the user. If no expression\nmatching\nxpath_expr is found, or if multiple matches are found, the\nfunction returns\nthe original xml_target XML fragment. All three arguments\nshould be\nstrings.\n \nExamples\n-------- \nSELECT\n UpdateXML(\'ccc\', \'/a\', \'fff\') AS val1,\n UpdateXML(\'ccc\', \'/b\', \'fff\') AS val2,\n UpdateXML(\'ccc\', \'//b\', \'fff\') AS val3,\n UpdateXML(\'ccc\', \'/a/d\', \'fff\') AS val4,\n UpdateXML(\'ccc\', \'/a/d\', \'fff\') AS val5\n \\G\n*************************** 1. row\n***************************\nval1: fff\nval2: ccc\nval3: fff\nval4: cccfff\nval5: ccc\n1 row in set (0.00 sec)\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/updatexml/','','https://mariadb.com/kb/en/library/updatexml/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (639,37,'UPPER','Syntax\n------ \nUPPER(str)\n \nDescription\n----------- \nReturns the string str with all characters changed to\nuppercase\naccording to the current character set mapping. The default\nis latin1\n(cp1252 West European).\n \nSELECT UPPER(surname), givenname FROM users ORDER BY\nsurname;\n \n+----------------+------------+\n| UPPER(surname) | givenname |\n+----------------+------------+\n| ABEL | Jacinto |\n| CASTRO | Robert |\n| COSTA | Phestos |\n| MOSCHELLA | Hippolytos |\n+----------------+------------+\n \nUPPER() is ineffective when applied to binary strings\n(BINARY,\nVARBINARY, BLOB). The description of \nLOWER() shows how to\nperform lettercase conversion of binary strings.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/upper/','','https://mariadb.com/kb/en/library/upper/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (640,37,'WEIGHT_STRING','The WEIGHT_STRING function was introduced in MariaDB 10.0.5.\n \nSyntax\n------ \nWEIGHT_STRING(str [AS {CHAR|BINARY}(N)] [LEVEL levels]\n[flags])\n levels: N [ASC|DESC|REVERSE] [, N [ASC|DESC|REVERSE]] ... \n \nDescription\n----------- \nReturns a binary string representing the string\'s sorting\nand comparison value. A string with a lower result means\nthat for sorting purposes the string appears before a string\nwith a higher result.\n \nWEIGHT_STRING() is particularly useful when adding new\ncollations, for testing purposes.\n \nIf str is a non-binary string (CHAR, VARCHAR or TEXT),\nWEIGHT_STRING returns the string\'s collation weight. If str\nis a binary string (BINARY, VARBINARY or BLOB), the return\nvalue is simply the input value, since the weight for each\nbyte in a binary string is the byte value.\n \nWEIGHT_STRING() returns NULL if given a NULL input. \n \nThe optional AS clause permits casting the input string to a\nbinary or non-binary string, as well as to a particular\nlength.\n \nAS BINARY(N) measures the length in bytes rather than\ncharacters, and right pads with 0x00 bytes to the desired\nlength. \n \nAS CHAR(N) measures the length in characters, and right pads\nwith spaces to the desired length.\n \nN has a minimum value of 1, and if it is less than the\nlength of the input string, the string is truncated without\nwarning.\n \nThe optional LEVEL clause specifies that the return value\nshould contain weights for specific collation levels. The\nlevels specifier can either be a single integer, a\ncomma-separated list of integers, or a range of integers\nseparated by a dash (whitespace is ignored). Integers can\nrange from 1 to a maximum of 6, dependent on the collation,\nand need to be listed in ascending order.\n \nIf the LEVEL clause is no provided, a default of 1 to the\nmaximum for the collation is assumed.\n \nIf the LEVEL is specified without using a range, an optional\nmodifier is permitted.\n \nASC, the default, returns the weights without any\nmodification.\n \nDESC returns bitwise-inverted weights.\n \nREVERSE returns the weights in reverse order.\n \nExamples\n-------- \nThe examples below use the HEX() function to represent\nnon-printable results in hexadecimal format.\n \nSELECT HEX(WEIGHT_STRING(\'x\'));\n+-------------------------+\n| HEX(WEIGHT_STRING(\'x\')) |\n+-------------------------+\n| 0058 |\n+-------------------------+\n \nSELECT HEX(WEIGHT_STRING(\'x\' AS BINARY(4)));\n+--------------------------------------+\n| HEX(WEIGHT_STRING(\'x\' AS BINARY(4))) |\n+--------------------------------------+\n| 78000000 |\n+--------------------------------------+\n \nSELECT HEX(WEIGHT_STRING(\'x\' AS CHAR(4)));\n+------------------------------------+\n| HEX(WEIGHT_STRING(\'x\' AS CHAR(4))) |\n+------------------------------------+\n| 0058002000200020 |\n+------------------------------------+\n \nSELECT HEX(WEIGHT_STRING(0xaa22ee LEVEL 1));\n+--------------------------------------+\n| HEX(WEIGHT_STRING(0xaa22ee LEVEL 1)) |\n+--------------------------------------+\n| AA22EE |\n+--------------------------------------+\n \nSELECT HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 DESC));\n+-------------------------------------------+\n| HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 DESC)) |\n+-------------------------------------------+\n| 55DD11 |\n+-------------------------------------------+\n \nSELECT HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 REVERSE));\n+----------------------------------------------+\n| HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 REVERSE)) |\n+----------------------------------------------+\n| EE22AA |\n+----------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/weight_string/','','https://mariadb.com/kb/en/library/weight_string/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (641,39,'ALTER DATABASE','Modifies a database, changing its overall characteristics.\n \nSyntax\n------ \nALTER {DATABASE | SCHEMA} [db_name]\n alter_specification ...\nALTER {DATABASE | SCHEMA} db_name\n UPGRADE DATA DIRECTORY NAME\n \nalter_specification:\n [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n \nDescription\n----------- \nALTER DATABASE enables you to change the overall\ncharacteristics of a\ndatabase. These characteristics are stored in the db.opt\nfile in the\ndatabase directory. To use ALTER DATABASE, you need the\nALTER\nprivilege on the database. ALTER SCHEMA is a synonym for\nALTER\nDATABASE.\n \nThe CHARACTER SET clause changes the default database\ncharacter set.\nThe COLLATE clause changes the default database collation.\nSee Character Sets and Collations for more.\n \nYou can see what character sets and collations are available\nusing,\nrespectively, the SHOW CHARACTER SET and SHOW COLLATION\nstatements.\n \nChanging the default character set/collation of a database\ndoes not change the character set/collation of any stored\nprocedures or stored functions that were previously created,\nand relied on the defaults. These need to be dropped and\nrecreated in order to apply the character set/collation\nchanges.\n \nThe database name can be omitted from the first syntax, in\nwhich case\nthe statement applies to the default database.\n \nThe syntax that includes the UPGRADE DATA DIRECTORY NAME\nclause was\nadded in MySQL 5.1.23. It updates the name of the directory\nassociated\nwith the database to use the encoding implemented in MySQL\n5.1 for\nmapping database names to database directory names (see\nIdentifier to File Name Mapping). This\nclause is for use under these conditions:\nIt is intended when upgrading MySQL to 5.1 or later from\nolder versions.\nIt is intended to update a database directory name to the\ncurrent encoding format if the name contains special\ncharacters that need encoding.\nThe statement is used by mysqlcheck (as invoked by\nmysql_upgrade).\n \nFor example,if a database in MySQL 5.0 has a name of a-b-c,\nthe name\ncontains instance of the `-\' character. In 5.0, the\ndatabase directory\nis also named a-b-c, which is not necessarily safe for all\nfile\nsystems. In MySQL 5.1 and up, the same database name is\nencoded as\na@002db@002dc to produce a file system-neutral directory\nname.\n \nWhen a MySQL installation is upgraded to MySQL 5.1 or later\nfrom an\nolder version,the server displays a name such as a-b-c\n(which is in\nthe old format) as #mysql50#a-b-c, and you must refer to the\nname\nusing the #mysql50# prefix. Use UPGRADE DATA DIRECTORY NAME\nin this\ncase to explicitly tell the server to re-encode the database\ndirectory\nname to the current encoding format:\n \nALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;\n \nAfter executing this statement, you can refer to the\ndatabase as a-b-c\nwithout the special #mysql50# prefix.\n \nExamples\n-------- \nALTER DATABASE test CHARACTER SET = \'utf8\' COLLATE =\n\'utf8_bin\';\n \n\n\nURL: https://mariadb.com/kb/en/library/alter-database/','','https://mariadb.com/kb/en/library/alter-database/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (642,39,'ALTER EVENT','Modifies one or more characteristics of an existing event.\n \nSyntax\n------ \nALTER\n [DEFINER = { user | CURRENT_USER }]\n EVENT event_name\n [ON SCHEDULE schedule]\n [ON COMPLETION [NOT] PRESERVE]\n [RENAME TO new_event_name]\n [ENABLE | DISABLE | DISABLE ON SLAVE]\n [COMMENT \'comment\']\n [DO sql_statement]\n \nDescription\n----------- \nThe ALTER EVENT statement is used to change one or more of\nthe\ncharacteristics of an existing event without the need to\ndrop and recreate it.\nThe syntax for each of the DEFINER, ON SCHEDULE, ON\nCOMPLETION,\nCOMMENT, ENABLE / DISABLE, and DO clauses is exactly the\nsame as when used with CREATE EVENT.\n \nThis statement requires the EVENT privilege.\nWhen a user executes a successful ALTER EVENT statement,\nthat user becomes\nthe definer for the affected event.\n \n(In MySQL 5.1.11 and earlier, an event could be altered only\nby its definer, or\nby a user having the SUPER privilege.)\n \nALTER EVENT works only with an existing event:\n \nALTER EVENT no_such_event ON SCHEDULE EVERY \'2:3\'\nDAY_HOUR;\nERROR 1539 (HY000): Unknown event \'no_such_event\'\n \nExamples\n-------- \nALTER EVENT myevent \n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 HOUR \n DO \n UPDATE myschema.mytable SET mycol = mycol + 1;\n \n\n\nURL: https://mariadb.com/kb/en/library/alter-event/','','https://mariadb.com/kb/en/library/alter-event/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (643,39,'ALTER FUNCTION','Syntax\n------ \nALTER FUNCTION func_name [characteristic ...]\n \ncharacteristic:\n { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL\nDATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n \nDescription\n----------- \nThis statement can be used to change the characteristics of\na stored\nfunction. More than one change may be specified in an ALTER\nFUNCTION\nstatement. However, you cannot change the parameters or body\nof a\nstored function using this statement; to make such changes,\nyou must\ndrop and re-create the function using DROP FUNCTION and\nCREATE FUNCTION.\n \nYou must have the ALTER ROUTINE privilege for the function.\n(That\nprivilege is granted automatically to the function creator.)\nIf binary\nlogging is enabled, the ALTER FUNCTION statement might also\nrequire\nthe SUPER privilege, as described in Binary Logging of\nStored Routines.\n \nExample\n \nALTER FUNCTION hello SQL SECURITY INVOKER;\n \n\n\nURL: https://mariadb.com/kb/en/library/alter-function/','','https://mariadb.com/kb/en/library/alter-function/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (644,39,'ALTER LOGFILE GROUP','Syntax\n------ \nALTER LOGFILE GROUP logfile_group\n ADD UNDOFILE \'file_name\'\n [INITIAL_SIZE [=] size]\n [WAIT]\n ENGINE [=] engine_name\n \nThe ALTER LOGFILE GROUP statement is not supported by\nMariaDB. It was originally inherited from MySQL NDB Cluster.\nSee MDEV-19295 for more information.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/alter-logfile-group/','','https://mariadb.com/kb/en/library/alter-logfile-group/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (645,39,'ALTER PROCEDURE','Syntax\n------ \nALTER PROCEDURE proc_name [characteristic ...]\n \ncharacteristic:\n { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL\nDATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n \nDescription\n----------- \nThis statement can be used to change the characteristics of\na stored\nprocedure. More than one change may be specified in an ALTER\nPROCEDURE\nstatement. However, you cannot change the parameters or body\nof a\nstored procedure using this statement. To make such changes,\nyou must\ndrop and re-create the procedure using either CREATE OR\nREPLACE PROCEDURE (since MariaDB 10.1.3) or DROP PROCEDURE\nand CREATE PROCEDURE (MariaDB 10.1.2 and before).\n \nYou must have the ALTER ROUTINE privilege for the procedure.\nBy default, that privilege is granted automatically to the\nprocedure creator. See Stored Routine Privileges.\n \nExample\n \nALTER PROCEDURE simpleproc SQL SECURITY INVOKER;\n \n\n\nURL: https://mariadb.com/kb/en/library/alter-procedure/','','https://mariadb.com/kb/en/library/alter-procedure/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (646,39,'ALTER SERVER','Syntax\n------ \nALTER SERVER server_name\n OPTIONS (option [, option] ...)\n \nDescription\n----------- \nAlters the server information for server_name, adjusting the\nspecified\noptions as per the CREATE SERVER command. The corresponding\nfields in the mysql.servers table are updated accordingly.\nThis statement requires the SUPER privilege.\n \nExamples\n-------- \nALTER SERVER s OPTIONS (USER \'sally\');\n \n\n\nURL: https://mariadb.com/kb/en/library/alter-server/','','https://mariadb.com/kb/en/library/alter-server/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (647,39,'ALTER TABLE','Syntax\n------ \nALTER [ONLINE] [IGNORE] TABLE tbl_name\n [WAIT n | NOWAIT]\n alter_specification [, alter_specification] ...\n \nalter_specification:\n table_option ...\n | ADD [COLUMN] [IF NOT EXISTS] col_name column_definition\n [FIRST | AFTER col_name ]\n | ADD [COLUMN] [IF NOT EXISTS] (col_name\ncolumn_definition,...)\n | ADD {INDEX|KEY} [IF NOT EXISTS] [index_name]\n [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]] PRIMARY KEY\n [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n UNIQUE [INDEX|KEY] [index_name]\n [index_type] (index_col_name,...) [index_option] ...\n | ADD FULLTEXT [INDEX|KEY] [index_name]\n (index_col_name,...) [index_option] ...\n | ADD SPATIAL [INDEX|KEY] [index_name]\n (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n FOREIGN KEY [IF NOT EXISTS] [index_name]\n(index_col_name,...)\n reference_definition\n | ADD PERIOD FOR SYSTEM_TIME (start_column_name,\nend_column_name)\n | ALTER [COLUMN] col_name SET DEFAULT literal\n| (expression)\n | ALTER [COLUMN] col_name DROP DEFAULT\n | CHANGE [COLUMN] [IF EXISTS] old_col_name new_col_name\ncolumn_definition\n [FIRST|AFTER col_name]\n | MODIFY [COLUMN] [IF EXISTS] col_name column_definition\n [FIRST | AFTER col_name]\n | DROP [COLUMN] [IF EXISTS] col_name [RESTRICT|CASCADE]\n | DROP PRIMARY KEY\n | DROP {INDEX|KEY} [IF EXISTS] index_name\n | DROP FOREIGN KEY [IF EXISTS] fk_symbol\n | DROP CONSTRAINT [IF EXISTS] constraint_name\n | DISABLE KEYS\n | ENABLE KEYS\n | RENAME [TO] new_tbl_name\n | ORDER BY col_name [, col_name] ...\n | CONVERT TO CHARACTER SET charset_name [COLLATE\ncollation_name]\n | [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n | DISCARD TABLESPACE\n | IMPORT TABLESPACE\n | ALGORITHM [=] {DEFAULT|INPLACE|COPY|NOCOPY|INSTANT}\n | LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n | FORCE\n | partition_options\n | ADD PARTITION (partition_definition)\n | DROP PARTITION partition_names\n | COALESCE PARTITION number\n | REORGANIZE PARTITION [partition_names INTO\n(partition_definitions)]\n | ANALYZE PARTITION partition_names\n | CHECK PARTITION partition_names\n | OPTIMIZE PARTITION partition_names\n | REBUILD PARTITION partition_names\n | REPAIR PARTITION partition_names\n | EXCHANGE PARTITION partition_name WITH TABLE tbl_name\n | REMOVE PARTITIONING\n | ADD SYSTEM VERSIONING\n | DROP SYSTEM VERSIONING\n \nindex_col_name:\n col_name [(length)] [ASC | DESC]\n \nindex_type:\n USING {BTREE | HASH | RTREE}\n \nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n | CLUSTERING={YES| NO}\n \ntable_options:\n table_option [[,] table_option] ...\nIn MariaDB 10.0.2 and later, IF EXISTS and IF NOT EXISTS\nclauses have been added for the following:\n \nADD COLUMN [IF NOT EXISTS]\nADD INDEX [IF NOT EXISTS]\nADD FOREIGN KEY [IF NOT EXISTS]\nADD PARTITION [IF NOT EXISTS]\nCREATE INDEX [IF NOT EXISTS]\n \nDROP COLUMN [IF EXISTS]\nDROP INDEX [IF EXISTS]\nDROP FOREIGN KEY [IF EXISTS]\nDROP PARTITION [IF EXISTS]\nCHANGE COLUMN [IF EXISTS]\nMODIFY COLUMN [IF EXISTS]\nDROP INDEX [IF EXISTS]\nWhen IF EXISTS and IF NOT EXISTS are used in clauses,\nqueries will not\nreport errors when the condition is triggered for that\nclause. A warning with\nthe same message text will be issued and the ALTER will move\non to the next\nclause in the statement (or end if finished).\n \nThis was done in MDEV-318.\n \nDescription\n----------- \nALTER TABLE enables you to change the structure of an\nexisting table.\nFor example, you can add or delete columns, create or\ndestroy indexes,\nchange the type of existing columns, or rename columns or\nthe table\nitself. You can also change the comment for the table and\nthe storage engine of the\ntable.\n \nIf another connection is using the table, a metadata lock is\nactive, and this statement will wait until the lock is\nreleased. This is also true for non-transactional tables.\n \nWhen adding a UNIQUE index on a column (or a set of columns)\nwhich have duplicated values, an error will be produced and\nthe statement will be stopped. To suppress the error and\nforce the creation of UNIQUE indexes, discarding duplicates,\nthe IGNORE option can be specified. This can be useful if a\ncolumn (or a set of columns) should be UNIQUE but it\ncontains duplicate values; however, this technique provides\nno control on which rows are preserved and which are\ndeleted. Also, note that IGNORE is accepted but ignored in\nALTER TABLE ... EXCHANGE PARTITION statements.\n \nThis statement can also be used to rename a table. For\ndetails see RENAME TABLE.\n \nWhen an index is created, the storage engine may use a\nconfigurable buffer in the process. Incrementing the buffer\nspeeds up the index creation. Aria and MyISAM allocate a\nbuffer whose size is defined by aria_sort_buffer_size or\nmyisam_sort_buffer_size, also used for REPAIR TABLE.\nInnoDB/XtraDB allocates three buffers whose size is defined\nby innodb_sort_buffer_size.\n \nPrivileges\n \nExecuting the ALTER TABLE statement generally requires at\nleast the ALTER privilege for the table or the database..\n \nIf you are renaming a table, then it also requires the DROP,\nCREATE and INSERT privileges for the table or the database\nas well.\n \nOnline DDL\n \nIn MariaDB 10.0 and later, online DDL is supported with the\nALGORITHM and LOCK clauses.\n \nSee InnoDB Online DDL Overview for more information on\nonline DDL with InnoDB.\n \nALTER ONLINE TABLE\n \nALTER ONLINE TABLE has also worked for partitioned tables\nsince MariaDB 10.0.11.\n \nOnline ALTER TABLE is available by executing the following:\n \nALTER ONLINE TABLE ...;\n \nThis statement has the following semantics:\n \nIn MariaDB 10.0.12 and later, this statement is equivalent\nto the following:\n \nALTER TABLE ... LOCK=NONE;\n \nSee the LOCK alter specification for more information.\n \nIn MariaDB 10.0.11, this statement is equivalent to the\nfollowing:\n \nALTER TABLE ... ALGORITHM=INPLACE;\n \nSee the ALGORITHM alter specification for more information.\n \nMariaDB until 10.0.10\n \nIn MariaDB 10.0.10 and before, this statement ensures that\nthe ALTER TABLE statement does not make a copy of the table.\n \nWAIT/NOWAIT\n \nSet the lock wait timeout. See WAIT and NOWAIT.\n \nColumn Definitions\n \nSee CREATE TABLE: Column Definitions for information about\ncolumn definitions.\n \nIndex Definitions\n \nSee CREATE TABLE: Index Definitions for information about\nindex definitions.\n \nThe CREATE INDEX and DROP INDEX statements can also be used\nto add or remove an index.\n \nCharacter Sets and Collations\n \nCONVERT TO CHARACTER SET charset_name [COLLATE\ncollation_name]\n[DEFAULT] CHARACTER SET [=] charset_name\n[DEFAULT] COLLATE [=] collation_name\nSee Setting Character Sets and Collations for details on\nsetting the character sets and collations.\n \nAlter Specifications\n \nTable Options\n \nSee CREATE TABLE: Table Options for information about table\noptions.\n \nADD COLUMN\n \n... ADD COLUMN [IF NOT EXISTS] (col_name\ncolumn_definition,...)\nAdds a column to the table. The syntax is the same as in\nCREATE TABLE.\nIf you are using IF NOT_EXISTS the column will not be added\nif it was not there already. This is very useful when doing\nscripts to modify tables.\n \nThe FIRST and AFTER clauses affect the physical order of\ncolumns in the datafile. Use FIRST to add a column in the\nfirst (leftmost) position, or AFTER followed by a column\nname to add the new column in any other position. Note that,\nnowadays, the physical position of a column is usually\nirrelevant.\n \nSee also Instant ADD COLUMN for InnoDB.\n \nDROP COLUMN\n \n... DROP COLUMN [IF EXISTS] col_name [CASCADE|RESTRICT]\nDrops the column from the table.\nIf you are using IF EXISTS you will not get an error if the\ncolumn didn\'t exist.\nIf the column is part of any index, the column will be\ndropped from them, except if you add a new column with\nidentical name at the same time. The index will be dropped\nif all columns from the index were dropped.\nIf the column was used in a view or trigger, you will get an\nerror next time the view or trigger is accessed.\n \nDropping a column that is part of a multi-column UNIQUE\nconstraint is not permitted. For example:\n \nCREATE TABLE a (\n a int,\n b int,\n primary key (a,b)\n);\n \nALTER TABLE x DROP COLUMN a;\n[42000][1072] Key column \'A\' doesn\'t exist in table\n \nThe reason is that dropping column a would result in the new\nconstraint that all values in column b be unique. In order\nto drop the column, an explicit DROP PRIMARY KEY and ADD\nPRIMARY KEY would be required. Up until MariaDB 10.2.7, the\ncolumn was dropped and the additional constraint applied,\nresulting in the following structure:\n \nALTER TABLE x DROP COLUMN a;\nQuery OK, 0 rows affected (0.46 sec)\n \nDESC x;\n+-------+---------+------+-----+---------+-------+\n| Field | Type | Null | Key | Default | Extra |\n+-------+---------+------+-----+---------+-------+\n| b | int(11) | NO | PRI | NULL | |\n+-------+---------+------+-----+---------+-------+\n \nMariaDB 10.4.0 supports instant DROP COLUMN. DROP COLUMN of\nan indexed column would imply DROP INDEX (and in the case of\na non-UNIQUE multi-column index, possibly ADD INDEX). These\nwill not be allowed with ALGORITHM=INSTANT, but unlike\nbefore, they can be allowed with ALGORITHM=NOCOPY\n \nRESTRICT and CASCADE are allowed to make porting from other\ndatabase systems easier. In MariaDB, they do nothing.\n \nMODIFY COLUMN\n \nAllows you to modify the type of a column. The column will\nbe at the same place as the original column and all indexes\non the column will be kept. Note that when modifying column,\nyou should specify all attributes for the new column.\n \nCREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT, PRIMARY\nKEY((a));\nALTER TABLE t1 MODIFY a BIGINT UNSIGNED AUTO_INCREMENT;\n \nCHANGE COLUMN\n \nWorks like MODIFY COLUMN except that you can also change the\nname of the column. The column will be at the same place as\nthe original column and all index on the column will be\nkept.\n \nCREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT, PRIMARY\nKEY(a));\nALTER TABLE t1 CHANGE a b BIGINT UNSIGNED AUTO_INCREMENT;\n \nALTER COLUMN\n \nThis lets you change column options.\n \nCREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT, b\nvarchar(50), PRIMARY KEY(a));\nALTER TABLE t1 ALTER b SET DEFAULT \'hello\';\n \nADD PRIMARY KEY\n \nAdd a primary key.\n \nFor PRIMARY KEY indexes, you can specify a name for the\nindex, but it is silently ignored, and the name of the index\nis always PRIMARY.\n \nSee Getting Started with Indexes: Primary Key for more\ninformation.\n \nDROP PRIMARY KEY\n \nDrop a primary key.\n \nFor PRIMARY KEY indexes, you can specify a name for the\nindex, but it is silently ignored, and the name of the index\nis always PRIMARY.\n \nSee Getting Started with Indexes: Primary Key for more\ninformation.\n \nADD FOREIGN KEY\n \nAdd a foreign key.\n \nFor FOREIGN KEY indexes, a reference definition must be\nprovided.\n \nFor FOREIGN KEY indexes, you can specify a name for the\nconstraint, using the CONSTRAINT keyword. That name will be\nused in error messages.\n \nFirst, you have to specify the name of the target (parent)\ntable and a column or a column list which must be indexed\nand whose values must match to the foreign key\'s values.\nThe MATCH clause is accepted to improve the compatibility\nwith other DBMS\'s, but has no meaning in MariaDB. The ON\nDELETE and ON UPDATE clauses specify what must be done when\na DELETE (or a REPLACE) statements attempts to delete a\nreferenced row from the parent table, and when an UPDATE\nstatement attempts to modify the referenced foreign key\ncolumns in a parent table row, respectively. The following\noptions are allowed:\nRESTRICT: The delete/update operation is not performed. The\nstatement terminates with a 1451 error (SQLSTATE \'2300\').\nNO ACTION: Synonym for RESTRICT.\nCASCADE: The delete/update operation is performed in both\ntables.\nSET NULL: The update or delete goes ahead in the parent\ntable, and the corresponding foreign key fields in the child\ntable are set to NULL. (They must not be defined as NOT NULL\nfor this to succeed).\n \nMariaDB until 5.3\nSET DEFAULT: This option is currently implemented only for\nthe PBXT storage engine, which is disabled by default and no\nlonger maintained. It sets the child table\'s foreign key\nfields to their DEFAULT values when the referenced parent\ntable key entries are updated or deleted.\n \nIf either clause is omitted, the default behavior for the\nomitted clause is RESTRICT.\n \nSee Foreign Keys for more information.\n \nDROP FOREIGN KEY\n \nDrop a foreign key.\n \nSee Foreign Keys for more information.\n \nADD INDEX\n \nAdd a plain index.\n \nPlain indexes are regular indexes that are not unique, and\nare not acting as a primary key or a foreign key. They are\nalso not the \"specialized\" FULLTEXT or SPATIAL indexes.\n \nSee Getting Started with Indexes: Plain Indexes for more\ninformation.\n \nDROP INDEX\n \nDrop a plain index.\n \nPlain indexes are regular indexes that are not unique, and\nare not acting as a primary key or a foreign key. They are\nalso not the \"specialized\" FULLTEXT or SPATIAL indexes.\n \nSee Getting Started with Indexes: Plain Indexes for more\ninformation.\n \nADD UNIQUE INDEX\n \nAdd a unique index.\n \nThe UNIQUE keyword means that the index will not accept\nduplicated values, except for NULLs. An error will raise if\nyou try to insert duplicate values in a UNIQUE index.\n \nFor UNIQUE indexes, you can specify a name for the\nconstraint, using the CONSTRAINT keyword. That name will be\nused in error messages.\n \nSee Getting Started with Indexes: Unique Index for more\ninformation.\n \nDROP UNIQUE INDEX\n \nDrop a unique index.\n \nThe UNIQUE keyword means that the index will not accept\nduplicated values, except for NULLs. An error will raise if\nyou try to insert duplicate values in a UNIQUE index.\n \nFor UNIQUE indexes, you can specify a name for the\nconstraint, using the CONSTRAINT keyword. That name will be\nused in error messages.\n \nSee Getting Started with Indexes: Unique Index for more\ninformation.\n \nADD FULLTEXT INDEX\n \nAdd a FULLTEXT index.\n \nSee Full-Text Indexes for more information.\n \nDROP FULLTEXT INDEX\n \nDrop a FULLTEXT index.\n \nSee Full-Text Indexes for more information.\n \nADD SPATIAL INDEX\n \nAdd a SPATIAL index.\n \nSee SPATIAL INDEX for more information.\n \nDROP SPATIAL INDEX\n \nDrop a SPATIAL index.\n \nSee SPATIAL INDEX for more information.\n \nENABLE/ DISABLE KEYS\n \nDISABLE KEYS will disable all non unique keys for the table\nfor storage engines that support this (at least MyISAM and\nAria). This can be used to speed up inserts into empty\ntables.\n \nENABLE KEYS will enable all disabled keys.\n \nRENAME TO\n \nRenames the table. See also RENAME TABLE.\n \nADD CONSTRAINT\n \nModifies the table adding a constraint on a particular\ncolumn or columns.\n \nMariaDB 10.2.1 introduced new ways to define a constraint.\n \nNote: Before MariaDB 10.2.1, constraint expressions were\naccepted in syntax, but ignored.\n \nALTER TABLE table_name \nADD CONSTRAINT [constraint_name] CHECK(expression);\nBefore a row is inserted or updated, all constraints are\nevaluated in the order they are defined. If any constraint\nfails, then the row will not be updated. One can use most\ndeterministic functions in a constraint, including UDF\'s.\n \nCREATE TABLE account_ledger (\n id INT PRIMARY KEY AUTO_INCREMENT,\n transaction_name VARCHAR(100),\n credit_account VARCHAR(100),\n credit_amount INT,\n debit_account VARCHAR(100),\n debit_amount INT);\n \nALTER TABLE account_ledger \nADD CONSTRAINT is_balanced \n CHECK((debit_amount + credit_amount) = 0);\n \nThe constraint_name is optional. If you don\'t provide one\nin the ALTER TABLE statement, MariaDB auto-generates a name\nfor you. This is done so that you can remove it later using\nDROP CONSTRAINT clause.\n \nYou can disable all constraint expression checks by setting\nthe variable check_constraint_checks to OFF. You may find\nthis useful when loading a table that violates some\nconstraints that you want to later find and fix in SQL.\n \nTo view constraints on a table, query\ninformation_schema.TABLE_CONSTRAINTS:\n \nSELECT CONSTRAINT_NAME, TABLE_NAME, CONSTRAINT_TYPE \nFROM information_schema.TABLE_CONSTRAINTS\nWHERE TABLE_NAME = \'account_ledger\';\n \n+-----------------+----------------+-----------------+\n| CONSTRAINT_NAME | TABLE_NAME | CONSTRAINT_TYPE |\n+-----------------+----------------+-----------------+\n| is_balanced | account_ledger | CHECK |\n+-----------------+----------------+-----------------+\n \nDROP CONSTRAINT\n \nDROP CONSTRAINT for UNIQUE and FOREIGN KEY constraints was\nintroduced in MariaDB 10.2.22 and MariaDB 10.3.13.\n \nDROP CONSTRAINT for CHECK constraints was introduced in\nMariaDB 10.2.1\n \nModifies the table, removing the given constraint.\n \nALTER TABLE table_name\nDROP CONSTRAINT constraint_name;\n \nWhen you add a constraint to a table, whether through a\nCREATE TABLE or ALTER TABLE...ADD CONSTRAINT statement, you\ncan either set a constraint_name yourself, or allow MariaDB\nto auto-generate one for you. To view constraints on a\ntable, query information_schema.TABLE_CONSTRAINTS. For\ninstance,\n \nCREATE TABLE t (\n a INT,\n b INT,\n c INT,\n CONSTRAINT CHECK(a > b),\n CONSTRAINT check_equals CHECK(a = c)); \n \nSELECT CONSTRAINT_NAME, TABLE_NAME, CONSTRAINT_TYPE \nFROM information_schema.TABLE_CONSTRAINTS\nWHERE TABLE_NAME = \'t\';\n \n+-----------------+----------------+-----------------+\n| CONSTRAINT_NAME | TABLE_NAME | CONSTRAINT_TYPE |\n+-----------------+----------------+-----------------+\n| check_equals | t | CHECK |\n| CONSTRAINT_1 | t | CHECK |\n+-----------------+----------------+-----------------+\n \nTo remove a constraint from the table, issue an ALTER\nTABLE...DROP CONSTRAINT statement. For example,\n \nALTER TABLE t DROP CONSTRAINT is_unique;\n \nADD SYSTEM VERSIONING\n \nSystem-versioned tables was added in MariaDB 10.3.4.\n \nAdd system versioning.\n \nDROP SYSTEM VERSIONING\n \nSystem-versioned tables was added in MariaDB 10.3.4.\n \nDrop system versioning.\n \nADD PERIOD FOR SYSTEM_TIME\n \nSystem-versioned tables was added in MariaDB 10.3.4.\n \nFORCE\n \nALTER TABLE ... FORCE can force MariaDB to re-build the\ntable.\n \nIn MariaDB 5.5 and before, this could only be done by\nsetting the ENGINE table option to its old value. For\nexample, for an InnoDB table, one could execute the\nfollowing:\n \nALTER TABLE tab_name ENGINE = InnoDB;\n \nIn MariaDB 10.0 and later, the FORCE option can be used\ninstead. For example, :\n \nALTER TABLE tab_name FORCE;\n \nWith InnoDB, the table rebuild will only reclaim unused\nspace (i.e. the space previously used for deleted rows) if\nthe innodb_file_per_table system variable is set to ON. If\nthe system variable is OFF, then the space will not be\nreclaimed, but it will be-re-used for new data that\'s later\nadded.\n \nEXCHANGE PARTITION\n \nALTER TABLE ... EXCHANGE PARTITION was introduced in MariaDB\n10.0.4\n \nThis is used to exchange the tablespace files between a\npartition and another table.\n \nSee copying InnoDB\'s transportable tablespaces for more\ninformation.\n \nDISCARD TABLESPACE\n \nThis is used to discard an InnoDB table\'s tablespace.\n \nSee copying I','','https://mariadb.com/kb/en/library/alter-table/');
-update help_topic set description = CONCAT(description, 'nnoDB\'s transportable tablespaces for more\ninformation.\n \nIMPORT TABLESPACE\n \nThis is used to import an InnoDB table\'s tablespace. The\ntablespace should have been copied from its original server\nafter executing FLUSH TABLES FOR EXPORT.\n \nSee copying InnoDB\'s transportable tablespaces for more\ninformation.\n \nALTER TABLE ... IMPORT only applies to InnoDB tables. Most\nother popular storage engines, such as Aria and MyISAM, will\nrecognize their data files as soon as they\'ve been placed\nin the proper directory under the datadir, and no special\nDDL is required to import them.\n \nALGORITHM\n \nIn MariaDB 5.5 and before, ALTER TABLE operations required\nmaking a temporary copy of the table, which can be slow for\nlarge tables.\n \nIn MariaDB 10.0 and later, the ALTER TABLE statement\nsupports the ALGORITHM clause. This clause is one of the\nclauses that is used to implement online DDL. ALTER TABLE\nsupports several different algorithms. An algorithm can be\nexplicitly chosen for an ALTER TABLE operation by setting\nthe ALGORITHM clause. The supported values are:\nALGORITHM=DEFAULT - This implies the default behavior for\nthe specific statement, such as if no ALGORITHM clause is\nspecified.\nALGORITHM=COPY\nALGORITHM=INPLACE\nALGORITHM=NOCOPY - This was added in MariaDB 10.3.7.\nALGORITHM=INSTANT - This was added in MariaDB 10.3.7.\n \nSee InnoDB Online DDL Overview: ALGORITHM for information on\nhow the ALGORITHM clause affects InnoDB.\n \nALGORITHM=DEFAULT\n \nThe default behavior, which occurs if ALGORITHM=DEFAULT is\nspecified, or if ALGORITHM is not specified at all, usually\nonly makes a copy if the operation doesn\'t support being\ndone in-place at all. In this case, the most efficient\navailable algorithm will usually be used.\n \nHowever, in MariaDB 10.3.6 and before, if the value of the\nold_alter_table system variable is set to ON, then the\ndefault behavior is to perform ALTER TABLE operations by\nmaking a copy of the table using the old algorithm.\n \nIn MariaDB 10.3.7 and later, the old_alter_table system\nvariable is deprecated. Instead, the alter_algorithm system\nvariable defines the default algorithm for ALTER TABLE\noperations.\n \nALGORITHM=COPY\n \nALGORITHM=COPY was introduced in MariaDB 10.0 as the name\nfor the original ALTER TABLE algorithm.\n \nWhen ALGORITHM=INPLACE is set, MariaDB essentially does the\nfollowing operations:\n \n-- Create a temporary table with the new definition\nCREATE TEMPORARY TABLE tmp_tab (\n...\n);\n \n-- Copy the data from the original table\nINSERT INTO tmp_tab\n SELECT * FROM original_tab;\n \n-- Drop the original table\nDROP TABLE original_tab;\n \n-- Rename the temporary table, so that it replaces the\noriginal one\nRENAME TABLE tmp_tab TO original_tab;\n \nThis algorithm is very inefficient, but it is generic, so it\nworks for all storage engines.\n \nIf ALGORITHM=COPY is specified, then the copy algorithm will\nbe used even if it is not necessary. This can result in a\nlengthy table copy. If multiple ALTER TABLE operations are\nrequired that each require the table to be rebuilt, then it\nis best to specify all operations in a single ALTER TABLE\nstatement, so that the table is only rebuilt once.\n \nALGORITHM=INPLACE\n \nALGORITHM=INPLACE was introduced in MariaDB 10.0.\n \nALGORITHM=COPY can be incredibly slow, because the whole\ntable has to be copied and rebuilt. ALGORITHM=INPLACE was\nintroduced as a way to avoid this by performing operations\nin-place and avoiding the table copy and rebuild, when\npossible.\n \nWhen ALGORITHM=INPLACE is set, the underlying storage engine\nuses optimizations to perform the operation while avoiding\nthe table copy and rebuild. However, INPLACE is a bit of a\nmisnomer, since some operations may still require the table\nto be rebuilt for some storage engines. Regardless, several\noperations can be performed without a full copy of the table\nfor some storage engines.\n \nA more accurate name would have been ALGORITHM=ENGINE, where\nENGINE refers to an \"engine-specific\" algorithm.\n \nIf an ALTER TABLE operation supports ALGORITHM=INPLACE, then\nit can be performed using optimizations by the underlying\nstorage engine, but it may rebuilt.\n \nSee InnoDB Online DDL Operations with ALGORITHM=INPLACE for\nmore.\n \nALGORITHM=NOCOPY\n \nALGORITHM=NOCOPY was introduced in MariaDB 10.3.7.\n \nALGORITHM=INPLACE can sometimes be surprisingly slow in\ninstances where it has to rebuild the clustered index,\nbecause when the clustered index has to be rebuilt, the\nwhole table has to be rebuilt. ALGORITHM=NOCOPY was\nintroduced as a way to avoid this. \n \nIf an ALTER TABLE operation supports ALGORITHM=NOCOPY, then\nit can be performed without rebuilding the clustered index.\n \nIf ALGORITHM=NOCOPY is specified for an ALTER TABLE\noperation that does not support ALGORITHM=NOCOPY, then an\nerror will be raised. In this case, raising an error is\npreferable, if the alternative is for the operation to\nrebuild the clustered index, and perform unexpectedly\nslowly.\n \nSee InnoDB Online DDL Operations with ALGORITHM=NOCOPY for\nmore.\n \nALGORITHM=INSTANT\n \nALGORITHM=INSTANT was introduced in MariaDB 10.3.7.\n \nALGORITHM=INPLACE can sometimes be surprisingly slow in\ninstances where it has to modify data files.\nALGORITHM=INSTANT was introduced as a way to avoid this.\n \nIf an ALTER TABLE operation supports ALGORITHM=INSTANT, then\nit can be performed without modifying any data files.\n \nIf ALGORITHM=INSTANT is specified for an ALTER TABLE\noperation that does not support ALGORITHM=INSTANT, then an\nerror will be raised. In this case, raising an error is\npreferable, if the alternative is for the operation to\nmodify data files, and perform unexpectedly slowly.\n \nSee InnoDB Online DDL Operations with ALGORITHM=INSTANT for\nmore.\n \nLOCK\n \nIn MariaDB 10.0 and later, the ALTER TABLE statement\nsupports the LOCK clause. This clause is one of the clauses\nthat is used to implement online DDL. ALTER TABLE supports\nseveral different locking strategies. A locking strategy can\nbe explicitly chosen for an ALTER TABLE operation by setting\nthe LOCK clause. The supported values are:\nDEFAULT: Acquire the least restrictive lock on the table\nthat is supported for the specific operation. Permit the\nmaximum amount of concurrency that is supported for the\nspecific operation.\nNONE: Acquire no lock on the table. Permit all concurrent\nDML. If this locking strategy is not permitted for an\noperation, then an error is raised.\nSHARED: Acquire a read lock on the table. Permit read-only\nconcurrent DML. If this locking strategy is not permitted\nfor an operation, then an error is raised.\nEXCLUSIVE: Acquire a write lock on the table. Do not permit\nconcurrent DML.\n \nDifferent storage engines support different locking\nstrategies for different operations. If a specific locking\nstrategy is chosen for an ALTER TABLE operation, and that\ntable\'s storage engine does not support that locking\nstrategy for that specific operation, then an error will be\nraised.\n \nIf the LOCK clause is not explicitly set, then the operation\nuses LOCK=DEFAULT.\n \nALTER ONLINE TABLE is equivalent to LOCK=NONE. Therefore,\nthe ALTER ONLINE TABLE statement can be used to ensure that\nyour ALTER TABLE operation allows all concurrent DML.\n \nSee InnoDB Online DDL Overview: LOCK for information on how\nthe LOCK clause affects InnoDB.\n \nProgress Reporting\n \nMariaDB provides progress reporting for ALTER TABLE\nstatement for clients\nthat support the new progress reporting protocol. For\nexample, if you were using the mysql client, then the\nprogress report might look like this::\n \nALTER TABLE test ENGINE=Aria;\nStage: 1 of 2 \'copy to tmp table\' 46% of stage\n \nThe progress report is also shown in the output of the SHOW\nPROCESSLIST statement and in the contents of the\ninformation_schema.PROCESSLIST table.\n \nSee Progress Reporting for more information.\n \nAborting ALTER TABLE Operations\n \nIf an ALTER TABLE operation is being performed and the\nconnection is killed, the changes will be rolled back in a\ncontrolled manner. The rollback can be a slow operation as\nthe time it takes is relative to how far the operation has\nprogressed.\n \nAborting ALTER TABLE ... ALGORITHM=COPY was made faster by\nremoving excessive undo logging (MDEV-11415). This\nsignificantly shortens the time it takes to abort a running\nALTER TABLE operation.\n \nExamples\n-------- \nAdding a new column:\n \nALTER TABLE t1 ADD x INT;\n \nDropping a column:\n \nALTER TABLE t1 DROP x;\n \nModifying the type of a column:\n \nALTER TABLE t1 MODIFY x bigint unsigned;\n \nChanging the name and type of a column:\n \nALTER TABLE t1 CHANGE a b bigint unsigned auto_increment;\n \nCombining multiple clauses in a single ALTER TABLE\nstatement, separated by commas:\n \nALTER TABLE t1 DROP x, ADD x2 INT, CHANGE y y2 INT;\n \nChanging the storage engine:\n \nALTER TABLE t1 ENGINE = InnoDB;\n \nRebuilding the table (the previous example will also rebuild\nthe table if it was already InnoDB):\n \nALTER TABLE t1 FORCE;\n \n\n\nURL: https://mariadb.com/kb/en/library/alter-table/') WHERE help_topic_id = 647;
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (648,39,'ALTER TABLESPACE','The ALTER TABLESPACE statement is not supported by MariaDB.\nIt was originally inherited from MySQL NDB Cluster. In MySQL\n5.7 and later, the statement is also supported for InnoDB.\nHowever, MariaDB has chosen not to include that specific\nfeature. See MDEV-19294 for more information.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/alter-tablespace/','','https://mariadb.com/kb/en/library/alter-tablespace/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (649,39,'ALTER VIEW','Syntax\n------ \nALTER\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n \nDescription\n----------- \nThis statement changes the definition of a view, which must\nexist. The\nsyntax is similar to that for CREATE VIEW and the effect is\nthe same\nas for CREATE OR REPLACE VIEW if the view exists. This\nstatement\nrequires the CREATE VIEW and DROP privileges for the view,\nand some\nprivilege for each column referred to in the SELECT\nstatement. As of\nMariaDB 5.1.23, ALTER VIEW is allowed only to the definer or\nusers with\nthe SUPER privilege.\n \nExample\n \nALTER VIEW v AS SELECT a, a*3 AS a2 FROM t;\n \n\n\nURL: https://mariadb.com/kb/en/library/alter-view/','','https://mariadb.com/kb/en/library/alter-view/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (650,39,'CONSTRAINT','MariaDB supports the implementation of constraints at the\ntable-level using either CREATE TABLE or ALTER TABLE\nstatements. A table constraint restricts the data you can\nadd to the table. If you attempt to insert invalid data on a\ncolumn, MariaDB throws an error. \n \nSyntax\n------ \n[CONSTRAINT [symbol]] constraint_expression\n \nconstraint_expression:\n | PRIMARY KEY [index_type] (index_col_name, ...)\n[index_option] ...\n | FOREIGN KEY [index_name] (index_col_name, ...) \n REFERENCES tbl_name (index_col_name, ...)\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n | UNIQUE [INDEX|KEY] [index_name]\n [index_type] (index_col_name, ...) [index_option] ...\n | CHECK (check_constraints)\n \nindex_type:\n USING {BTREE | HASH | RTREE}\n \nindex_col_name:\n col_name [(length)] [ASC | DESC]\n \nindex_option:\n | KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n | CLUSTERING={YES|NO}\n \nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT\n \nDescription\n----------- \nConstraints provide restrictions on the data you can add to\na table. This allows you to enforce data integrity from\nMariaDB, rather than through application logic. When a\nstatement violates a constraint, MariaDB throws an error.\n \nThere are four types of table constraints:\n \nConstraint | Description | \n \nPRIMARY KEY | Sets the column for referencing rows. Values\nmust be unique and not null. | \n \nFOREIGN KEY | Sets the column to reference the primary key\non another table. | \n \nUNIQUE | Requires values in column or columns only occur\nonce in the table. | \n \nCHECK | Checks whether the data meets the given condition. |\n\n \nFOREIGN KEY Constraints\n \nInnoDB supports foreign key constraints. The syntax for a\nforeign key\nconstraint definition in InnoDB looks like this:\n \n[CONSTRAINT [symbol]] FOREIGN KEY\n [index_name] (index_col_name, ...)\n REFERENCES tbl_name (index_col_name,...)\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n \nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION\n \nCHECK Constraints\n \nFrom MariaDB 10.2.1, constraints are enforced. Before\nMariaDB 10.2.1 constraint expressions were accepted in the\nsyntax but ignored.\n \nIn MariaDB 10.2.1 you can define constraints in 2 different\nways:\nCHECK(expression) given as part of a column definition.\nCONSTRAINT [constraint_name] CHECK (expression)\n \nBefore a row is inserted or updated, all constraints are\nevaluated in the order they are defined. If any constraint\nexpression returns false, then the row will not be inserted\nor updated.\nOne can use most deterministic functions in a constraint,\nincluding UDFs.\n \nCREATE TABLE t1 (a INT CHECK (a>2), b INT CHECK (b>2),\nCONSTRAINT a_greater CHECK (a>b));\n \nIf you use the second format and you don\'t give a name to\nthe constraint, then the constraint will get an\nautomatically generated name. This is done so that you can\nlater delete the constraint with ALTER TABLE DROP\nconstraint_name.\n \nOne can disable all constraint expression checks by setting\nthe check_constraint_checks variable to OFF. This is useful\nfor example when loading a table that violates some\nconstraints that you want to later find and fix in SQL.\n \nReplication\n \nIn row-based replication, only the master checks\nconstraints, and failed statements will not be replicated.\nIn statement-based replication, the slaves will also check\nconstraints. Constraints should therefore be identical, as\nwell as deterministic, in a replication environment.\n \nAuto_increment\n \nFrom MariaDB 10.2.6, auto_increment columns are no longer\npermitted in check constraints. Previously they were\npermitted, but would not work correctly. See MDEV-11117.\n \nExamples\n-------- \nCREATE TABLE product (category INT NOT NULL, id INT NOT\nNULL,\n price DECIMAL,\n PRIMARY KEY(category, id)) ENGINE=INNODB;\n \nCREATE TABLE customer (id INT NOT NULL,\n PRIMARY KEY (id)) ENGINE=INNODB;\n \nCREATE TABLE product_order (no INT NOT NULL AUTO_INCREMENT,\n product_category INT NOT NULL,\n product_id INT NOT NULL,\n customer_id INT NOT NULL,\n PRIMARY KEY(no),\n INDEX (product_category, product_id),\n FOREIGN KEY (product_category, product_id)\n REFERENCES product(category, id)\n ON UPDATE CASCADE ON DELETE RESTRICT,\n INDEX (customer_id),\n FOREIGN KEY (customer_id)\n REFERENCES customer(id)) ENGINE=INNODB;\n \nThe following examples will work from MariaDB 10.2.1\nonwards.\n \nNumeric constraints and comparisons:\n \nCREATE TABLE t1 (a INT CHECK (a>2), b INT CHECK (b>2),\nCONSTRAINT a_greater CHECK (a>b));\n \nINSERT INTO t1(a) VALUES (1);\nERROR 4022 (23000): CONSTRAINT `a` failed for `test`.`t1`\n \nINSERT INTO t1(a,b) VALUES (3,4);\nERROR 4022 (23000): CONSTRAINT `a_greater` failed for\n`test`.`t1`\n \nINSERT INTO t1(a,b) VALUES (4,3);\nQuery OK, 1 row affected (0.04 sec)\n \nDropping a constraint:\n \nALTER TABLE t1 DROP CONSTRAINT a_greater;\n \nAdding a constraint:\n \nALTER TABLE t1 ADD CONSTRAINT a_greater CHECK (a>b);\n \nDate comparisons and character length:\n \nCREATE TABLE t2 (name VARCHAR(30) CHECK\n(CHAR_LENGTH(name)>2), start_date DATE, \n end_date DATE CHECK (start_date IS NULL OR end_date IS NULL\nOR start_date2)), start_date DATE, \n end_date DATE CHECK (start_date IS NULL OR end_date IS NULL\nOR start_date2 is very different to CHAR_LENGTH(name>2) as\nthe latter mistakenly performs a numeric comparison on the\nname field, leading to unexpected results.\n \n\n\nURL: https://mariadb.com/kb/en/library/constraint/','','https://mariadb.com/kb/en/library/constraint/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (651,39,'CREATE DATABASE','Syntax\n------ \nCREATE [OR REPLACE] {DATABASE | SCHEMA} [IF NOT EXISTS]\ndb_name\n [create_specification] ...\n \ncreate_specification:\n [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n \nDescription\n----------- \nCREATE DATABASE creates a database with the given name. To\nuse this statement, you need the CREATE privilege for the\ndatabase. CREATE SCHEMA is a synonym for CREATE DATABASE.\n \nFor valid identifiers to use as database names, see\nIdentifier Names.\n \nOR REPLACE\n \nThe OR REPLACE clause was added in MariaDB 10.1.3\n \nIf the optional OR REPLACE clause is used, it acts as a\nshortcut for:\n \nDROP DATABASE IF EXISTS db_name;\n \nCREATE DATABASE db_name ...;\n \nIF NOT EXISTS\n \nWhen the IF NOT EXISTS clause is used, MariaDB will return a\nwarning instead of an error if the specified database\nalready exists.\n \nExamples\n-------- \nCREATE DATABASE db1;\n \nQuery OK, 1 row affected (0.18 sec)\n \nCREATE DATABASE db1;\n \nERROR 1007 (HY000): Can\'t create database \'db1\'; database\nexists\n \nCREATE OR REPLACE DATABASE db1;\nQuery OK, 2 rows affected (0.00 sec)\n \nCREATE DATABASE IF NOT EXISTS db1;\nQuery OK, 1 row affected, 1 warning (0.01 sec)\n \nSHOW WARNINGS;\n+-------+------+----------------------------------------------+\n| Level | Code | Message |\n+-------+------+----------------------------------------------+\n| Note | 1007 | Can\'t create database \'db1\';\n database exists |\n+-------+------+----------------------------------------------+\n \nSetting the character sets and collation. See Setting\nCharacter Sets and Collations for more details.\n \nCREATE DATABASE czech_slovak_names \n CHARACTER SET = \'keybcs2\'\n COLLATE = \'keybcs2_bin\';\n \n\n\nURL: https://mariadb.com/kb/en/library/create-database/','','https://mariadb.com/kb/en/library/create-database/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (652,39,'CREATE EVENT','Syntax\n------ \nCREATE [OR REPLACE]\n [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n EVENT \n [IF NOT EXISTS]\n event_name \n ON SCHEDULE schedule\n [ON COMPLETION [NOT] PRESERVE]\n [ENABLE | DISABLE | DISABLE ON SLAVE]\n [COMMENT \'comment\']\n DO sql_statement;\n \nschedule:\n AT timestamp [+ INTERVAL interval] ...\n | EVERY interval \n [STARTS timestamp [+ INTERVAL interval] ...] \n [ENDS timestamp [+ INTERVAL interval] ...]\n \ninterval:\n quantity {YEAR | QUARTER | MONTH | DAY | HOUR | MINUTE |\n WEEK | SECOND | YEAR_MONTH | DAY_HOUR | DAY_MINUTE |\n DAY_SECOND | HOUR_MINUTE | HOUR_SECOND | MINUTE_SECOND}\n \nDescription\n----------- \nThis statement creates and schedules a new event. It\nrequires the\nEVENT privilege for the schema in which the event is to be\ncreated.\n \nThe minimum requirements for a valid CREATE EVENT statement\nare as\nfollows:\nThe keywords CREATE EVENT plus an event name, which uniquely\nidentifies\n the event in the current schema. (Prior to MySQL 5.1.12,\nthe event name\n needed to be unique only among events created by the same\nuser on a given\n database.)\nAn ON SCHEDULE clause, which determines when and how often\nthe event\n executes.\nA DO clause, which contains the SQL statement to be executed\nby an\n event.\n \nHere is an example of a minimal CREATE EVENT statement:\n \nCREATE EVENT myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;\n \nThe previous statement creates an event named myevent. This\nevent executes once\n— one hour following its creation\n— by running an SQL statement that increments the\nvalue of the myschema.mytable table\'s mycol column by 1.\n \nThe event_name must be a valid MariaDB identifier with a\nmaximum length\nof 64 characters. It may be delimited using back ticks, and\nmay be\nqualified with the name of a database schema. An event is\nassociated\nwith both a MariaDB user (the definer) and a schema, and its\nname must\nbe unique among names of events within that schema. In\ngeneral, the\nrules governing event names are the same as those for names\nof stored\nroutines. See Identifier Names.\n \nIf no schema is indicated as part of event_name, the default\n(current)\nschema is assumed.\n \nFor valid identifiers to use as event names, see Identifier\nNames.\n \nOR REPLACE\n \nThe OR REPLACE clause was included in MariaDB 10.1.4. If\nused and the event already exists, instead of an error being\nreturned, the existing event will be dropped and replaced by\nthe newly defined event.\n \nIF NOT EXISTS\n \nIf the IF NOT EXISTS clause is used, MariaDB will return a\nwarning instead of an error if the event already exists.\nCannot be used together with OR REPLACE.\n \nON SCHEDULE\n \nThe ON SCHEDULE clause can be used to specify when the event\nmust be triggered.\n \nAT\n \nIf you want to execute the event only once (one time event),\nyou can use the AT keyword, followed by a timestamp. If you\nuse CURRENT_TIMESTAMP, the event acts as soon as it is\ncreated. As a convenience, you can add one or more intervals\nto that timestamp. You can also specify a timestamp in the\npast, so that the event is stored but not triggered, until\nyou modify it via ALTER EVENT.\n \nThe following example shows how to create an event that will\nbe triggered tomorrow at a certain time:\n \nCREATE EVENT example\nON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY + INTERVAL\n3 HOUR\nDO something;\n \nYou can also specify that an event must be triggered at a\nregular interval (recurring event). In such cases, use the\nEVERY clause followed by the interval.\n \nIf an event is recurring, you can specify when the first\nexecution must happen via the STARTS clause and a maximum\ntime for the last execution via the ENDS clause. STARTS and\nENDS clauses are followed by a timestamp and, optionally,\none or more intervals. The ENDS clause can specify a\ntimestamp in the past, so that the event is stored but not\nexecuted until you modify it via ALTER EVENT.\n \nIn the following example, next month a recurring event will\nbe triggered hourly for a week:\n \nCREATE EVENT example\nON SCHEDULE EVERY 1 HOUR\nSTARTS CURRENT_TIMESTAMP + INTERVAL 1 MONTH\nENDS CURRENT_TIMESTAMP + INTERVAL 1 MONTH + INTERVAL 1 WEEK\nDO some_task;\n \nIntervals consist of a quantity and a time unit. The time\nunits are the same used for other staments and time\nfunctions, except that you can\'t use microseconds for\nevents. For simple time units, like HOUR or MINUTE, the\nquantity is an integer number, for example \'10 MINUTE\'.\nFor composite time units, like HOUR_MINUTE or HOUR_SECOND,\nthe quantity must be a string with all involved simple\nvalues and their separators, for example \'2:30\' or\n\'2:30:30\'.\n \nON COMPLETION [NOT] PRESERVE\n \nThe ON COMPLETION clause can be used to specify if the event\nmust be deleted after its last execution (that is, after its\nAT or ENDS timestamp is past). By default, events are\ndropped when they are expired. To explicitly state that this\nis the desired behaviour, you can use ON COMPLETION NOT\nPRESERVE. Instead, if you want the event to be preserved,\nyou can use ON COMPLETION PRESERVE.\n \nIn you specify ON COMPLETION NOT PRESERVE, and you specify a\ntimestamp in the past for AT or ENDS clause, the event will\nbe immediatly dropped. In such cases, you will get a Note\n1558: \"Event execution time is in the past and ON\nCOMPLETION NOT PRESERVE is set. The event was dropped\nimmediately after creation\".\n \nENABLE/DISABLE/DISABLE ON SLAVE\n \nEvents are ENABLEd by default. If you want to stop MariaDB\nfrom executing\nan event, you may specify DISABLE. When it is ready to be\nactivated, you\nmay enable it using ALTER EVENT. Another option is\nDISABLE ON SLAVE, which indicates that an event was created\non a master and has been replicated to the slave, which is\nprevented from executing the event. If DISABLE ON SLAVE is\nspecifically set, the event will not be executed.\n \nCOMMENT\n \nThe COMMENT clause may be used to set a comment for the\nevent. Maximum\nlength for comments is 64 characters. The comment is a\nstring, so it must be\nquoted. To see events comments, you can query the\nINFORMATION_SCHEMA.EVENTS table (the column is named\nEVENT_COMMENT).\n \nExamples\n-------- \nMinimal CREATE EVENT statement:\n \nCREATE EVENT myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;\n \nAn event that will be triggered tomorrow at a certain time:\n \nCREATE EVENT example\nON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY + INTERVAL\n3 HOUR\nDO something;\n \nNext month a recurring event will be triggered hourly for a\nweek:\n \nCREATE EVENT example\nON SCHEDULE EVERY 1 HOUR\nSTARTS CURRENT_TIMESTAMP + INTERVAL 1 MONTH\nENDS CURRENT_TIMESTAMP + INTERVAL 1 MONTH + INTERVAL 1 WEEK\nDO some_task;\n \nOR REPLACE and IF NOT EXISTS:\n \nCREATE EVENT myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;\n \nERROR 1537 (HY000): Event \'myevent\' already exists\n \nCREATE OR REPLACE EVENT myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;;\nQuery OK, 0 rows affected (0.00 sec)\n \nCREATE EVENT IF NOT EXISTS myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;\n \nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n \n SHOW WARNINGS;\n \n+-------+------+--------------------------------+\n| Level | Code | Message |\n+-------+------+--------------------------------+\n| Note | 1537 | Event \'myevent\' already exists |\n+-------+------+--------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/create-event/','','https://mariadb.com/kb/en/library/create-event/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (653,39,'CREATE FUNCTION','Syntax\n------ \nCREATE [OR REPLACE]\n [DEFINER = {user | CURRENT_USER | role | CURRENT_ROLE }]\n [AGGREGATE] FUNCTION [IF NOT EXISTS] func_name\n([func_parameter[,...]])\n RETURNS type\n [characteristic ...]\n RETURN func_body\n \nfunc_parameter:\n param_name type\n \ntype:\n Any valid MariaDB data type\n \ncharacteristic:\n LANGUAGE SQL\n | [NOT] DETERMINISTIC\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL\nDATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n \nfunc_body:\n Valid SQL procedure statement\n \nDescription\n----------- \nUse the CREATE FUNCTION statement to create a new stored\nfunction. You must have\nthe CREATE ROUTINE database privilege to use CREATE\nFUNCTION.\nA function takes any number of arguments and returns a value\nfrom the function body. The\nfunction body can be any valid SQL expression as you would\nuse, for example, in any select\nexpression. If you have the appropriate privileges, you can\ncall the function exactly as you\nwould any built-in function. See Security below for details\non privileges.\n \nYou can also use a variant of the CREATE FUNCTION statement\nto install a user-defined\nfunction (UDF) defined by a plugin. See CREATE FUNCTION\n(UDF)\nfor details.\n \nYou can use a SELECT statement for the function body by\nenclosing it in\nparentheses, exactly as you would to use a subselect for any\nother expression. The SELECT\nstatement must return a single value. If more than one\ncolumn is returned when the function is called,\nerror 1241 results. If more than one row is returned when\nthe function is called, error 1242\nresults. Use a LIMIT clause to ensure only one row is\nreturned.\n \nYou can also replace the RETURN clause with a BEGIN...END\ncompound\nstatement. The compound statement must contain a RETURN\nstatement. When the function is\ncalled, the RETURN statement immediately returns its result,\nand any statements after RETURN\nare effectively ignored.\n \nBy default, a function is associated with the default\ndatabase. To associate the function explicitly\nwith a given database, specify the fully-qualified name as\ndb_name.func_name\nwhen you create it. If the function name is the same as the\nname of a built-in function, you must\nuse the fully qualified name when you call it.\n \nThe parameter list enclosed within parentheses must always\nbe present.\nIf there are no parameters, an empty parameter list of ()\nshould be\nused. Parameter names are not case sensitive.\n \nEach parameter can be declared to use any valid data type,\nexcept that\nthe COLLATE attribute cannot be used.\n \nFor valid identifiers to use as function names, see\nIdentifier Names.\n \nAGGREGATE\n \nFrom MariaDB 10.3.3, it is possible to create stored\naggregate functions as well. See Stored Aggregate Functions\nfor details.\n \nRETURNS\n \nThe RETURNS clause specifies the return type of the\nfunction. NULL values are permitted with all return types.\n \nWhat happens if the RETURN clause returns a value of a\ndifferent type? It depends on the SQL_MODE in effect at the\nmoment of the function creation.\n \nIf the SQL_MODE is strict (STRICT_ALL_TABLES or\nSTRICT_TRANS_TABLES flags are specified), a 1366 error will\nbe produced.\n \nOtherwise, the value is coerced to the proper type. For\nexample, if a function\nspecifies an ENUM or SET value in the RETURNS clause, but\nthe RETURN\nclause returns an integer, the value returned from the\nfunction is the string for the corresponding ENUM\nmember of set of SET members.\n \nMariaDB stores the SQL_MODE system variable setting that is\nin effect at the\ntime a routine is created, and always executes the routine\nwith this setting in\nforce, regardless of the server SQL mode in effect when the\nroutine is invoked.\n \nLANGUAGE SQL\n \nLANGUAGE SQL is a standard SQL clause, and it can be used in\nMariaDB for portability. However that clause has no meaning,\nbecause SQL is the only supported language for stored\nfunctions.\n \nA function is deterministic if it can produce only one\nresult for a given list of parameters. If the result may be\naffected by stored data, server variables, random numbers or\nany value that is not explicitly passed, then the function\nis not deterministic. Also, a function is non-deterministic\nif it uses non-deterministic functions like NOW() or\nCURRENT_TIMESTAMP(). The optimizer may choose a faster\nexecution plan if it known that the function is\ndeterministic. In such cases, you should declare the routine\nusing the DETERMINISTIC keyword. If you want to explicitly\nstate that the function is not deterministic (which is the\ndefault) you can use the NOT DETERMINISTIC keywords.\n \nIf you declare a non-deterministic function as\nDETERMINISTIC, you may get incorrect results. If you declare\na deterministic function as NOT DETERMINISTIC, in some cases\nthe queries will be slower.\n \nOR REPLACE\n \nIf the optional OR REPLACE clause is used, it acts as a\nshortcut for:\n \nDROP FUNCTION IF EXISTS function_name;\n \nCREATE FUNCTION function_name ...;\n \nwith the exception that any existing privileges for the\nfunction are not dropped.\n \nIF NOT EXISTS\n \nIf the IF NOT EXISTS clause is used, MariaDB will return a\nwarning instead of an error if the function already exists.\nCannot be used together with OR REPLACE.\n \n[NOT] DETERMINISTIC\n \nThe [NOT] DETERMINISTIC clause also affects binary logging,\nbecause the STATEMENT format can not be used to store or\nreplicate non-deterministic statements.\n \nCONTAINS SQL, NO SQL, READS SQL DATA, and MODIFIES SQL DATA\nare informative clauses that tell the server what the\nfunction does. MariaDB does not check in any way whether the\nspecified clause is correct. If none of these clauses are\nspecified, CONTAINS SQL is used by default.\n \nMODIFIES SQL DATA\n \nMODIFIES SQL DATA means that the function contains\nstatements that may modify data stored in databases. This\nhappens if the function contains statements like DELETE,\nUPDATE, INSERT, REPLACE or DDL.\n \nREADS SQL DATA\n \nREADS SQL DATA means that the function reads data stored in\ndatabases, but does not modify any data. This happens if\nSELECT statements are used, but there no write operations\nare executed.\n \nCONTAINS SQL\n \nCONTAINS SQL means that the function contains at least one\nSQL statement, but it does not read or write any data stored\nin a database. Examples include SET or DO.\n \nNO SQL\n \nNO SQL means nothing, because MariaDB does not currently\nsupport any language other than SQL.\n \nOracle Mode\n \nFrom MariaDB 10.3, a subset of Oracle\'s PL/SQL language has\nbeen supported in addition to the traditional SQL/PSM-based\nMariaDB syntax. See Oracle mode from MariaDB 10.3 for\ndetails on changes when running Oracle mode.\n \nSecurity\n \nYou must have the EXECUTE privilege on a function to call\nit.\nMariaDB automatically grants the EXECUTE and ALTER ROUTINE\nprivileges to the\naccount that called CREATE FUNCTION, even if the DEFINER\nclause was used.\n \nEach function has an account associated as the definer. By\ndefault, the definer is the account\nthat created the function. Use the DEFINER clause to specify\na different account as the\ndefiner. You must have the SUPER privilege to use the\nDEFINER\nclause. See Account Names for details on specifying\naccounts.\n \nThe SQL SECURITY clause specifies what privileges are used\nwhen a function is called.\nIf SQL SECURITY is INVOKER, the function body will be\nevaluated using the privileges\nof the user calling the function. If SQL SECURITY is\nDEFINER, the function body is\nalways evaluated using the privileges of the definer\naccount. DEFINER is the default.\n \nThis allows you to create functions that grant limited\naccess to certain data. For example, say\nyou have a table that stores some employee information, and\nthat you\'ve granted SELECT\nprivileges only on certain columns to the user account\nroger.\n \nCREATE TABLE employees (name TINYTEXT, dept TINYTEXT, salary\nINT);\nGRANT SELECT (name, dept) ON employees TO roger;\n \nTo allow the user the get the maximum salary for a\ndepartment, define a function and grant\nthe EXECUTE privilege:\n \nCREATE FUNCTION max_salary (dept TINYTEXT) RETURNS INT\nRETURN\n (SELECT MAX(salary) FROM employees WHERE employees.dept =\ndept);\nGRANT EXECUTE ON FUNCTION max_salary TO roger;\n \nSince SQL SECURITY defaults to DEFINER, whenever the user\nroger calls\nthis function, the subselect will execute with your\nprivileges. As long as you have privileges to\nselect the salary of each employee, the caller of the\nfunction will be able to get the maximum\nsalary for each department without being able to see\nindividual salaries.\n \nCharacter sets and collations\n \nFunction return types can be declared to use any valid\ncharacter set and collation. If used, the COLLATE attribute\nneeds to be preceded by a CHARACTER SET attribute.\n \nIf the character set and collation are not specifically set\nin the statement, the database defaults at the time of\ncreation will be used. If the database defaults change at a\nlater stage, the stored function character set/collation\nwill not be changed at the same time; the stored function\nneeds to be dropped and recreated to ensure the same\ncharacter set/collation as the database is used.\n \nExamples\n-------- \nThe following example function takes a parameter, performs\nan operation using\nan SQL function, and returns the result.\n \nCREATE FUNCTION hello (s CHAR(20))\n RETURNS CHAR(50) DETERMINISTIC\n RETURN CONCAT(\'Hello, \',s,\'!\');\n \nSELECT hello(\'world\');\n+----------------+\n| hello(\'world\') |\n+----------------+\n| Hello, world! |\n+----------------+\n \nYou can use a compound statement in a function to manipulate\ndata with statements\nlike INSERT and UPDATE. The following example creates a\ncounter function\nthat uses a temporary table to store the current value.\nBecause the compound statement\ncontains statements terminated with semicolons, you have to\nfirst change the statement\ndelimiter with the DELIMITER statement to allow the\nsemicolon to be used in the\nfunction body. See Delimiters in the mysql client for more.\n \nCREATE TEMPORARY TABLE counter (c INT);\nINSERT INTO counter VALUES (0);\nDELIMITER //\nCREATE FUNCTION counter () RETURNS INT\n BEGIN\n UPDATE counter SET c = c + 1;\n \n RETURN (SELECT c FROM counter LIMIT 1);\n END //\nDELIMITER ;\n \nCharacter set and collation:\n \nCREATE FUNCTION hello2 (s CHAR(20))\n RETURNS CHAR(50) CHARACTER SET \'utf8\' COLLATE\n\'utf8_bin\' DETERMINISTIC\n RETURN CONCAT(\'Hello, \',s,\'!\');\n \n\n\nURL: https://mariadb.com/kb/en/library/create-function/','','https://mariadb.com/kb/en/library/create-function/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (654,39,'CREATE INDEX','Syntax\n------ \nCREATE [OR REPLACE] [UNIQUE|FULLTEXT|SPATIAL] INDEX \n [IF NOT EXISTS] index_name\n [index_type]\n ON tbl_name (index_col_name,...)\n [WAIT n | NOWAIT]\n [index_option]\n [algorithm_option | lock_option] ...\n \nindex_col_name:\n col_name [(length)] [ASC | DESC]\n \nindex_type:\n USING {BTREE | HASH | RTREE}\n \nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n \nalgorithm_option:\n ALGORITHM [=] {DEFAULT|INPLACE|COPY|NOCOPY|INSTANT}\n \nlock_option:\n LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n \nDescription\n----------- \nCREATE INDEX is mapped to an ALTER TABLE statement to create\nindexes.\nSee ALTER TABLE. CREATE INDEX cannot be used to create a\nPRIMARY KEY; use ALTER TABLE instead.\n \nIf another connection is using the table, a metadata lock is\nactive, and this statement will wait until the lock is\nreleased. This is also true for non-transactional tables.\n \nAnother shortcut, DROP INDEX, allows the removal of an\nindex.\n \nFor valid identifiers to use as index names, see Identifier\nNames.\n \nNote that KEY_BLOCK_SIZE is currently ignored in CREATE\nINDEX, although it is included in the output of SHOW CREATE\nTABLE.\n \nPrivileges\n \nExecuting the CREATE INDEX statement requires the INDEX\nprivilege for the table or the database.\n \nOnline DDL\n \nIn MariaDB 10.0 and later, online DDL is supported with the\nALGORITHM and LOCK clauses.\n \nSee InnoDB Online DDL Overview for more information on\nonline DDL with InnoDB.\n \nCREATE OR REPLACE INDEX ...\n \nThe OR REPLACE clause was added in MariaDB 10.1.4.\n \nIf the OR REPLACE clause is used and if the index already\nexists, then instead of returning an error, the server will\ndrop the existing index and replace it with the newly\ndefined index.\n \nCREATE INDEX IF NOT EXISTS ...\n \nIf the IF NOT EXISTS clause is used, then the index will\nonly be created if an index with the same name does not\nalready exist. If the index already exists, then a warning\nwill be triggered by default.\n \nIndex Definitions\n \nSee CREATE TABLE: Index Definitions for information about\nindex definitions.\n \nWAIT/NOWAIT\n \nSet the lock wait timeout. See WAIT and NOWAIT.\n \nALGORITHM\n \nSee ALTER TABLE: ALGORITHM for more information.\n \nLOCK\n \nSee ALTER TABLE: LOCK for more information.\n \nProgress Reporting\n \nMariaDB provides progress reporting for CREATE INDEX\nstatement for clients\nthat support the new progress reporting protocol. For\nexample, if you were using the mysql client, then the\nprogress report might look like this::\n \nCREATE INDEX ON tab (num);;\nStage: 1 of 2 \'copy to tmp table\' 46% of stage\n \nThe progress report is also shown in the output of the SHOW\nPROCESSLIST statement and in the contents of the\ninformation_schema.PROCESSLIST table.\n \nSee Progress Reporting for more information.\n \nExamples\n-------- \nCreating a unique index:\n \nCREATE UNIQUE INDEX HomePhone ON Employees(Home_Phone);\n \nOR REPLACE and IF NOT EXISTS:\n \nCREATE INDEX xi ON xx5 (x);\nQuery OK, 0 rows affected (0.03 sec)\n \nCREATE INDEX xi ON xx5 (x);\nERROR 1061 (42000): Duplicate key name \'xi\'\n \nCREATE OR REPLACE INDEX xi ON xx5 (x);\nQuery OK, 0 rows affected (0.03 sec)\n \nCREATE INDEX IF NOT EXISTS xi ON xx5 (x);\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n \nSHOW WARNINGS;\n \n+-------+------+-------------------------+\n| Level | Code | Message |\n+-------+------+-------------------------+\n| Note | 1061 | Duplicate key name \'xi\' |\n+-------+------+-------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/create-index/','','https://mariadb.com/kb/en/library/create-index/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (655,39,'CREATE PACKAGE','Oracle-style packages were introduced in MariaDB 10.3.5.\n \nSyntax\n------ \nCREATE\n [ OR REPLACE]\n [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n PACKAGE [ IF NOT EXISTS ]\n [ db_name . ] package_name\n [ package_characteristic ... ]\n{ AS | IS }\n [ package_specification_element ... ]\nEND [ package_name ]\n \npackage_characteristic:\n COMMENT \'string\'\n | SQL SECURITY { DEFINER | INVOKER }\n \npackage_specification_element:\n FUNCTION_SYM package_specification_function ;\n | PROCEDURE_SYM package_specification_procedure ;\n \npackage_specification_function:\n func_name [ ( func_param [, func_param]... ) ]\n RETURNS func_return_type\n [ package_routine_characteristic... ]\n \npackage_specification_procedure:\n proc_name [ ( proc_param [, proc_param]... ) ]\n [ package_routine_characteristic... ]\n \nfunc_return_type:\n type\n \nfunc_param:\n param_name type\n \nproc_param:\n param_name { IN | OUT | INOUT | IN OUT } type\n \ntype:\n Any valid MariaDB explicit or anchored data type\n \npackage_routine_characteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL\nDATA }\n | SQL SECURITY { DEFINER | INVOKER }\n \nDescription\n----------- \nThe CREATE PACKAGE statement can be used when Oracle\nSQL_MODE is set.\n \nThe CREATE PACKAGE creates the specification for a stored\npackage (a collection of logically related stored objects).\nA stored package specification declares public routines\n(procedures and functions) of the package, but does not\nimplement these routines.\n \nA package whose specification was created by the CREATE\nPACKAGE statement, should later be implemented using the\nCREATE PACKAGE BODY statement.\n \nExamples\n-------- \nSET sql_mode=ORACLE;\nDELIMITER $$\nCREATE OR REPLACE PACKAGE employee_tools AS\n FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);\n PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));\n PROCEDURE raiseSalaryStd(eid INT);\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));\nEND;\n$$\nDELIMITER ;\n \n\n\nURL: https://mariadb.com/kb/en/library/create-package/','','https://mariadb.com/kb/en/library/create-package/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (656,39,'CREATE PACKAGE BODY','Oracle-style packages were introduced in MariaDB 10.3.5.\n \nSyntax\n------ \nCREATE [ OR REPLACE ]\n [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n PACKAGE BODY\n [ IF NOT EXISTS ]\n [ db_name . ] package_name\n [ package_characteristic... ]\n{ AS | IS }\n package_implementation_declare_section\n package_implementation_executable_section\nEND [ package_name]\n \npackage_implementation_declare_section:\n package_implementation_item_declaration\n [ package_implementation_item_declaration... ]\n [ package_implementation_routine_definition... ]\n | package_implementation_routine_definition\n [ package_implementation_routine_definition...]\n \npackage_implementation_item_declaration:\n variable_declaration ;\n \nvariable_declaration:\n variable_name[,...] type [:= expr ]\n \npackage_implementation_routine_definition:\n FUNCTION package_specification_function\n [ package_implementation_function_body ] ;\n | PROCEDURE package_specification_procedure\n [ package_implementation_procedure_body ] ;\n \npackage_implementation_function_body:\n { AS | IS } package_routine_body [func_name]\n \npackage_implementation_procedure_body:\n { AS | IS } package_routine_body [proc_name]\n \npackage_routine_body:\n [ package_routine_declarations ]\n BEGIN\n statements [ EXCEPTION exception_handlers ]\n END\n \npackage_routine_declarations:\n package_routine_declaration \';\'\n[package_routine_declaration \';\']...\n \npackage_routine_declaration:\n variable_declaration\n | condition_name CONDITION FOR condition_value\n | user_exception_name EXCEPTION\n | CURSOR_SYM cursor_name\n [ ( cursor_formal_parameters ) ]\n IS select_statement\n ;\n \npackage_implementation_executable_section:\n END\n | BEGIN\n statement ; [statement ; ]...\n [EXCEPTION exception_handlers]\n END\n \nexception_handlers:\n exception_handler [exception_handler...]\n \nexception_handler:\n WHEN_SYM condition_value [, condition_value]...\n THEN_SYM statement ; [statement ;]...\n \ncondition_value:\n condition_name\n | user_exception_name\n | SQLWARNING\n | SQLEXCEPTION\n | NOT FOUND\n | OTHERS_SYM\n | SQLSTATE [VALUE] sqlstate_value\n | mariadb_error_code\n \n\nDescription\n----------- \nThe CREATE PACKAGE BODY statement can be used when Oracle\nSQL_MODE is set.\n \nThe CREATE PACKAGE BODY statement creates the package body\nfor a stored package. The package specification must be\npreviously created using the CREATE PACKAGE statement.\n \nA package body provides implementations of the package\npublic routines and can optionally have:\npackage-wide private variables\npackage private routines\nforward declarations for private routines\nan executable initialization section\n \nExamples\n-------- \nSET sql_mode=ORACLE;\nDELIMITER $$\nCREATE OR REPLACE PACKAGE employee_tools AS\n FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);\n PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));\n PROCEDURE raiseSalaryStd(eid INT);\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));\nEND;\n$$\nCREATE PACKAGE BODY employee_tools AS\n -- package body variables\n stdRaiseAmount DECIMAL(10,2):=500;\n \n -- private routines\n PROCEDURE log (eid INT, ecmnt TEXT) AS\n BEGIN\n INSERT INTO employee_log (id, cmnt) VALUES (eid, ecmnt);\n END;\n \n -- public routines\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2)) AS\n eid INT;\n BEGIN\n INSERT INTO employee (name, salary) VALUES (ename,\nesalary);\n eid:= last_insert_id();\n log(eid, \'hire \' || ename);\n END;\n \n FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2) AS\n nSalary DECIMAL(10,2);\n BEGIN\n SELECT salary INTO nSalary FROM employee WHERE id=eid;\n log(eid, \'getSalary id=\' || eid || \' salary=\' ||\nnSalary);\n RETURN nSalary;\n END;\n \n PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2)) AS\n BEGIN\n UPDATE employee SET salary=salary+amount WHERE id=eid;\n log(eid, \'raiseSalary id=\' || eid || \' amount=\' ||\namount);\n END;\n \n PROCEDURE raiseSalaryStd(eid INT) AS\n BEGIN\n raiseSalary(eid, stdRaiseAmount);\n log(eid, \'raiseSalaryStd id=\' || eid);\n END;\n \nBEGIN\n -- This code is executed when the current session\n -- accesses any of the package routines for the first time\n log(0, \'Session \' || connection_id() || \' \' ||\ncurrent_user || \' started\');\nEND;\n$$\n \nDELIMITER ;\n \n\n\nURL: https://mariadb.com/kb/en/library/create-package-body/','','https://mariadb.com/kb/en/library/create-package-body/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (657,39,'CREATE PROCEDURE','Syntax\n------ \nCREATE\n [OR REPLACE]\n [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n PROCEDURE sp_name ([proc_parameter[,...]])\n [characteristic ...] routine_body\n \nproc_parameter:\n [ IN | OUT | INOUT ] param_name type\n \ntype:\n Any valid MariaDB data type\n \ncharacteristic:\n LANGUAGE SQL\n | [NOT] DETERMINISTIC\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL\nDATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n \nroutine_body:\n Valid SQL procedure statement\n \nDescription\n----------- \nCreates a stored procedure. By default, a routine is\nassociated with the default database. To associate the\nroutine\nexplicitly with a given database, specify the name as\ndb_name.sp_name\nwhen you create it.\n \nWhen the routine is invoked, an implicit USE db_name is\nperformed (and\nundone when the routine terminates). The causes the routine\nto have\nthe given default database while it executes. USE statements\nwithin\nstored routines are disallowed.\n \nWhen a stored procedure has been created, you invoke it by\nusing the CALL statement (see CALL).\n \nTo execute the CREATE PROCEDURE statement, it is\nnecessary to have the CREATE ROUTINE privilege. By default,\nMariaDB\nautomatically grants the ALTER ROUTINE and EXECUTE\nprivileges to the\nroutine creator. See also Stored Routine Privileges.\n \nThe DEFINER and SQL SECURITY clauses specify the security\ncontext to\nbe used when checking access privileges at routine execution\ntime, as\ndescribed later.\n \nIf the routine name is the same as the name of a built-in\nSQL\nfunction, you must use a space between the name and the\nfollowing\nparenthesis when defining the routine, or a syntax error\noccurs. This\nis also true when you invoke the routine later. For this\nreason, we\nsuggest that it is better to avoid re-using the names of\nexisting SQL\nfunctions for your own stored routines.\n \nThe IGNORE_SPACE SQL mode applies to built-in functions, not\nto stored\nroutines. It is always allowable to have spaces after a\nroutine name,\nregardless of whether IGNORE_SPACE is enabled.\n \nThe parameter list enclosed within parentheses must always\nbe present.\nIf there are no parameters, an empty parameter list of ()\nshould be\nused. Parameter names are not case sensitive.\n \nEach parameter can be declared to use any valid data type,\nexcept that\nthe COLLATE attribute cannot be used.\n \nFor valid identifiers to use as procedure names, see\nIdentifier Names.\n \nIN/OUT/INOUT\n \nEach parameter is an IN parameter by default. To specify\notherwise for\na parameter, use the keyword OUT or INOUT before the\nparameter name.\n \nAn IN parameter passes a value into a procedure. The\nprocedure might\nmodify the value, but the modification is not visible to the\ncaller\nwhen the procedure returns. An OUT parameter passes a value\nfrom the\nprocedure back to the caller. Its initial value is NULL\nwithin the\nprocedure, and its value is visible to the caller when the\nprocedure\nreturns. An INOUT parameter is initialized by the caller,\ncan be\nmodified by the procedure, and any change made by the\nprocedure is\nvisible to the caller when the procedure returns.\n \nFor each OUT or INOUT parameter, pass a user-defined\nvariable in the\nCALL statement that invokes the procedure so that you can\nobtain its\nvalue when the procedure returns. If you are calling the\nprocedure\nfrom within another stored procedure or function, you can\nalso pass a\nroutine parameter or local routine variable as an IN or\nINOUT\nparameter.\n \nDETERMINISTIC/NOT DETERMINISTIC\n \nDETERMINISTIC and NOT DETERMINISTIC apply only to functions.\nSpecifying DETERMINISTC or NON-DETERMINISTIC in procedures\nhas no effect. The default value is NOT DETERMINISTIC.\nFunctions are DETERMINISTIC when they always return the same\nvalue for the same input. For example, a truncate or\nsubstring function. Any function involving data, therefore,\nis always NOT DETERMINISTIC.\n \nCONTAINS SQL/NO SQL/READS SQL DATA/MODIFIES SQL DATA\n \nCONTAINS SQL, NO SQL, READS SQL DATA, and MODIFIES SQL DATA\nare informative clauses that tell the server what the\nfunction does. MariaDB does not check in any way whether the\nspecified clause is correct. If none of these clauses are\nspecified, CONTAINS SQL is used by default.\n \nMODIFIES SQL DATA means that the function contains\nstatements that may modify data stored in databases. This\nhappens if the function contains statements like DELETE,\nUPDATE, INSERT, REPLACE or DDL.\n \nREADS SQL DATA means that the function reads data stored in\ndatabases, but does not modify any data. This happens if\nSELECT statements are used, but there no write operations\nare executed.\n \nCONTAINS SQL means that the function contains at least one\nSQL statement, but it does not read or write any data stored\nin a database. Examples include SET or DO.\n \nNO SQL means nothing, because MariaDB does not currently\nsupport any language other than SQL.\n \nThe routine_body consists of a valid SQL procedure\nstatement. This can\nbe a simple statement such as SELECT or INSERT, or it can be\na\ncompound statement written using BEGIN and END. Compound\nstatements\ncan contain declarations, loops, and other control structure\nstatements. See Programmatic and Compound Statements for\nsyntax details.\n \nMariaDB allows routines to contain DDL statements, such as\nCREATE and\nDROP. MariaDB also allows stored procedures (but not stored\nfunctions)\nto contain SQL transaction statements such as COMMIT.\n \nFor additional information about statements that are not\nallowed in\nstored routines, see Stored Routine Limitations.\n \nInvoking stored procedure from within programs\n \nFor information about invoking stored procedures from within\nprograms written in a language that has a MariaDB/MySQL\ninterface, see CALL.\n \nOR REPLACE\n \nIf the optional OR REPLACE clause is used, it acts as a\nshortcut for:\n \nDROP PROCEDURE IF EXISTS name;\n \nCREATE PROCEDURE name ...;\n \nwith the exception that any existing privileges for the\nprocedure are not dropped.\n \nsql_mode\n \nMariaDB stores the sql_mode system variable setting that is\nin effect at the time a routine is created, and always\nexecutes the routine with this setting in force, regardless\nof the server SQL mode in effect when the routine is\ninvoked.\n \nCharacter Sets and Collations\n \nProcedure parameters can be declared with any character\nset/collation. If the character set and collation are not\nspecifically set, the database defaults at the time of\ncreation will be used. If the database defaults change at a\nlater stage, the stored procedure character set/collation\nwill not be changed at the same time; the stored procedure\nneeds to be dropped and recreated to ensure the same\ncharacter set/collation as the database is used.\n \nOracle Mode\n \nFrom MariaDB 10.3, a subset of Oracle\'s PL/SQL language has\nbeen supported in addition to the traditional SQL/PSM-based\nMariaDB syntax. See Oracle mode from MariaDB 10.3 for\ndetails on changes when running Oracle mode.\n \nExamples\n-------- \nThe following example shows a simple stored procedure that\nuses an OUT\nparameter. It uses the DELIMITER command to set a new\ndelimiter for the duration of the process — see Delimiters\nin the mysql client.\n \nDELIMITER //\n \nCREATE PROCEDURE simpleproc (OUT param1 INT)\n BEGIN\n SELECT COUNT(*) INTO param1 FROM t;\n END;\n//\n \nDELIMITER ;\n \nCALL simpleproc(@a);\n \nSELECT @a;\n+------+\n| @a |\n+------+\n| 1 |\n+------+\n \nCharacter set and collation:\n \nDELIMITER //\n \nCREATE PROCEDURE simpleproc2 (\n OUT param1 CHAR(10) CHARACTER SET \'utf8\' COLLATE\n\'utf8_bin\'\n)\n BEGIN\n SELECT CONCAT(\'a\'),f1 INTO param1 FROM t;\n END;\n//\n \nDELIMITER ;\n \nCREATE OR REPLACE:\n \nDELIMITER //\n \nCREATE PROCEDURE simpleproc2 (\n OUT param1 CHAR(10) CHARACTER SET \'utf8\' COLLATE\n\'utf8_bin\'\n)\n BEGIN\n SELECT CONCAT(\'a\'),f1 INTO param1 FROM t;\n \n END;\n \n//\nERROR 1304 (42000): PROCEDURE simpleproc2 already exists\n \nDELIMITER ;\n \nDELIMITER //\n \nCREATE OR REPLACE PROCEDURE simpleproc2 (\n OUT param1 CHAR(10) CHARACTER SET \'utf8\' COLLATE\n\'utf8_bin\'\n)\n BEGIN\n SELECT CONCAT(\'a\'),f1 INTO param1 FROM t;\n \n END;\n \n//\nERROR 1304 (42000): PROCEDURE simpleproc2 already exists\n \nDELIMITER ;\n \nQuery OK, 0 rows affected (0.03 sec)\n \n\n\nURL: https://mariadb.com/kb/en/library/create-procedure/','','https://mariadb.com/kb/en/library/create-procedure/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (658,39,'CREATE SEQUENCE','CREATE SEQUENCE was introduced in MariaDB 10.3.\n \nSyntax\n------ \nCREATE [OR REPLACE] [TEMPORARY] SEQUENCE [IF NOT EXISTS]\nsequence_name\n[ INCREMENT [ BY | = ] increment ]\n[ MINVALUE [=] minvalue | NO MINVALUE | NOMINVALUE ]\n[ MAXVALUE [=] maxvalue | NO MAXVALUE | NOMAXVALUE ]\n[ START [ WITH | = ] start ] \n[ CACHE [=] cache | NOCACHE ] [ CYCLE | NOCYCLE] \n[table_options]\n \nThe options for CREATE SEQUENCE can be given in any order,\noptionally followed by table_options.\n \ntable_options can be any of the normal table options in\nCREATE TABLE but the most usable ones are ENGINE=... and\nCOMMENT=.\n \nNOMAXVALUE and NOMINVALUE are there to allow one to create\nSEQUENCEs using the Oracle syntax.\n \nDescription\n----------- \nCREATE SEQUENCE will create a sequence that generates new\nvalues when called with NEXT VALUE FOR sequence_name. It\'s\nan alternative to AUTO INCREMENT when one wants to have more\ncontrol of how the numbers are generated. As the SEQUENCE\ncaches values (up to CACHE) it can in some cases be much\nfaster than AUTO INCREMENT. Another benefit is that one can\naccess the last value generated by all used sequences, which\nsolves one of the limitations with LAST_INSERT_ID().\n \nCREATE SEQUENCE requires the CREATE privilege.\n \nDROP SEQUENCE can be used to drop a sequence, and ALTER\nSEQUENCE to change it.\n \nArguments to Create\n \nThe following options may be used:\n \nOption | Default value |  Description | \n \nINCREMENT |  1 | Increment to use for values. May be\nnegative. Setting an increment of 0 causes the sequence to\nuse the value of the auto_increment_increment system\nvariable at the time of creation, which is always a positive\nnumber. (see MDEV-16035). | \n \nMINVALUE | 1 if INCREMENT > 0 and -9223372036854775807 if\nINCREMENT < 0 | Minimum value for the sequence | \n \nMAXVALUE | 9223372036854775806 if INCREMENT > 0 and -1 if\nINCREMENT < 0 | Max value for sequence | \n \nSTART | MINVALUE if INCREMENT > 0 and MAX_VALUE if\nINCREMENT< 0 | First value that the sequence will generate |\n\n \nCACHE | 1000 |  Number of values that should be cached. 0\nif no CACHE. The underlying table will be updated first time\na new sequence number is generated and each time the cache\nruns out. | \n \nIf CYCLE is used then the sequence should start again from\nMINVALUE after it has run out of values. Default value is\nNOCYCLE.\n \nConstraints on Create Arguments\n \nTo be able to create a legal sequence, the following must\nhold:\nMAXVALUE >= start\nMAXVALUE > MINVALUE\nSTART >= MINVALUE\nMAXVALUE = -9223372036854775807 (LONGLONG_MIN+1)\n \nNote that sequences can\'t generate the maximum/minimum 64\nbit number because of the constraint of\nMINVALUE and MAXVALUE. \n \nExamples\n-------- \nCREATE SEQUENCE s START WITH 100 INCREMENT BY 10;\n \nCREATE SEQUENCE s2 START WITH -100 INCREMENT BY -10;\n \nThe following statement fails, as the increment conflicts\nwith the defaults\n \nCREATE SEQUENCE s3 START WITH -100 INCREMENT BY 10;\n \nERROR 4082 (HY000): Sequence \'test.s3\' values are\nconflicting\n \nThe sequence can be created by specifying workable minimum\nand maximum values:\n \nCREATE SEQUENCE s3 START WITH -100 INCREMENT BY 10\nMINVALUE=-100 MAXVALUE=1000;\n \n\n\nURL: https://mariadb.com/kb/en/library/create-sequence/','','https://mariadb.com/kb/en/library/create-sequence/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (659,39,'CREATE SERVER','Syntax\n------ \nCREATE [OR REPLACE] SERVER [IF NOT EXISTS] server_name\n FOREIGN DATA WRAPPER wrapper_name\n OPTIONS (option [, option] ...)\n \noption:\n { HOST character-literal\n | DATABASE character-literal\n | USER character-literal\n | PASSWORD character-literal\n | SOCKET character-literal\n | OWNER character-literal\n | PORT numeric-literal }\n \nDescription\n----------- \nThis statement creates the definition of a server for use\nwith the Spider,\nFEDERATED or FederatedX storage\nengine. The CREATE SERVER statement creates a new row within\nthe\nservers table within the mysql database. This statement\nrequires the SUPER privilege.\n \nThe server_name should be a unique reference to the server.\nServer definitions\nare global within the scope of the server, it is not\npossible to qualify the\nserver definition to a specific database. server_name has a\nmaximum length of\n64 characters (names longer than 64 characters are silently\ntruncated), and is\ncase insensitive. You may specify the name as a quoted\nstring.\n \nThe wrapper_name should be mysql, and may be quoted with\nsingle quotes.\nOther values for wrapper_name are not currently supported.\n \nFor each option you must specify either a character literal\nor numeric literal.\nCharacter literals are UTF-8, support a maximum length of 64\ncharacters and\ndefault to a blank (empty) string. String literals are\nsilently truncated to 64\ncharacters. Numeric literals must be a number between 0 and\n9999, default value\nis 0.\n \nNote: The OWNER option is currently not applied, and has no\neffect on\nthe ownership or operation of the server connection that is\ncreated.\n \nThe CREATE SERVER statement creates an entry in the\nmysql.servers table that can later be used with the\nCREATE TABLE statement when creating a Spider, FederatedX or\nFEDERATED table. The options that you specify will\nbe used to populate the columns in the mysql.servers table.\nThe table columns\nare Server_name, Host, Db, Username, Password, Port and\nSocket.\n \n DROP SERVER removes a previously created server definition.\n\n \nCREATE SERVER is not written to the binary log, irrespective\nof\nthe binary log format being used.\n \nFor valid identifiers to use as server names, see Identifier\nNames.\n \nOR REPLACE\n \nIf the optional OR REPLACE clause is used, it acts as a\nshortcut for:\n \nDROP SERVER IF EXISTS name;\n \nCREATE SERVER server_name ...;\n \nIF NOT EXISTS\n \nIf the IF NOT EXISTS clause is used, MariaDB will return a\nwarning instead of an error if the server already exists.\nCannot be used together with OR REPLACE.\n \nExamples\n-------- \nCREATE SERVER s\nFOREIGN DATA WRAPPER mysql\nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE\n\'test\');\n \nOR REPLACE and IF NOT EXISTS:\n \nCREATE SERVER s \nFOREIGN DATA WRAPPER mysql \nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE\n\'test\');\nERROR 1476 (HY000): The foreign server, s, you are trying to\ncreate already exists\n \nCREATE OR REPLACE SERVER s \nFOREIGN DATA WRAPPER mysql \nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE\n\'test\');\nQuery OK, 0 rows affected (0.00 sec)\n \nCREATE SERVER IF NOT EXISTS s \nFOREIGN DATA WRAPPER mysql \nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE\n\'test\');\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n \nSHOW WARNINGS;\n \n+-------+------+----------------------------------------------------------------+\n| Level | Code | Message |\n+-------+------+----------------------------------------------------------------+\n| Note | 1476 | The foreign server, s, you are trying to\ncreate already exists |\n+-------+------+----------------------------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/create-server/','','https://mariadb.com/kb/en/library/create-server/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (660,39,'CREATE TABLE','Syntax\n------ \nCREATE [OR REPLACE] [TEMPORARY] TABLE [IF NOT EXISTS]\ntbl_name\n (create_definition,...) [table_options ]...\n[partition_options]\nCREATE [OR REPLACE] [TEMPORARY] TABLE [IF NOT EXISTS]\ntbl_name\n [(create_definition,...)] [table_options ]...\n[partition_options]\n select_statement\nCREATE [OR REPLACE] [TEMPORARY] TABLE [IF NOT EXISTS]\ntbl_name\n { LIKE old_table_name | (LIKE old_table_name) }\n \nselect_statement:\n [IGNORE | REPLACE] [AS] SELECT ... (Some legal select\nstatement)\n \nDescription\n----------- \nUse the CREATE TABLE statement to create a table with the\ngiven name.\n \nIn its most basic form, the CREATE TABLE statement provides\na table name\nfollowed by a list of columns, indexes, and constraints. By\ndefault, the table\nis created in the default database. Specify a database with\ndb_name.tbl_name.\nIf you quote the table name, you must quote the database\nname and table name\nseparately as `db_name`.`tbl_name`. This is particularly\nuseful for CREATE TABLE ... SELECT, because it allows to\ncreate a table into a database, which contains data from\nother databases. See Identifier Qualifiers.\n \nIf a table with the same name exists, error 1050 results.\nUse IF NOT EXISTS\nto suppress this error and issue a note instead. Use SHOW\nWARNINGS\nto see notes.\n \nThe CREATE TABLE statement automatically commits the current\ntransaction,\nexcept when using the TEMPORARY keyword.\n \nFor valid identifiers to use as table names, see Identifier\nNames.\n \nNote: if the default_storage_engine is set to ColumnStore\nthen it needs setting on all UMs. Otherwise when the tables\nusing the default engine are replicated across UMs they will\nuse the wrong engine. You should therefore not use this\noption as a session variable with ColumnStore.\n \nMicrosecond precision can be between 0-6. If no precision is\nspecified it is assumed to be 0, for backward compatibility\nreasons.\n \nPrivileges\n \nExecuting the CREATE TABLE statement requires the CREATE\nprivilege for the table or the database.\n \nCREATE OR REPLACE TABLE ...\n \nThe OR REPLACE clause was added in MariaDB 10.0.8.\n \nIf the OR REPLACE clause is used and if the table already\nexists, then instead of returning an error, the server will\ndrop the existing table and replace it with the newly\ndefined table.\n \nThis syntax was originally added to make replication more\nrobust if it has to rollback and repeat statements such as\nCREATE ... SELECT on slaves.\n \nCREATE OR REPLACE TABLE table_name (a int);\n \nis basically the same as:\n \nDROP TABLE IF EXISTS table_name;\nCREATE TABLE table_name (a int);\n \nwith the following exceptions:\nIf table_name was locked with LOCK TABLES it will continue\nto be locked after the statement.\nTemporary tables are only dropped if the TEMPORARY keyword\nwas used. (With DROP TABLE, temporary tables are preferred\nto be dropped before normal tables).\n \nThings to be Aware of With CREATE OR REPLACE\n \nThe table is dropped first (if it existed), after that the\nCREATE is done. Because of this, if the CREATE fails, then\nthe table will not exist anymore after the statement. If the\ntable was used with LOCK TABLES it will be unlocked.\nOne can\'t use OR REPLACE together with IF EXISTS.\nSlaves in replication will by default use CREATE OR REPLACE\nwhen replicating CREATE statements that don\'\'t use IF\nEXISTS. This can be changed by setting the variable\nslave-ddl-exec-mode to STRICT.\n \nCREATE TABLE IF NOT EXISTS ...\n \nIf the IF NOT EXISTS clause is used, then the index will\nonly be created if an index with the same name does not\nalready exist. If the index already exists, then a warning\nwill be triggered by default.\n \nCREATE TEMPORARY TABLE ...\n \nUse the TEMPORARY keyword to create a temporary table that\nis only available to your current session. Temporary tables\nare dropped when the your session ends. Temporary table\nnames are specific to your session. They will not conflict\nwith other temporary tables from other session even if they\nshare the same name. They will shadow names of non-temporary\ntables or views, if they are identical. A temporary table\ncan have the same name as a non-temporary table which is\nlocated in the same database. In that case, their name will\nreference the temporary table when used in SQL statements.\nYou must have the CREATE TEMPORARY TABLES privilege on the\ndatabase to create temporary tables. If no storage engine is\nspecified, the default_tmp_storage_engine setting will\ndetermine the engine.\n \nCREATE TABLE ... LIKE\n \nUse the LIKE clause instead of a full table definition to\ncreate a table with the same definition as another table,\nincluding columns, indexes, and table options. Foreign key\ndefinitions, as well as any DATA DIRECTORY or INDEX\nDIRECTORY table options specified on the original table,\nwill not be created.\n \nCREATE TABLE ... SELECT\n \nYou can create a table containing data from other tables\nusing the CREATE ... SELECT statement. Columns will be\ncreated in the table for each field returned by the SELECT\nquery.\n \nYou can also define some columns normally and add other\ncolumns from a SELECT. You can also create columns in the\nnormal way and assign them some values using the query, this\nis done to force a certain type or other field\ncharacteristics. The columns that are not named in the query\nwill be placed before the others. For example:\n \nCREATE TABLE test (a INT NOT NULL, b CHAR(10)) ENGINE=MyISAM\n SELECT 5 AS b, c, d FROM another_table;\n \nRemember that the query just returns data. If you want to\nuse the same indexes, or the same columns attributes ([NOT]\nNULL, DEFAULT, AUTO_INCREMENT) in the new table, you need to\nspecify them manually. Types and sizes are not automatically\npreserved if no data returned by the SELECT requires the\nfull size, and VARCHAR could be converted into CHAR. The\nCAST() function can be used to forcee the new table to use\ncertain types.\n \nAliases (AS) are taken into account, and they should always\nbe used when you SELECT an expression (function,\narithmetical operation, etc).\n \nIf an error occurs during the query, the table will not be\ncreated at all.\n \nIf the new table has a primary key or UNIQUE indexes, you\ncan use the IGNORE or REPLACE keywords to handle duplicate\nkey errors during the query. IGNORE means that the newer\nvalues must not be inserted an identical value exists in the\nindex. REPLACE means that older values must be overwritten.\n \nIf the columns in the new table are more than the rows\nreturned by the query, the columns populated by the query\nwill be placed after other columns. Note that if the strict\nSQL_MODE is on, and the columns that are not names in the\nquery do not have a DEFAULT value, an error will raise and\nno rows will be copied.\n \nConcurrent inserts are not used during the execution of a\nCREATE ... SELECT.\n \nIf the table already exists, an error similar to the\nfollowing will be returned:\n \nERROR 1050 (42S01): Table \'t\' already exists\n \nIf the IF NOT EXISTS clause is used and the table exists, a\nnote will be produced instead of an error.\n \nTo insert rows from a query into an existing table, INSERT\n... SELECT can be used.\n \nColumn Definitions\n \ncreate_definition:\n { col_name column_definition | index_definition |\nperiod_definition | CHECK (expr) }\n \ncolumn_definition:\n data_type\n [NOT NULL | NULL] [DEFAULT default_value | (expression)]\n [AUTO_INCREMENT] [ZEROFILL] [UNIQUE [KEY] | [PRIMARY] KEY]\n [INVISIBLE] [{WITH|WITHOUT} SYSTEM VERSIONING]\n [COMMENT \'string\']\n [COLUMN_FORMAT {FIXED|DYNAMIC|DEFAULT}]\n [reference_definition]\n | data_type [GENERATED ALWAYS] AS { { ROW {START|END} } | {\n(expression) [VIRTUAL | PERSISTENT | STORED] } }\n [UNIQUE [KEY]] [COMMENT \'string\']\n \nconstraint_definition:\n CONSTRAINT [constraint_name] CHECK (expression)\nNote: MariaDB accepts the REFERENCES clause in ALTER TABLE\nand CREATE TABLE column definitions, but that syntax does\nnothing. MariaDB simply parses it without returning any\nerror or warning, for compatibility with other DBMS\'s.\nBefore MariaDB 10.2.1 this was also true for CHECK\nconstraints. Only the syntax for indexes described below\ncreates foreign keys.\n \nEach definition either creates a column in the table or\nspecifies and index or\nconstraint on one or more columns. See Indexes below for\ndetails\non creating indexes.\n \nCreate a column by specifying a column name and a data type,\noptionally\nfollowed by column options. See Data Types for a full list\nof data types allowed in MariaDB.\n \nNULL and NOT NULL\n \nUse the NULL or NOT NULL options to specify that values in\nthe column\nmay or may not be NULL, respectively. By default, values may\nbe NULL. See also NULL Values in MariaDB.\n \nDEFAULT Column Option\n \nThe DEFAULT clause was enhanced in MariaDB 10.2.1. Some\nenhancements include\nBLOB and TEXT columns now support DEFAULT.\nThe DEFAULT clause can now be used with an expression or\nfunction.\n \nSpecify a default value using the DEFAULT clause. If you\ndon\'t specify DEFAULT then the following rules apply:\nIf the column is not defined with NOT NULL, AUTO_INCREMENT\nor TIMESTAMP, an explicit DEFAULT NULL will be added.\nNote that in MySQL and in MariaDB before 10.1.6, you may get\nan explicit DEFAULT for primary key parts, if not specified\nwith NOT NULL.\n \nThe default value will be used if you INSERT a row without\nspecifying a value for that column, or if you specify\nDEFAULT for that column.\nBefore MariaDB 10.2.1 you couldn\'t usually provide an\nexpression or function to evaluate at\ninsertion time. You had to provide a constant default value\ninstead. The one\nexception is that you may use CURRENT_TIMESTAMP as\nthe default value for a TIMESTAMP column to use the current\ntimestamp at insertion time.\n \nCURRENT_TIMESTAMP may also be used as\nthe default value for a DATETIME\n \nFrom MariaDB 10.2.1 you can use most functions in DEFAULT.\nExpressions should have parentheses around them. If you use\na non deterministic function in DEFAULT then all inserts to\nthe table will be replicated in row mode. You can even refer\nto earlier columns in the DEFAULT expression:\n \nCREATE TABLE t1 (a int DEFAULT (1+1), b int DEFAULT (a+1));\nCREATE TABLE t2 (a bigint primary key DEFAULT UUID_SHORT());\n \nThe DEFAULT clause cannot contain any stored functions or\nsubqueries, and a column used in the clause must already\nhave been defined earlier in the statement.\n \nSince MariaDB 10.2.1, it is possible to assign BLOB or TEXT\ncolumns a DEFAULT value. In earlier versions, assigning a\ndefault to these columns was not possible.\n \nStarting from 10.3.3 you can also use DEFAULT (NEXT VALUE\nFOR sequence)\n \nAUTO_INCREMENT Column Option\n \nUse AUTO_INCREMENT to create a column whose value can\ncan be set automatically from a simple counter. You can only\nuse AUTO_INCREMENT\non a column with an integer type. The column must be a key,\nand there can only be\none AUTO_INCREMENT column in a table. If you insert a row\nwithout specifying\na value for that column (or if you specify 0, NULL, or\nDEFAULT\nas the value), the actual value will be taken from the\ncounter, with each insertion\nincrementing the counter by one. You can still insert a\nvalue explicitly. If you\ninsert a value that is greater than the current counter\nvalue, the counter is\nset based on the new value. An AUTO_INCREMENT column is\nimplicitly NOT NULL.\nUse LAST_INSERT_ID to get the AUTO_INCREMENT value\nmost recently used by an INSERT statement.\n \nZEROFILL Column Option\n \nIf the ZEROFILL column option is specified for a column\nusing a numeric data type, then the column will be set to\nUNSIGNED and the spaces used by default to pad the field are\nreplaced with zeros. ZEROFILL is ignored in expressions or\nas part of a UNION. ZEROFILL is a non-standard MySQL and\nMariaDB enhancement.\n \nPRIMARY KEY Column Option\n \nUse PRIMARY KEY (or just KEY) to make a column a primary\nkey. A primary key is a special type of a unique key. There\ncan be at most one primary key per table, and it is\nimplicitly NOT NULL.\n \nSpecifying a column as a unique key creates a unique index\non that column. See the Index Definitions section below for\nmore information.\n \nUNIQUE KEY Column Option\n \nUse UNIQUE KEY (or just UNIQUE) to specify that all values\nin the column\nmust be distinct from each other. Unless the column is NOT\nNULL, there may be\nmultiple rows with NULL in the column. \n \nSpecifying a column as a unique key creates a unique index\non that column. See the Index Definitions section below for\nmore information.\n \nCOMMENT Column Option\n \nYou can provide a comment for each column using the COMMENT\nclause. The maximum length is 1024 characters (it was 255\ncharacters before MariaDB 5.5). Use\nthe SHOW FULL COLUMNS statement to see column comments.\n \nGenerated Columns\n \nA generated column is a column in a table that cannot\nexplicitly be set to a specific value in a DML query.\nInstead, its value is automatically generated based on an\nexpression. This expression might generate the value based\non the values of other columns in the table, or it might\ngenerate the value by calling built-in functions or\nuser-defined functions (UDFs).\n \nThere are two types of generated columns:\nPERSISTENT or STORED: This type\'s value is actually stored\nin the table.\nVIRTUAL: This type\'s value is not stored at all. Instead,\nthe value is generated dynamically when the table is\nqueried. This type is the default.\n \nGenerated columns are also sometimes called computed columns\nor virtual columns.\n \nFor a complete description about generated columns and their\nlimitations, see Generated (Virtual and Persistent/Stored)\nColumns.\n \nCOLUMN_FORMAT\n \nCOLUMN_FORMAT is only used by MySQL Cluster, and is silently\nignored in MariaDB.\n \nCOMPRESSED\n \nCertain columns may be compressed. See Storage-Engine\nIndependent Column Compression.\n \nINVISIBLE\n \nColumns may be made invisible, and hidden in certain\ncontexts. See Invisible Columns.\n \nWITH SYSTEM VERSIONING Column Option\n \nColumns may be explicitly marked as included from system\nversioning. See System-versioned tables for details.\n \nWITHOUT SYSTEM VERSIONING Column Option\n \nColumns may be explicitly marked as excluded from system\nversioning. See System-versioned tables for details.\n \nIndex Definitions\n \nindex_definition:\n {INDEX|KEY} [index_name] [index_type] (index_col_name,...)\n[index_option] ...\n | {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name]\n(index_col_name,...) [index_option] ...\n | [CONSTRAINT [symbol]] PRIMARY KEY [index_type]\n(index_col_name,...) [index_option] ...\n | [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY] [index_name]\n[index_type] (index_col_name,...) [index_option] ...\n | [CONSTRAINT [symbol]] FOREIGN KEY [index_name]\n(index_col_name,...) reference_definition\n \nindex_col_name:\n col_name [(length)] [ASC | DESC]\n \nindex_type:\n USING {BTREE | HASH | RTREE}\n \nindex_option:\n KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n | CLUSTERING={YES| NO}\n \nreference_definition:\n REFERENCES tbl_name (index_col_name,...)\n [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n \nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION\nINDEX and KEY are synonyms. \n \nIndex names are optional, if not specified an automatic name\nwill be assigned. Index name are needed to drop indexes and\nappear in error messages when a constraint is violated.\n \nIndex Categories\n \nPlain Indexes\n \nPlain indexes are regular indexes that are not unique, and\nare not acting as a primary key or a foreign key. They are\nalso not the \"specialized\" FULLTEXT or SPATIAL indexes.\n \nSee Getting Started with Indexes: Plain Indexes for more\ninformation.\n \nPRIMARY KEY\n \nFor PRIMARY KEY indexes, you can specify a name for the\nindex, but it is silently ignored, and the name of the index\nis always PRIMARY.\n \nSee Getting Started with Indexes: Primary Key for more\ninformation.\n \nUNIQUE\n \nThe UNIQUE keyword means that the index will not accept\nduplicated values, except for NULLs. An error will raise if\nyou try to insert duplicate values in a UNIQUE index.\n \nFor UNIQUE indexes, you can specify a name for the\nconstraint, using the CONSTRAINT keyword. That name will be\nused in error messages.\n \nSee Getting Started with Indexes: Unique Index for more\ninformation.\n \nFOREIGN KEY\n \nFor FOREIGN KEY indexes, a reference definition must be\nprovided.\n \nFor FOREIGN KEY indexes, you can specify a name for the\nconstraint, using the CONSTRAINT keyword. That name will be\nused in error messages.\n \nFirst, you have to specify the name of the target (parent)\ntable and a column or a column list which must be indexed\nand whose values must match to the foreign key\'s values.\nThe MATCH clause is accepted to improve the compatibility\nwith other DBMS\'s, but has no meaning in MariaDB. The ON\nDELETE and ON UPDATE clauses specify what must be done when\na DELETE (or a REPLACE) statements attempts to delete a\nreferenced row from the parent table, and when an UPDATE\nstatement attempts to modify the referenced foreign key\ncolumns in a parent table row, respectively. The following\noptions are allowed:\nRESTRICT: The delete/update operation is not performed. The\nstatement terminates with a 1451 error (SQLSTATE \'2300\').\nNO ACTION: Synonym for RESTRICT.\nCASCADE: The delete/update operation is performed in both\ntables.\nSET NULL: The update or delete goes ahead in the parent\ntable, and the corresponding foreign key fields in the child\ntable are set to NULL. (They must not be defined as NOT NULL\nfor this to succeed).\nSET DEFAULT: This option is currently implemented only for\nthe PBXT storage engine, which is disabled by default and no\nlonger maintained. It sets the child table\'s foreign key\nfields to their DEFAULT values when the referenced parent\ntable key entries are updated or deleted.\n \nIf either clause is omitted, the default behavior for the\nomitted clause is RESTRICT.\n \nSee Foreign Keys for more information.\n \nFULLTEXT\n \nUse the FULLTEXT keyword to create full-text indexes.\n \nSee Full-Text Indexes for more information.\n \nSPATIAL\n \nUse the SPATIAL keyword to create geometric indexes.\n \nSee SPATIAL INDEX for more information.\n \nIndex Options\n \nKEY_BLOCK_SIZE Index Option\n \nThe KEY_BLOCK_SIZE index option is similar to the\nKEY_BLOCK_SIZE table option.\n \nWith the InnoDB storage engine, if you specify a non-zero\nvalue for the KEY_BLOCK_SIZE table option for the whole\ntable, then the table will implicitly be created with the\nROW_FORMAT table option set to COMPRESSED. However, this\ndoes not happen if you just set the KEY_BLOCK_SIZE index\noption for one or more indexes in the table. The InnoDB\nstorage engine ignores the KEY_BLOCK_SIZE index option.\nHowever, the SHOW CREATE TABLE statement may still report it\nfor the index.\n \nFor information about the KEY_BLOCK_SIZE index option, see\nthe KEY_BLOCK_SIZE table option below.\n \nIndex Types\n \nEach storage engine supports some or all index types. See\nStorage Engine Index Types for details on permitted index\ntypes for each storage engine.\n \nDifferent index types are optimized for different kind of\noperations:\nBTREE is the default type, a','','https://mariadb.com/kb/en/library/create-table/');
-update help_topic set description = CONCAT(description, 'nd normally is the best choice.\nIt is supported by all storage engines. It can be used to\ncompare a column\'s value with a value using the =, >, >=,\n0) ,b int check (b> 0), constraint abc check (a>b));\n \nIf you use the second format and you don\'t give a name to\nthe constraint, then the constraint will get a auto\ngenerated name. This is done so that you can later delete\nthe constraint with ALTER TABLE DROP constraint_name.\n \nOne can disable all constraint expression checks by setting\nthe variable check_constraint_checks to OFF. This is useful\nfor example when loading a table that violates some\nconstraints that you want to later find and fix in SQL.\n \nSee CONSTRAINT for more information.\n \nTable Options\n \nFor each individual table you create (or alter), you can set\nsome table options. The general syntax for setting options\nis:\n \n = , [ = ...]\n \nThe equal sign is optional.\n \nSome options are supported by the server and can be used for\nall tables, no matter what storage engine they use; other\noptions can be specified for all storage engines, but have a\nmeaning only for some engines. Also, engines can extend\nCREATE TABLE with new options.\n \nIf the IGNORE_BAD_TABLE_OPTIONS SQL_MODE is enabled, wrong\ntable options generate a warning; otherwise, they generate\nan error.\n \ntable_option: \n [STORAGE] ENGINE [=] engine_name\n | AUTO_INCREMENT [=] value\n | AVG_ROW_LENGTH [=] value\n | [DEFAULT] CHARACTER SET [=] charset_name\n | CHECKSUM [=] {0 | 1}\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'string\'\n | CONNECTION [=] \'connect_string\'\n | DATA DIRECTORY [=] \'absolute path to directory\'\n | DELAY_KEY_WRITE [=] {0 | 1}\n | ENCRYPTED [=] {YES | NO}\n | ENCRYPTION_KEY_ID [=] value\n | IETF_QUOTES [=] {YES | NO}\n | INDEX DIRECTORY [=] \'absolute path to directory\'\n | INSERT_METHOD [=] { NO | FIRST | LAST }\n | KEY_BLOCK_SIZE [=] value\n | MAX_ROWS [=] value\n | MIN_ROWS [=] value\n | PACK_KEYS [=] {0 | 1 | DEFAULT}\n | PAGE_CHECKSUM [=] {0 | 1}\n | PAGE_COMPRESSED [=] {0 | 1}\n | PAGE_COMPRESSION_LEVEL [=] {0 .. 9}\n | PASSWORD [=] \'string\'\n | ROW_FORMAT [=]\n{DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT|PAGE}\n | SEQUENCE [=] {0|1}\n | STATS_AUTO_RECALC [=] {DEFAULT|0|1}\n | STATS_PERSISTENT [=] {DEFAULT|0|1}\n | STATS_SAMPLE_PAGES [=] {DEFAULT|value}\n | TABLESPACE tablespace_name\n | TRANSACTIONAL [=] {0 | 1}\n | UNION [=] (tbl_name[,tbl_name]...)\n | WITH SYSTEM VERSIONING\n \n[STORAGE] ENGINE\n \n[STORAGE] ENGINE specifies a storage engine for the table.\nIf this option is not used, the default storage engine is\nused instead. That is, the default_storage_engine session option\nvalue if it is set, or the value specified for the\n--default-storage-engine mysqld startup options, or InnoDB.\nIf the specified storage engine is not installed and active,\nthe default value will be used, unless the\nNO_ENGINE_SUBSTITUTION SQL MODE is set (default since\nMariaDB 10.0). This is only true for CREATE TABLE, not for\nALTER TABLE. For a list of storage engines that are present\nin your server, issue a SHOW ENGINES.\n \nAUTO_INCREMENT\n \nAUTO_INCREMENT specifies the initial value for the\nAUTO_INCREMENT primary key. This works for MyISAM, Aria,\nInnoDB/XtraDB, MEMORY, and ARCHIVE tables. You can change\nthis option with ALTER TABLE, but in that case the new value\nmust be higher than the highest value which is present in\nthe AUTO_INCREMENT column. If the storage engine does not\nsupport this option, you can insert (and then delete) a row\nhaving the wanted value - 1 in the AUTO_INCREMENT column.\n \nAVG_ROW_LENGTH\n \nAVG_ROW_LENGTH is the average rows size. It only applies to\ntables using MyISAM and Aria storage engines that have the\nROW_FORMAT table option set to FIXED format.\n \nMyISAM uses MAX_ROWS and AVG_ROW_LENGTH to decide the\nmaximum size of a table (default: 256TB, or the maximum file\nsize allowed by the system).\n \n[DEFAULT] CHARACTER SET/CHARSET\n \n[DEFAULT] CHARACTER SET (or [DEFAULT] CHARSET) is used to\nset a default character set for the table. This is the\ncharacter set used for all columns where an explicit\ncharacter set is not specified. If this option is omitted or\nDEFAULT is specified, database\'s default character set will\nbe used. See Setting Character Sets and Collations for\ndetails on setting the character sets.\n \nCHECKSUM/TABLE_CHECKSUM\n \nCHECKSUM (or TABLE_CHECKSUM) can be set to 1 to maintain a\nlive checksum for all table\'s rows. This makes write\noperations slower, but CHECKSUM TABLE will be very fast.\nThis option is only supported for MyISAM and Aria tables.\n \n[DEFAULT] COLLATE\n \n[DEFAULT] COLLATE is used to set a default collation for the\ntable. This is the collation used for all columns where an\nexplicit character set is not specified. If this option is\nomitted or DEFAULT is specified, database\'s default option\nwill be used. See Setting Character Sets and Collations for\ndetails on setting the collations\n \nCOMMENT\n \nCOMMENT is a comment for the table. Maximum length is 2048\ncharacters (before mariaDB 5.5 it was 60 characters). Also\nused to define table parameters when creating a Spider\ntable.\n \nCONNECTION\n \nCONNECTION is used to specify a server name or a connection\nstring for a Spider, CONNECT, Federated or FederatedX table.\n \nDATA DIRECTORY/INDEX DIRECTORY\n \nDATA DIRECTORY and INDEX DIRECTORY were only supported for\nMyISAM and Aria, before MariaDB 5.5. Since 5.5, DATA\nDIRECTORY has also been supported by InnoDB if the\ninnodb_file_per_table server system variable is enabled, but\nonly in CREATE TABLE, not in ALTER TABLE. So, carefully\nchoose a path for InnoDB tables at creation time, because it\ncannot be changed without dropping and re-creating the\ntable. These options specify the paths for data files and\nindex files, respectively. If these options are omitted, the\ndatabase\'s directory will be used to store data files and\nindex files. Note that these table options do not work for\npartitioned tables (use the partition options instead), or\nif the server has been invoked with the\n--skip-symbolic-links startup option. To avoid the\noverwriting of old files with the same name that could be\npresent in the directories, you can use the\n--keep_files_on_create option (an error will be issued if\nfiles already exist). These options are ignored if the\nNO_DIR_IN_CREATE SQL_MODE is enabled (useful for replication\nslaves). Also note that symbolic links cannot be used for\nInnoDB tables.\n \nDATA DIRECTORY works by creating symlinks from where the\ntable would normally have been (inside the datadir) to where\nthe option specifies. For security reasons, to avoid\nbypassing the privilege system, the server does not permit\nsymlinks inside the datadir. Therefore, DATA DIRECTORY\ncannot be used to specify a location inside the datadir. An\nattempt to do so will result in an error 1210 (HY000)\nIncorrect arguments to DATA DIRECTORY.\n \nDELAY_KEY_WRITE\n \nDELAY_KEY_WRITE is supported by MyISAM and Aria, and can be\nset to 1 to speed up write operations. In that case, when\ndata are modified, the indexes are not updated until the\ntable is closed. Writing the changes to the index file\naltogether can be much faster. However, note that this\noption is applied only if the delay_key_write server\nvariable is set to \'ON\'. If it is \'OFF\' the delayed\nindex writes are always disabled, and if it is \'ALL\' the\ndelayed index writes are always used, disregarding the value\nof DELAY_KEY_WRITE.\n \nENCRYPTED\n \nThe ENCRYPTED table option was added in MariaDB 10.1.4\n \nThe ENCRYPTED table option can be used to manually set the\nencryption status of an InnoDB table. See InnoDB / XtraDB\nEncryption for more information.\n \nAria does not currently support the ENCRYPTED table option.\nSee MDEV-18049 about that.\n \nSee Data-at-Rest Encryption for more information.\n \nENCRYPTION_KEY_ID\n \nThe ENCRYPTION_KEY_ID table option was added in MariaDB\n10.1.4\n \nThe ENCRYPTION_KEY_ID table option can be used to manually\nset the encryption key of an InnoDB table. See InnoDB /\nXtraDB Encryption for more information.\n \nAria does not currently support the ENCRYPTION_KEY_ID table\noption. See MDEV-18049 about that.\n \nSee Data-at-Rest Encryption for more information.\n \nIETF_QUOTES\n \nThe IETF_QUOTES option was added in MariaDB 10.1.8\n \nFor the CSV storage engine, the IETF_QUOTES option, when set\nto YES, enables IETF-compatible parsing of embedded quote\nand comma characters. Enabling this option for a table\nimproves compatibility with other tools that use CSV, but is\nnot compatible with MySQL CSV tables, or MariaDB CSV tables\ncreated without this option. Disabled by default.\n \nINSERT_METHOD\n \nINSERT_METHOD is only used with MERGE tables. This option\ndetermines in which underlying table the new rows should be\ninserted. If you set it to \'NO\' (which is the default) no\nnew rows can be added to the table (but you will still be\nable to perform INSERTs directly against the underlying\ntables). FIRST means that the rows are inserted into the\nfirst table, and LAST means that thet are inserted into the\nlast table.\n \nKEY_BLOCK_SIZE\n \nKEY_BLOCK_SIZE is used to determine the size of key blocks,\nin bytes or kilobytes. However, this value is just a hint,\nand the storage engine could modify or ignore it. If\nKEY_BLOCK_SIZE is set to 0, the storage engine\'s default\nvalue will be used.\n \nWith the InnoDB storage engine, if you specify a non-zero\nvalue for the KEY_BLOCK_SIZE table option for the whole\ntable, then the table will implicitly be created with the\nROW_FORMAT table option set to COMPRESSED.\n \nMIN_ROWS/MAX_ROWS\n \nMIN_ROWS and MAX_ROWS let the storage engine know how many\nrows you are planning to store as a minimum and as a\nmaximum. These values will not be used as real limits, but\nthey help the storage engine to optimize the table. MIN_ROWS\nis only used by MEMORY storage engine to decide the minimum\nmemory that is always allocated. MAX_ROWS is used to decide\nthe minimum size for indexes.\n \nPACK_KEYS\n \nPACK_KEYS can be used to determine whether the indexes will\nbe compressed. Set it to 1 to compress all keys. With a\nvalue of 0, compression will not be used. With the DEFAULT\nvalue, only long strings will be compressed. Uncompressed\nkeys are faster.\n \nPAGE_CHECKSUM\n \nPAGE_CHECKSUM is only applicable to Aria tables, and\ndetermines whether indexes and data should use page\nchecksums for extra safety. \n \nPAGE_COMPRESSED\n \nPAGE_COMPRESSED is used to enable InnoDB page compression\nfor InnoDB tables.\n \nPAGE_COMPRESSION_LEVEL\n \nPAGE_COMPRESSION_LEVEL is used to set the compression level\nfor InnoDB page compression for InnoDB tables. The table\nmust also have the PAGE_COMPRESSED table option set to 1.\n \nValid values for PAGE_COMPRESSION_LEVEL are 1 (the best\nspeed) through 9 (the best compression), .\n \nPASSWORD\n \nPASSWORD is unused.\n \nRAID_TYPE\n \nRAID_TYPE is an obsolete option, as the raid support has\nbeen disabled since MySQL 5.0.\n \nROW_FORMAT\n \nThe ROW_FORMAT table option specifies the row format for the\ndata file. Possible values are engine-dependent.\n \nSupported MyISAM Row Formats\n \nFor MyISAM, the supported row formats are: \nFIXED\nDYNAMIC\nCOMPRESSED\n \nThe COMPRESSED row format can only be set by the myisampack\ncommand line tool.\n \nSee MyISAM Storage Formats for more information.\n \nSupported Aria Row Formats\n \nFor Aria, the supported row formats are:\nPAGE\nFIXED\nDYNAMIC.\n \nSee Aria Storage Formats for more information.\n \nSupported InnoDB Row Formats\n \nFor InnoDB/XtraDB, the supported row formats are:\nCOMPACT\nREDUNDANT\nCOMPRESSED\nDYNAMIC.\n \nIf the ROW_FORMAT table option is set to FIXED for an InnoDB\ntable, then the server will either return an error or a\nwarning depending on the value of the innodb_strict_mode\nsystem variable. If the innodb_strict_mode system variable\nis set to OFF, then a warning is issued, and MariaDB will\ncreate the table using the default row format for the\nspecific MariaDB server version. If the innodb_strict_mode\nsystem variable is set to ON, then an error will be raised.\n \nSee XtraDB/InnoDB Storage Formats for more information.\n \nOther Storage Engines and ROW_FORMAT\n \nOther storage engines do not support the ROW_FORMAT table\noption.\n \nSEQUENCE\n \nIf the table is a sequence, then it will have the SEQUENCE\nset to 1.\n \nSTATS_AUTO_RECALC\n \nSTATS_AUTO_RECALC is available only in MariaDB 10.0+. It\nindicates whether to automatically recalculate persistent\nstatistics (see STATS_PERSISTENT, below) for an InnoDB\ntable.\nIf set to 1, statistics will be recalculated when more than\n10% of the data has changed. When set to 0, stats will be\nrecalculated only when an ANALYZE TABLE is run. If set to\nDEFAULT, or left out, the value set by the\ninnodb_stats_auto_recalc system variable applies. See InnoDB\nPersistent Statistics.\n \nSTATS_PERSISTENT\n \nSTATS_PERSISTENT is available only in MariaDB 10.0+. It\nindicates whether the InnoDB statistics created by ANALYZE\nTABLE will remain on disk or not. It can be set to 1 (on\ndisk), 0 (not on disk, the pre-MariaDB 10 behavior), or\nDEFAULT (the same as leaving out the option), in which case\nthe value set by the innodb_stats_persistent system variable\nwill apply. Persistent statistics stored on disk allow the\nstatistics to survive server restarts, and provide better\nquery plan stability. See InnoDB Persistent Statistics.\n \nSTATS_SAMPLE_PAGES\n \nSTATS_SAMPLE_PAGES is available only in MariaDB 10.0+. It\nindicates how many pages are used to sample index\nstatistics. If 0 or DEFAULT, the default value, the\ninnodb_stats_sample_pages value is used. See InnoDB\nPersistent Statistics.\n \nTRANSACTIONAL\n \nTRANSACTIONAL is only applicable for Aria tables. In future\nAria tables created with this option will be fully\ntransactional, but currently this provides a form of crash\nprotection. See Aria Storage Engine for more details.\n \nUNION\n \nUNION must be specified when you create a MERGE table. This\noption contains a comma-separated list of MyISAM tables\nwhich are accessed by the new table. The list is enclosed\nbetween parenthesis. Example: UNION = (t1,t2)\n \nWITH SYSTEM VERSIONING\n \nWITH SYSTEM VERSIONING is used for creating System-versioned\ntables.\n \nPartitions\n \npartition_options:\n PARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY(column_list)\n | RANGE(expr)\n | LIST(expr)\n | SYSTEM_TIME [INTERVAL time_quantity time_unit] [LIMIT\nnum] }\n [PARTITIONS num]\n [SUBPARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY(column_list) }\n [SUBPARTITIONS num]\n ]\n [(partition_definition [, partition_definition] ...)]\n \npartition_definition:\n PARTITION partition_name\n [VALUES {LESS THAN {(expr) | MAXVALUE} | IN (value_list)}]\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'comment_text\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n [NODEGROUP [=] node_group_id]\n [(subpartition_definition [, subpartition_definition] ...)]\n \nsubpartition_definition:\n SUBPARTITION logical_name\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'comment_text\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n [NODEGROUP [=] node_group_id]\nIf the PARTITION BY clause is used, the table will be\npartitioned. A partition method must be explicitly indicated\nfor partitions and subpartitions. Partition methods are:\n[LINEAR] HASH creates a hash key which will be used to read\nand write rows. The partition function can be any valid SQL\nexpression which returns an INTEGER number. Thus, it is\npossible to use the HASH method on an integer column, or on\nfunctions which accept integer columns as an argument.\nHowever, VALUES LESS THAN and VALUES IN clauses can not be\nused with HASH. An example:\n \nCREATE TABLE t1 (a INT, b CHAR(5), c DATETIME)\n PARTITION BY HASH ( YEAR(c) );\n \n [LINEAR] HASH can be used for subpartitions, too.\n[LINEAR] KEY is similar to HASH, but the index has an even\ndistribution of data. Also, the expression can only be a\ncolumn or a list of columns. VALUES LESS THAN and VALUES IN\nclauses can not be used with KEY.\nRANGE partitions the rows using on a range of values, using\nthe VALUES LESS THAN operator. VALUES IN is not allowed with\nRANGE. The partition function can be any valid SQL\nexpression which returns a single value.\nLIST assignes partitions based on a table\'s column with a\nrestricted set of possible values. It is similar to RANGE,\nbut VALUES IN must be used for at least 1 columns, and\nVALUES LESS THAN is disallowed.\nSYSTEM_TIME partitioning is used for System-versioned tables\nto store historical data separately from current data.\n \nOnly HASH and KEY can be used for subpartitions, and they\ncan be [LINEAR].\n \nIt is possible to define up to 1024 partitions and\nsubpartitions.\n \nThe number of defined partitions can be optionally specified\nas PARTITION count. This can be done to avoid specifying all\npartitions individually. But you can also declare each\nindividual partition and, additionally, specify a PARTITIONS\ncount clause; in the case, the number of PARTITIONs must\nequal count.\n \nAlso see Partitioning Types Overview.\n \nSequences\n \nCREATE TABLE can also be used to create a SEQUENCE. See\nCREATE SEQUENCE and Sequence Overview.\n \nExamples\n-------- \ncreate table if not exists test (\na bigint auto_increment primary key,\nname varchar(128) charset utf8,\nkey name (name(32))\n) engine=InnoDB default charset latin1;\n \nThis example shows a couple of things:\nUsage of IF NOT EXISTS; If the table already existed, it\nwill not be created. There will not be any error for the\nclient, just a warning.\nHow to create a PRIMARY KEY that is automatically generated.\nHow to specify a table-specific character set and another\nfor a column.\nHow to create an index (name) that is only partly indexed\n(to save space).\n \nThe following clauses will work from MariaDB 10.2.1 only.\n \nCREATE TABLE t1(\n a int DEFAULT (1+1),\n b int DEFAULT (a+1),\n expires DATETIME DEFAULT(NOW() + INTERVAL 1 YEAR),\n x BLOB DEFAULT USER()\n);\n \n\n\nURL: https://mariadb.com/kb/en/library/create-table/') WHERE help_topic_id = 660;
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (661,39,'CREATE TABLESPACE','The CREATE TABLESPACE statement is not supported by MariaDB.\nIt was originally inherited from MySQL NDB Cluster. In MySQL\n5.7 and later, the statement is also supported for InnoDB.\nHowever, MariaDB has chosen not to include that specific\nfeature. See MDEV-19294 for more information.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/create-tablespace/','','https://mariadb.com/kb/en/library/create-tablespace/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (662,39,'CREATE TRIGGER','Syntax\n------ \nCREATE [OR REPLACE]\n [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n TRIGGER [IF NOT EXISTS] trigger_name trigger_time\ntrigger_event\n ON tbl_name FOR EACH ROW\n [{ FOLLOWS | PRECEDES } other_trigger_name ]\n trigger_stmt\n \nDescription\n----------- \nThis statement creates a new trigger. A trigger is a named\ndatabase\nobject that is associated with a table, and that activates\nwhen a\nparticular event occurs for the table. The trigger becomes\nassociated\nwith the table named tbl_name, which must refer to a\npermanent table.\nYou cannot associate a trigger with a TEMPORARY table or a\nview.\n \nCREATE TRIGGER requires the TRIGGER privilege for the table\nassociated\nwith the trigger. (Before MySQL 5.1.6, this statement\nrequires the\nSUPER privilege.)\n \nYou can have multiple triggers for the same trigger_time and\ntrigger_event.\n \nFor valid identifiers to use as trigger names, see\nIdentifier Names.\n \nOR REPLACE\n \nIf used and the trigger already exists, instead of an error\nbeing returned, the existing trigger will be dropped and\nreplaced by the newly defined trigger.\n \nDEFINER\n \nThe DEFINER clause determines the security context to be\nused when\nchecking access privileges at trigger activation time.\n \nIF NOT EXISTS\n \nIf the IF NOT EXISTS clause is used, the trigger will only\nbe created if a trigger of the same name does not exist. If\nthe trigger already exists, by default a warning will be\nreturned.\n \ntrigger_time\n \ntrigger_time is the trigger action time. It can be BEFORE or\nAFTER to\nindicate that the trigger activates before or after each row\nto be\nmodified.\n \ntrigger_event\n \ntrigger_event indicates the kind of statement that activates\nthe\ntrigger. The trigger_event can be one of the following:\nINSERT: The trigger is activated whenever a new row is\ninserted into the table; for example, through INSERT, LOAD\nDATA, and REPLACE statements.\nUPDATE: The trigger is activated whenever a row is modified;\nfor example, through UPDATE statements.\nDELETE: The trigger is activated whenever a row is deleted\nfrom the table; for example, through DELETE and REPLACE\nstatements. However, DROP TABLE and TRUNCATE statements on\nthe table do not activate this trigger, because they do not\nuse DELETE. Dropping a partition does not activate DELETE\ntriggers, either.\n \nFOLLOWS/PRECEDES other_trigger_name\n \nThe FOLLOWS other_trigger_name and PRECEDES\nother_trigger_name options were added in MariaDB 10.2.3 as\npart of supporting multiple triggers per action time.\nThis is the same syntax used by MySQL 5.7, although MySQL\n5.7 does not have multi-trigger support.\n \nFOLLOWS adds the new trigger after another trigger while\nPRECEDES adds the new trigger before another trigger. If\nneither option is used, the new trigger is added last for\nthe given action and time.\n \nFOLLOWS and PRECEDES are not stored in the trigger\ndefinition. However the trigger order is guaranteed to not\nchange over time. mysqldump and other backup methods will\nnot change trigger order.\nYou can verify the trigger order from the ACTION_ORDER\ncolumn in INFORMATION_SCHEMA.TRIGGERS table.\n \nSELECT trigger_name, action_order FROM\ninformation_schema.triggers \n WHERE event_object_table=\'t1\';\n \nExamples\n-------- \nCREATE DEFINER=`root`@`localhost` TRIGGER increment_animal\n AFTER INSERT ON animals FOR EACH ROW \n UPDATE animal_count SET animal_count.animals =\nanimal_count.animals+1;\n \nOR REPLACE and IF NOT EXISTS\n \nCREATE DEFINER=`root`@`localhost` TRIGGER increment_animal\n AFTER INSERT ON animals FOR EACH ROW\n UPDATE animal_count SET animal_count.animals =\nanimal_count.animals+1;\n \nERROR 1359 (HY000): Trigger already exists\n \nCREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER\nincrement_animal\n AFTER INSERT ON animals FOR EACH ROW\n UPDATE animal_count SET animal_count.animals =\nanimal_count.animals+1;\n \nQuery OK, 0 rows affected (0.12 sec)\n \nCREATE DEFINER=`root`@`localhost` TRIGGER IF NOT EXISTS\nincrement_animal\n AFTER INSERT ON animals FOR EACH ROW\n UPDATE animal_count SET animal_count.animals =\nanimal_count.animals+1;\n \nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n \nSHOW WARNINGS;\n \n+-------+------+------------------------+\n| Level | Code | Message |\n+-------+------+------------------------+\n| Note | 1359 | Trigger already exists |\n+-------+------+------------------------+\n1 row in set (0.00 sec)\n \n\n\nURL: https://mariadb.com/kb/en/library/create-trigger/','','https://mariadb.com/kb/en/library/create-trigger/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (663,39,'CREATE VIEW','Syntax\n------ \nCREATE\n [OR REPLACE]\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW [IF NOT EXISTS] view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n \nDescription\n----------- \nThe CREATE VIEW statement creates a new view, or replaces an\nexisting\none if the OR REPLACE clause is given. If the view does not\nexist, CREATE OR\nREPLACE VIEW is the same as CREATE VIEW. If the view does\nexist, CREATE OR\nREPLACE VIEW is the same as ALTER VIEW.\n \nThe select_statement is a SELECT statement that provides the\ndefinition of\nthe view. (When you select from the view, you select in\neffect using the SELECT\nstatement.) select_statement can select from base tables or\nother views.\n \nThe view definition is \"frozen\" at creation time, so\nchanges to the underlying\ntables afterwards do not affect the view definition. For\nexample, if a view is\ndefined as SELECT * on a table, new columns added to the\ntable later do not\nbecome part of the view. A SHOW CREATE VIEW shows that\nsuch queries are rewritten and column names are included in\nthe view\ndefinition.\n \nThe view definition must be a query that does not return\nerrors at view\ncreation times. However, the base tables used by the views\nmight be altered\nlater and the query may not be valid anymore. In this case,\nquerying the view\nwill result in an error. CHECK TABLE helps in finding this\nkind\nof problems.\n \nThe ALGORITHM clause affects how MariaDB processes the\nview. The DEFINER and SQL SECURITY clauses specify the\nsecurity context to be\nused when checking access privileges at view invocation\ntime. The WITH CHECK\nOPTION clause can be given to constrain inserts or updates\nto rows in tables\nreferenced by the view. These clauses are described later in\nthis section.\n \nThe CREATE VIEW statement requires the CREATE VIEW privilege\nfor the\nview, and some privilege for each column selected by the\nSELECT\nstatement. For columns used elsewhere in the SELECT\nstatement you must\nhave the SELECT privilege. If the OR REPLACE clause is\npresent, you\nmust also have the DROP privilege for the view.\n \nA view belongs to a database. By default, a new view is\ncreated in the\ndefault database. To create the view explicitly in a given\ndatabase,\nspecify the name as db_name.view_name when you create it.\n \nCREATE VIEW test.v AS SELECT * FROM t;\n \nBase tables and views share the same namespace within a\ndatabase, so a\ndatabase cannot contain a base table and a view that have\nthe same\nname.\n \nViews must have unique column names with no duplicates, just\nlike base\ntables. By default, the names of the columns retrieved by\nthe SELECT\nstatement are used for the view column names. To define\nexplicit names\nfor the view columns, the optional column_list clause can be\ngiven as\na list of comma-separated identifiers. The number of names\nin\ncolumn_list must be the same as the number of columns\nretrieved by the\nSELECT statement.\n \nMySQL until 5.1.28\n \nPrior to MySQL 5.1.29, When you modify an existing view, the\ncurrent view definition is backed up and saved. It is stored\nin that\ntable\'s database directory, in a subdirectory named arc.\nThe backup\nfile for a view v is named v.frm-00001. If you alter the\nview again,\nthe next backup is named v.frm-00002. The three latest view\nbackup\ndefinitions are stored. Backed up view definitions are not\npreserved\nby mysqldump, or any other such programs, but you can retain\nthem\nusing a file copy operation. However, they are not needed\nfor anything\nbut to provide you with a backup of your previous view\ndefinition. It\nis safe to remove these backup definitions, but only while\nmysqld is\nnot running. If you delete the arc subdirectory or its files\nwhile\nmysqld is running, you will receive an error the next time\nyou try to\nalter the view: \n \nMariaDB [test]> ALTER VIEW v AS SELECT * FROM t; \nERROR 6 (HY000): Error on delete of\n\'.\\test\\arc/v.frm-0004\' (Errcode: 2)\n \nColumns retrieved by the SELECT statement can be simple\nreferences to\ntable columns. They can also be expressions that use\nfunctions,\nconstant values, operators, and so forth.\n \nUnqualified table or view names in the SELECT statement are\ninterpreted with respect to the default database. A view can\nrefer to\ntables or views in other databases by qualifying the table\nor view\nname with the proper database name.\n \nA view can be created from many kinds of SELECT statements.\nIt can\nrefer to base tables or other views. It can use joins,\nUNION, and\nsubqueries. The SELECT need not even refer to any tables.\nThe\nfollowing example defines a view that selects two columns\nfrom another\ntable, as well as an expression calculated from those\ncolumns:\n \nCREATE TABLE t (qty INT, price INT);\n \nINSERT INTO t VALUES(3, 50);\n \nCREATE VIEW v AS SELECT qty, price, qty*price AS value FROM\nt;\n \nSELECT * FROM v;\n+------+-------+-------+\n| qty | price | value |\n+------+-------+-------+\n| 3 | 50 | 150 |\n+------+-------+-------+\n \nA view definition is subject to the following restrictions:\nThe SELECT statement cannot contain a subquery in the FROM\nclause.\nThe SELECT statement cannot refer to system or user\nvariables.\nWithin a stored program, the definition cannot refer to\nprogram parameters or local variables.\nThe SELECT statement cannot refer to prepared statement\nparameters.\nAny table or view referred to in the definition must exist.\nHowever, after a view has been created, it is possible to\ndrop a table or view that the definition refers to. In this\ncase, use of the view results in an error. To check a view\ndefinition for problems of this kind, use the CHECK TABLE\nstatement.\nThe definition cannot refer to a TEMPORARY table, and you\ncannot create a TEMPORARY view.\nAny tables named in the view definition must exist at\ndefinition time.\nYou cannot associate a trigger with a view.\nFor valid identifiers to use as view names, see Identifier\nNames.\n \nORDER BY is allowed in a view definition, but it is ignored\nif you\nselect from a view using a statement that has its own ORDER\nBY.\n \nFor other options or clauses in the definition, they are\nadded to the\noptions or clauses of the statement that references the\nview, but the\neffect is undefined. For example, if a view definition\nincludes a\nLIMIT clause, and you select from the view using a statement\nthat has\nits own LIMIT clause, it is undefined which limit applies.\nThis same\nprinciple applies to options such as ALL, DISTINCT, or\nSQL_SMALL_RESULT that follow the SELECT keyword, and to\nclauses such\nas INTO, FOR UPDATE, and LOCK IN SHARE MODE.\n \nThe PROCEDURE clause cannot be used in a view definition,\nand it cannot be used if a view is referenced in the FROM\nclause.\n \nIf you create a view and then change the query processing\nenvironment\nby changing system variables, that may affect the results\nthat you get\nfrom the view:\n \nCREATE VIEW v (mycol) AS SELECT \'abc\';\n \nSET sql_mode = \'\';\n \nSELECT \"mycol\" FROM v;\n+-------+\n| mycol |\n+-------+\n| mycol | \n+-------+\n \nSET sql_mode = \'ANSI_QUOTES\';\n \nSELECT \"mycol\" FROM v;\n+-------+\n| mycol |\n+-------+\n| abc | \n+-------+\n \nThe DEFINER and SQL SECURITY clauses determine which MariaDB\naccount to\nuse when checking access privileges for the view when a\nstatement is\nexecuted that references the view. They were added in MySQL\n5.1.2.\nThe legal SQL SECURITY characteristic values are DEFINER and\nINVOKER.\nThese indicate that the required privileges must be held by\nthe user\nwho defined or invoked the view, respectively. The default\nSQL\nSECURITY value is DEFINER.\n \nIf a user value is given for the DEFINER clause, it should\nbe a MariaDB\naccount in \'user_name\'@\'host_name\' format (the same\nformat used in the\nGRANT statement). The user_name and host_name values both\nare\nrequired. The definer can also be given as CURRENT_USER or\nCURRENT_USER(). The default DEFINER value is the user who\nexecutes the\nCREATE VIEW statement. This is the same as specifying\nDEFINER =\nCURRENT_USER explicitly.\n \nIf you specify the DEFINER clause, these rules determine the\nlegal\nDEFINER user values:\nIf you do not have the SUPER privilege, the only legal user\nvalue is your own account, either specified literally or by\nusing CURRENT_USER. You cannot set the definer to some other\naccount.\nIf you have the SUPER privilege, you can specify any\nsyntactically legal account name. If the account does not\nactually exist, a warning is generated.\nIf the SQL SECURITY value is DEFINER but the definer account\ndoes not exist when the view is referenced, an error occurs.\n \nWithin a view definition, CURRENT_USER returns the view\'s\nDEFINER\nvalue by default. Before MySQL 5.1.12, and for views\ndefined with the SQL SECURITY INVOKER characteristic,\nCURRENT_USER\nreturns the account for the view\'s invoker. For information\nabout user\nauditing within views, see\nhttp://dev.mysql.com/doc/refman/5.1/en/account-activity-auditing.html.\n \nWithin a stored routine that is defined with the SQL\nSECURITY DEFINER\ncharacteristic, CURRENT_USER returns the routine\'s DEFINER\nvalue. This\nalso affects a view defined within such a program, if the\nview\ndefinition contains a DEFINER value of CURRENT_USER.\n \nView privileges are checked like this:\nAt view definition time, the view creator must have the\nprivileges needed to use the top-level objects accessed by\nthe view. For example, if the view definition refers to\ntable columns, the creator must have privileges for the\ncolumns, as described previously. If the definition refers\nto a stored function, only the privileges needed to invoke\nthe function can be checked. The privileges required when\nthe function runs can be checked only as it executes: For\ndifferent invocations of the function, different execution\npaths within the function might be taken.\nWhen a view is referenced, privileges for objects accessed\nby the view are checked against the privileges held by the\nview creator or invoker, depending on whether the SQL\nSECURITY characteristic is DEFINER or INVOKER, respectively.\nIf reference to a view causes execution of a stored\nfunction, privilege checking for statements executed within\nthe function depend on whether the function is defined with\na SQL SECURITY characteristic of DEFINER or INVOKER. If the\nsecurity characteristic is DEFINER, the function runs with\nthe privileges of its creator. If the characteristic is\nINVOKER, the function runs with the privileges determined by\nthe view\'s SQL SECURITY characteristic.\n \nMySQL until 5.1.1\n \nPrior to MySQL 5.1.2 (before the DEFINER and SQL SECURITY\nclauses were\nimplemented), privileges required for objects used in a view\nare\nchecked at view creation time.\n \nExample: A view might depend on a stored function, and that\nfunction\nmight invoke other stored routines. For example, the\nfollowing view\ninvokes a stored function f():\n \nCREATE VIEW v AS SELECT * FROM t WHERE t.id = f(t.name);\n \nSuppose that f() contains a statement such as this:\n \nIF name IS NULL then\n CALL p1();\nELSE\n CALL p2();\nEND IF;\n \nThe privileges required for executing statements within f()\nneed to be\nchecked when f() executes. This might mean that privileges\nare needed\nfor p1() or p2(), depending on the execution path within\nf(). Those\nprivileges must be checked at runtime, and the user who must\npossess\nthe privileges is determined by the SQL SECURITY values of\nthe view v\nand the function f().\n \nThe DEFINER and SQL SECURITY clauses for views are\nextensions to\nstandard SQL. In standard SQL, views are handled using the\nrules for\nSQL SECURITY INVOKER.\n \nIf you invoke a view that was created before MySQL 5.1.2, it\nis\ntreated as though it was created with a SQL SECURITY DEFINER\nclause\nand with a DEFINER value that is the same as your account.\nHowever,\nbecause the actual definer is unknown, MySQL issues a\nwarning. To make\nthe warning go away, it is sufficient to re-create the view\nso that\nthe view definition includes a DEFINER clause.\n \nThe optional ALGORITHM clause is an extension to standard\nSQL. It\naffects how MariaDB processes the view. ALGORITHM takes\nthree values:\nMERGE, TEMPTABLE, or UNDEFINED. The default algorithm is\nUNDEFINED if\nno ALGORITHM clause is present. See View Algorithms for more\ninformation.\n \nSome views are updatable. That is, you can use them in\nstatements such\nas UPDATE, DELETE, or INSERT to update the contents of the\nunderlying\ntable. For a view to be updatable, there must be a\none-to-one\nrelationship between the rows in the view and the rows in\nthe\nunderlying table. There are also certain other constructs\nthat make a\nview non-updatable. See Inserting and Updating with Views.\n \nWITH CHECK OPTION\n \nThe WITH CHECK OPTION clause can be given for an updatable\nview to\nprevent inserts or updates to rows except those for which\nthe WHERE\nclause in the select_statement is true.\n \nIn a WITH CHECK OPTION clause for an updatable view, the\nLOCAL and\nCASCADED keywords determine the scope of check testing when\nthe view\nis defined in terms of another view. The LOCAL keyword\nrestricts the\nCHECK OPTION only to the view being defined. CASCADED causes\nthe\nchecks for underlying views to be evaluated as well. When\nneither\nkeyword is given, the default is CASCADED.\n \nFor more information about updatable views and the WITH\nCHECK OPTION\nclause, see\nInserting and Updating with Views.\n \nIF NOT EXISTS\n \nThe IF NOT EXISTS clause was added in MariaDB 10.1.3\n \nWhen the IF NOT EXISTS clause is used, MariaDB will return a\nwarning instead of an error if the specified view already\nexists. Cannot be used together with the OR REPLACE clause.\n \nExamples\n-------- \nCREATE TABLE t (a INT, b INT) ENGINE = InnoDB;\n \nINSERT INTO t VALUES (1,1), (2,2), (3,3);\n \nCREATE VIEW v AS SELECT a, a*2 AS a2 FROM t;\n \nSELECT * FROM v;\n \n+------+------+\n| a | a2 |\n+------+------+\n| 1 | 2 |\n| 2 | 4 |\n| 3 | 6 |\n+------+------+\n \nOR REPLACE and IF NOT EXISTS:\n \nCREATE VIEW v AS SELECT a, a*2 AS a2 FROM t;\n \nERROR 1050 (42S01): Table \'v\' already exists\n \nCREATE OR REPLACE VIEW v AS SELECT a, a*2 AS a2 FROM t;\n \nQuery OK, 0 rows affected (0.04 sec)\n \nCREATE VIEW IF NOT EXISTS v AS SELECT a, a*2 AS a2 FROM t;\n \nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n \nSHOW WARNINGS;\n \n+-------+------+--------------------------+\n| Level | Code | Message |\n+-------+------+--------------------------+\n| Note | 1050 | Table \'v\' already exists |\n+-------+------+--------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/create-view/','','https://mariadb.com/kb/en/library/create-view/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (664,39,'DROP DATABASE','Syntax\n------ \nDROP {DATABASE | SCHEMA} [IF EXISTS] db_name\n \nDescription\n----------- \nDROP DATABASE drops all tables in the database and deletes\nthe database. Be very careful with this statement! To use\nDROP DATABASE,\nyou need the DROP privilege on the database. DROP SCHEMA is\na synonym for DROP DATABASE.\n \nImportant: When a database is dropped, user privileges on\nthe database are not automatically dropped. See GRANT.\n \nIF EXISTS\n \nUse IF EXISTS to prevent an error from occurring for\ndatabases that do not exist. A NOTE is generated for each\nnon-existent database when using IF EXISTS. See SHOW\nWARNINGS.\n \nExamples\n-------- \nDROP DATABASE bufg;\n \nQuery OK, 0 rows affected (0.39 sec)\n \nDROP DATABASE bufg;\n \nERROR 1008 (HY000): Can\'t drop database \'bufg\'; database\ndoesn\'t exist\n \n \\W\nShow warnings enabled.\n \nDROP DATABASE IF EXISTS bufg;\n \nQuery OK, 0 rows affected, 1 warning (0.00 sec)\nNote (Code 1008): Can\'t drop database \'bufg\'; database\ndoesn\'t exist\n \n\n\nURL: https://mariadb.com/kb/en/library/drop-database/','','https://mariadb.com/kb/en/library/drop-database/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (665,39,'DROP EVENT','Syntax\n------ \nDROP EVENT [IF EXISTS] event_name\n \nDescription\n----------- \nThis statement drops the event named event_name. The event\nimmediately\nceases being active, and is deleted completely from the\nserver.\n \nIf the event does not exist, the error\nERROR 1517 (HY000): Unknown event \'event_name\'\nresults. You can override this and cause the\nstatement to generate a NOTE for non-existent events instead\nby using\nIF EXISTS. See SHOW WARNINGS.\n \nThis statement requires the EVENT privilege. In MySQL 5.1.11\nand earlier, an event could be dropped only\nby its definer, or by a user having the SUPER privilege.\n \nExamples\n-------- \nDROP EVENT myevent3;\n \nUsing the IF EXISTS clause:\n \nDROP EVENT IF EXISTS myevent3;\n \nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n \nSHOW WARNINGS;\n \n+-------+------+-------------------------------+\n| Level | Code | Message |\n+-------+------+-------------------------------+\n| Note | 1305 | Event myevent3 does not exist |\n+-------+------+-------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/drop-event/','','https://mariadb.com/kb/en/library/drop-event/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (666,39,'DROP FUNCTION','Syntax\n------ \nDROP FUNCTION [IF EXISTS] f_name\n \nDescription\n----------- \nThe DROP FUNCTION statement is used to drop a stored\nfunction or a user-defined function (UDF). That is, the\nspecified routine is removed from the server, along with all\nprivileges specific to the function. You must have the ALTER\nROUTINE privilege for the routine in order to drop it. If\nthe automatic_sp_privileges server system variable is set,\nboth the ALTER ROUTINE and EXECUTE privileges are granted\nautomatically to the routine creator - see Stored Routine\nPrivileges.\n \nIF EXISTS\n \nThe IF EXISTS clause is a MySQL/MariaDB extension. It\nprevents an error from occurring if the function does not\nexist. A\nNOTE is produced that can be viewed with SHOW WARNINGS.\n \nFor dropping a user-defined functions (UDF), see DROP\nFUNCTION UDF.\n \nExamples\n-------- \nDROP FUNCTION hello;\n \nQuery OK, 0 rows affected (0.042 sec)\n \nDROP FUNCTION hello;\n \nERROR 1305 (42000): FUNCTION test.hello does not exist\n \nDROP FUNCTION IF EXISTS hello;\n \nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n \nSHOW WARNINGS;\n \n+-------+------+------------------------------------+\n| Level | Code | Message |\n+-------+------+------------------------------------+\n| Note | 1305 | FUNCTION test.hello does not exist |\n+-------+------+------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/drop-function/','','https://mariadb.com/kb/en/library/drop-function/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (667,39,'DROP INDEX','Syntax\n------ \nDROP INDEX [IF EXISTS] index_name ON tbl_name \n [WAIT n |NOWAIT]\n [algorithm_option | lock_option] ...\n \nalgorithm_option:\n ALGORITHM [=] {DEFAULT|INPLACE|COPY|NOCOPY|INSTANT}\n \nlock_option:\n LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n \nDescription\n----------- \nDROP INDEX drops the index named index_name from the table\ntbl_name.\nThis statement is mapped to an ALTER TABLE statement to drop\nthe\nindex.\n \nIf another connection is using the table, a metadata lock is\nactive, and this statement will wait until the lock is\nreleased. This is also true for non-transactional tables.\n \nSee ALTER TABLE.\n \nAnother shortcut, CREATE INDEX, allows the creation of an\nindex.\n \nTo remove the primary key, `PRIMARY` must be specified as\nindex_name. Note that the quotes are necessary, because\nPRIMARY is a keyword.\n \nPrivileges\n \nExecuting the DROP INDEX statement requires the INDEX\nprivilege for the table or the database.\n \nOnline DDL\n \nIn MariaDB 10.0 and later, online DDL is supported with the\nALGORITHM and LOCK clauses.\n \nSee InnoDB Online DDL Overview for more information on\nonline DDL with InnoDB.\n \nDROP INDEX IF EXISTS ...\n \nThe IF EXISTS clause was added in MariaDB 10.1.4.\n \nIf the IF EXISTS clause is used, then MariaDB will return a\nwarning instead of an error if the index does not exist.\n \nWAIT/NOWAIT\n \nSet the lock wait timeout. See WAIT and NOWAIT.\n \nALGORITHM\n \nSee ALTER TABLE: ALGORITHM for more information.\n \nLOCK\n \nSee ALTER TABLE: LOCK for more information.\n \nProgress Reporting\n \nMariaDB provides progress reporting for DROP INDEX statement\nfor clients\nthat support the new progress reporting protocol. For\nexample, if you were using the mysql client, then the\nprogress report might look like this::\n \n\n\nURL: https://mariadb.com/kb/en/library/drop-index/','','https://mariadb.com/kb/en/library/drop-index/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (668,39,'DROP PACKAGE','Oracle-style packages were introduced in MariaDB 10.3.5.\n \nSyntax\n------ \nDROP PACKAGE [IF EXISTS] [ db_name . ] package_name\n \nDescription\n----------- \nThe DROP PACKAGE statement can be used when Oracle SQL_MODE\nis set.\n \nThe DROP PACKAGE statement drops a stored package entirely:\nDrops the package specification (earlier created using the\nCREATE PACKAGE statement).\nDrops the package implementation, if the implementation was\nalready created using the CREATE PACKAGE BODY statement.\n \n\n\nURL: https://mariadb.com/kb/en/library/drop-package/','','https://mariadb.com/kb/en/library/drop-package/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (669,39,'DROP PACKAGE BODY','Oracle-style packages were introduced in MariaDB 10.3.5.\n \nSyntax\n------ \nDROP PACKAGE BODY [IF EXISTS] [ db_name . ] package_name\n \nDescription\n----------- \nThe DROP PACKAGE BODY statement can be used when Oracle\nSQL_MODE is set.\n \nThe DROP PACKAGE BODY statement drops the package body (i.e\nthe implementation), previously created using the CREATE\nPACKAGE BODY statement.\n \nNote, DROP PACKAGE BODY drops only the package\nimplementation, but does not drop the package specification.\nUse DROP PACKAGE to drop the package entirely (i.e. both\nimplementation and specification).\n \n\n\nURL: https://mariadb.com/kb/en/library/drop-package-body/','','https://mariadb.com/kb/en/library/drop-package-body/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (670,39,'DROP PROCEDURE','Syntax\n------ \nDROP PROCEDURE [IF EXISTS] sp_name\n \nDescription\n----------- \nThis statement is used to drop a stored procedure. That is,\nthe\nspecified routine is removed from the server along with all\nprivileges specific to the procedure. You must have the\nALTER ROUTINE privilege for the routine. If the\nautomatic_sp_privileges server system variable is set, that\nprivilege and EXECUTE are granted automatically to the\nroutine creator - see Stored Routine Privileges.\n \nThe IF EXISTS clause is a MySQL/MariaDB extension. It\nprevents an error from occurring if the procedure or\nfunction does not exist. A\nNOTE is produced that can be viewed with SHOW WARNINGS.\n \nWhile this statement takes effect immediately, threads which\nare executing a procedure can continue execution.\n \nExamples\n-------- \nDROP PROCEDURE simpleproc;\n \nIF EXISTS:\n \nDROP PROCEDURE simpleproc;\n \nERROR 1305 (42000): PROCEDURE test.simpleproc does not exist\n \nDROP PROCEDURE IF EXISTS simpleproc;\n \nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n \nSHOW WARNINGS;\n \n+-------+------+------------------------------------------+\n| Level | Code | Message |\n+-------+------+------------------------------------------+\n| Note | 1305 | PROCEDURE test.simpleproc does not exist |\n+-------+------+------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/drop-procedure/','','https://mariadb.com/kb/en/library/drop-procedure/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (671,39,'DROP SEQUENCE','DROP SEQUENCE was introduced in MariaDB 10.3.\n \nSyntax\n------ \nDROP [TEMPORARY] SEQUENCE [IF EXISTS] [/*COMMENT TO SAVE*/]\n sequence_name [, sequence_name] ...\n \nDescription\n----------- \nDROP SEQUENCE removes one or more sequences created with\nCREATE SEQUENCE. You must have the DROP privilege for each\nsequence. MariaDB returns an error indicating by name which\nnon-existing tables it was unable to drop, but it also drops\nall of the tables in the list that do exist.\n \nImportant: When a table is dropped, user privileges on the\ntable are not automatically dropped. See GRANT.\n \nIf another connection is using the sequence, a metadata lock\nis active, and this statement will wait until the lock is\nreleased. This is also true for non-transactional tables.\n \nFor each referenced sequence, DROP SEQUENCE drops a\ntemporary sequence with that name, if it exists. If it does\nnot exist, and the TEMPORARY keyword is not used, it drops a\nnon-temporary sequence with the same name, if it exists. The\nTEMPORARY keyword ensures that a non-temporary sequence will\nnot accidentally be dropped.\n \nUse IF EXISTS to prevent an error from occurring for\nsequences that do not exist. A NOTE is generated for each\nnon-existent sequence when using IF EXISTS. See SHOW\nWARNINGS.\n \nDROP SEQUENCE requires the DROP privilege.\n \nNotes\n \nDROP SEQUENCE only removes sequences, not tables. However,\nDROP TABLE can remove both sequences and tables.\n \n\n\nURL: https://mariadb.com/kb/en/library/drop-sequence/','','https://mariadb.com/kb/en/library/drop-sequence/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (672,39,'DROP SERVER','Syntax\n------ \nDROP SERVER [ IF EXISTS ] server_name\n \nDescription\n----------- \nDrops the server definition for the server named\nserver_name. The\ncorresponding row within the mysql.servers table will be\ndeleted. This\nstatement requires the SUPER privilege. \n \nDropping a server for a table does not affect any\nFederatedX, FEDERATED or Spider tables that used this\nconnection information when they were created. \n \nIF EXISTS\n \nIf the IF EXISTS clause is used, MariaDB will not return an\nerror if the server does not exist. Unlike all other\nstatements, DROP SERVER IF EXISTS does not issue a note if\nthe server does not exist. See MDEV-9400.\n \nExamples\n-------- \nDROP SERVER s;\n \nIF EXISTS:\n \nDROP SERVER s;\n \nERROR 1477 (HY000): The foreign server name you are trying\nto reference \n does not exist. Data source error: s\n \nDROP SERVER IF EXISTS s;\n \nQuery OK, 0 rows affected (0.00 sec)\n \n\n\nURL: https://mariadb.com/kb/en/library/drop-server/','','https://mariadb.com/kb/en/library/drop-server/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (673,39,'DROP TABLE','Syntax\n------ \nDROP [TEMPORARY] TABLE [IF EXISTS] [/*COMMENT TO SAVE*/]\n tbl_name [, tbl_name] ...\n [WAIT n|NOWAIT]\n [RESTRICT | CASCADE]\n \nDescription\n----------- \nDROP TABLE removes one or more tables. You must have the\nDROP privilege\nfor each table. All table data and the table definition are\nremoved, as well as triggers associated to the table, so be\ncareful with this statement! If any of the tables named in\nthe argument list do\nnot exist, MariaDB returns an error indicating by name which\nnon-existing tables\nit was unable to drop, but it also drops all of the tables\nin the list that do\nexist.\n \nImportant: When a table is dropped, user privileges on the\ntable are not\nautomatically dropped. See GRANT.\n \nIf another connection is using the table, a metadata lock is\nactive, and this statement will wait until the lock is\nreleased. This is also true for non-transactional tables.\n \nNote that for a partitioned table, DROP TABLE permanently\nremoves the table\ndefinition, all of its partitions, and all of the data which\nwas stored in\nthose partitions. It also removes the partitioning\ndefinition (.par) file\nassociated with the dropped table.\n \nFor each referenced table, DROP TABLE drops a temporary\ntable with that name, if it exists. If it does not exist,\nand the TEMPORARY keyword is not used, it drops a\nnon-temporary table with the same name, if it exists. The\nTEMPORARY keyword ensures that a non-temporary table will\nnot accidentally be dropped.\n \nUse IF EXISTS to prevent an error from occurring for tables\nthat do not\nexist. A NOTE is generated for each non-existent table when\nusing\nIF EXISTS. See SHOW WARNINGS.\n \nIf a foreign key references this table, the table cannot be\ndropped. In this case, it is necessary to drop the foreign\nkey first.\n \nRESTRICT and CASCADE are allowed to make porting from other\ndatabase systems easier. In MariaDB, they do nothing.\n \nSince MariaDB 5.5.27, the comment before the tablenames\n(that /*COMMENT TO SAVE*/) is stored in the binary log. That\nfeature can be used by replication tools to send their\ninternal messages.\n \nIt is possible to specify table names as db_name.tab_name.\nThis is useful to delete tables from multiple databases with\none statement. See Identifier Qualifiers for details.\n \nThe DROP privilege is required to use DROP TABLE on\nnon-temporary tables. For temporary tables, no privilege is\nrequired, because such tables are only visible for the\ncurrent session.\n \nNote: DROP TABLE automatically commits the current active\ntransaction,\nunless you use the TEMPORARY keyword.\n \nWAIT/NOWAIT\n \nSet the lock wait timeout. See WAIT and NOWAIT.\n \nDROP TABLE in replication\n \nDROP TABLE has the following characteristics in replication:\nDROP TABLE IF EXISTS are always logged.\nDROP TABLE without IF EXISTS for tables that don\'t exist\nare not written to the binary log.\nDropping of TEMPORARY tables are prefixed in the log with\nTEMPORARY. These drops are only logged when running\nstatement or mixed mode replication.\nOne DROP TABLE statement can be logged with up to 3\ndifferent DROP statements:\nDROP TEMPORARY TABLE\nlist_of_non_transactional_temporary_tables\nDROP TEMPORARY TABLE list_of_transactional_temporary_tables\nDROP TABLE list_of_normal_tables\n \nStarting from MariaDB 10.0.8, DROP TABLE on the master is\ntreated on the slave as DROP TABLE IF EXISTS. You can change\nthat by setting slave-ddl-exec-mode to STRICT.\n \nDropping an Internal #sql-... Table\n \nIf the mysqld process is killed during an ALTER TABLE you\nmay find a table named #sql-... in your data directory. In\nMariaDB 10.3, InnoDB tables with this prefix will de deleted\nautomatically during startup.\nIn MariaDB 10.4 we will ensure that these temporary tables\nwill always be deleted automatically.\n \nIf you want to delete one of these tables explicitly you can\ndo so by using the following syntax:\n \nDROP TABLE `#mysql50##sql-...`;\n \nWhen running an ALTER TABLE…ALGORITHM=INPLACE that\nrebuilds the table, InnoDB will create an internal #sql-ib\ntable. For these tables, the .frm file will be called\nsomething else. In order to drop such a table after a server\ncrash, you must rename the #sql*.frm file to match the\n#sql-ib*.ibd file.\n \nExamples\n-------- \nDROP TABLE Employees, Customers;\n \nNotes\n \nBeware that DROP TABLE can drop both tables and sequences.\nThis is mainly done to allow old tools like mysqldump to\nwork with sequences.\n \n\n\nURL: https://mariadb.com/kb/en/library/drop-table/','','https://mariadb.com/kb/en/library/drop-table/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (674,39,'DROP TABLESPACE','The DROP TABLESPACE statement is not supported by MariaDB.\nIt was originally inherited from MySQL NDB Cluster. In MySQL\n5.7 and later, the statement is also supported for InnoDB.\nHowever, MariaDB has chosen not to include that specific\nfeature. See MDEV-19294 for more information.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/drop-tablespace/','','https://mariadb.com/kb/en/library/drop-tablespace/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (675,39,'DROP TRIGGER','Syntax\n------ \nDROP TRIGGER [IF EXISTS] [schema_name.]trigger_name\n \nDescription\n----------- \nThis statement drops a trigger. The schema (database) name\nis optional. If the\nschema is omitted, the trigger is dropped from the default\nschema.\nIts use requires the TRIGGER privilege for the table\nassociated with the trigger.\n \nUse IF EXISTS to prevent an error from occurring for a\ntrigger that does not exist. A NOTE is generated for a\nnon-existent trigger\nwhen using IF EXISTS. See SHOW WARNINGS.\n \nNote: Triggers for a table are also dropped if you drop the\ntable.\n \nExamples\n-------- \nDROP TRIGGER test.example_trigger;\n \nUsing the IF EXISTS clause:\n \nDROP TRIGGER IF EXISTS test.example_trigger;\n \nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n \nSHOW WARNINGS;\n \n+-------+------+------------------------+\n| Level | Code | Message |\n+-------+------+------------------------+\n| Note | 1360 | Trigger does not exist |\n+-------+------+------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/drop-trigger/','','https://mariadb.com/kb/en/library/drop-trigger/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (676,39,'DROP VIEW','Syntax\n------ \nDROP VIEW [IF EXISTS]\n view_name [, view_name] ...\n [RESTRICT | CASCADE]\n \nDescription\n----------- \nDROP VIEW removes one or more views. You must have the DROP\nprivilege for\neach view. If any of the views named in the argument list do\nnot exist, MariaDB\nreturns an error indicating by name which non-existing views\nit was unable to\ndrop, but it also drops all of the views in the list that do\nexist.\n \nThe IF EXISTS clause prevents an error from occurring for\nviews that don\'t\nexist. When this clause is given, a NOTE is generated for\neach non-existent\nview. See SHOW WARNINGS.\n \nRESTRICT and CASCADE, if given, are parsed and ignored.\n \nIt is possible to specify view names as db_name.view_name.\nThis is useful to delete views from multiple databases with\none statement. See Identifier Qualifiers for details.\n \nThe DROP privilege is required to use DROP TABLE on\nnon-temporary tables. For temporary tables, no privilege is\nrequired, because such tables are only visible for the\ncurrent session.\n \nIf a view references another view, it will be possible to\ndrop the referenced view. However, the other view will\nreference a view which does not exist any more. Thus,\nquerying it will produce an error similar to the following:\n \nERROR 1356 (HY000): View \'db_name.view_name\' references\ninvalid table(s) or \ncolumn(s) or function(s) or definer/invoker of view lack\nrights to use them\n \nThis problem is reported in the output of CHECK TABLE.\n \nNote that it is not necessary to use DROP VIEW to replace an\nexisting view, because CREATE VIEW has an OR REPLACE clause.\n \nExamples\n-------- \nDROP VIEW v,v2;\n \nGiven views v and v2, but no view v3\n \nDROP VIEW v,v2,v3;\nERROR 1051 (42S02): Unknown table \'v3\'\n \nDROP VIEW IF EXISTS v,v2,v3;\nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n \nSHOW WARNINGS;\n+-------+------+-------------------------+\n| Level | Code | Message |\n+-------+------+-------------------------+\n| Note | 1051 | Unknown table \'test.v3\' |\n+-------+------+-------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/drop-view/','','https://mariadb.com/kb/en/library/drop-view/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (677,39,'MERGE','Description\n----------- \nThe MERGE storage engine, also known as the MRG_MyISAM\nengine, is a\ncollection of identical MyISAM tables that can be used as\none.\n\"Identical\" means that all tables have identical column\nand index\ninformation. You cannot merge MyISAM tables in which the\ncolumns are\nlisted in a different order, do not have exactly the same\ncolumns, or\nhave the indexes in different order. However, any or all of\nthe MyISAM\ntables can be compressed with myisampack. Columns names and\nindexes names can be different, as long as data types and\nNULL/NOT NULL clauses are the same. Differences in\ntable options such as AVG_ROW_LENGTH, MAX_ROWS, or PACK_KEYS\ndo not\nmatter.\n \nEach index in a MERGE table must match an index in\nunderlying MyISAM tables, but the opposite is not true.\nAlso, a MERGE table cannot have a PRIMARY KEY or UNIQUE\nindexes, because it cannot enforce uniqueness over all\nunderlying tables.\n \nThe following options are meaningful for MERGE tables:\nUNION. This option specifies the list of the underlying\nMyISAM tables. The list is enclosed between parentheses and\nseparated with commas.\nINSERT_METHOD. This options specifies whether, and how,\nINSERTs are allowed for the table. Allowed values are: NO\n(INSERTs are not allowed), FIRST (new rows will be written\ninto the first table specified in the UNION list), LAST (new\nrows will be written into the last table specified in the\nUNION list). The default value is NO.\n \nIf you define a MERGE table with a definition which is\ndifferent from the underlying MyISAM tables, or one of the\nunderlying tables is not MyISAM, the CREATE TABLE statement\nwill not return any error. But any statement which involves\nthe table will produce an error like the following:\n \nERROR 1168 (HY000): Unable to open underlying table which is\ndifferently defined \n or of non-MyISAM type or doesn\'t exist\n \nA CHECK TABLE will show more information about the problem.\n \nThe error is also produced if the table is properly define,\nbut an underlying table\'s definition changes at some point\nin time.\n \nIf you try to insert a new row into a MERGE table with\nINSERT_METHOD=NO, you will get an error like the following:\n \nERROR 1036 (HY000): Table \'tbl_name\' is read only\n \nIt is possible to build a MERGE table on MyISAM tables which\nhave one or more virtual columns. MERGE itself does not\nsupport virtual columns, thus such columns will be seen as\nregular columns. The data types and sizes will still need to\nbe identical, and they cannot be NOT NULL.\n \nExamples\n-------- \nCREATE TABLE t1 (\n a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n message CHAR(20)) ENGINE=MyISAM;\n \nCREATE TABLE t2 (\n a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n message CHAR(20)) ENGINE=MyISAM;\n \nINSERT INTO t1 (message) VALUES\n(\'Testing\'),(\'table\'),(\'t1\');\n \nINSERT INTO t2 (message) VALUES\n(\'Testing\'),(\'table\'),(\'t2\');\n \nCREATE TABLE total (\n a INT NOT NULL AUTO_INCREMENT,\n message CHAR(20), INDEX(a))\n ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;\n \nSELECT * FROM total;\n \n+---+---------+\n| a | message |\n+---+---------+\n| 1 | Testing |\n| 2 | table |\n| 3 | t1 |\n| 1 | Testing |\n| 2 | table |\n| 3 | t2 |\n+---+---------+\n \nIn the following example, we\'ll create three MyISAM tables,\nand then a MERGE table on them. However, one of them uses a\ndifferent data type for the column b, so a SELECT will\nproduce an error:\n \nCREATE TABLE t1 (\n a INT,\n b INT\n) ENGINE = MyISAM;\n \nCREATE TABLE t2 (\n a INT,\n b INT\n) ENGINE = MyISAM;\n \nCREATE TABLE t3 (\n a INT,\n b TINYINT\n) ENGINE = MyISAM;\n \nCREATE TABLE t_mrg (\n a INT,\n b INT\n) ENGINE = MERGE,UNION=(t1,t2,t3);\n \nSELECT * FROM t_mrg;\n \nERROR 1168 (HY000): Unable to open underlying table which is\ndifferently defined\n or of non-MyISAM type or doesn\'t exist\n \nTo find out what\'s wrong, we\'ll use a CHECK TABLE:\n \nCHECK TABLE t_mrg;\n \n+------------+-------+----------+-----------------------------------------------------------------------------------------------------+\n| Table | Op | Msg_type | Msg_text |\n+------------+-------+----------+-----------------------------------------------------------------------------------------------------+\n| test.t_mrg | check | Error | Table \'test.t3\' is\ndifferently defined or of non-MyISAM type or doesn\'t exist\n|\n| test.t_mrg | check | Error | Unable to open underlying\ntable which is differently defined or of non-MyISAM type or\ndoesn\'t exist |\n| test.t_mrg | check | error | Corrupt |\n+------------+-------+----------+-----------------------------------------------------------------------------------------------------+\n \nNow, we know that the problem is in t3\'s definition.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/merge/','','https://mariadb.com/kb/en/library/merge/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (678,39,'RENAME TABLE','Syntax\n------ \nRENAME TABLE tbl_name \n [WAIT n | NOWAIT]\n TO new_tbl_name\n [, tbl_name2 TO new_tbl_name2] ...\n \nDescription\n----------- \nThis statement renames one or more tables or views, but not\nthe privileges associated to them.\n \nThe rename operation is done atomically, which means that no\nother session can\naccess any of the tables while the rename is running. For\nexample, if you have\nan existing table old_table, you can create another table\nnew_table that has the same structure but is empty, and then\nreplace the existing table with the empty one as follows\n(assuming that\nbackup_table does not already exist):\n \nCREATE TABLE new_table (...);\nRENAME TABLE old_table TO backup_table, new_table TO\nold_table;\n \ntbl_name can optionally be specified as db_name.tbl_name.\nSee Identifier Qualifiers. This allows to use RENAME to move\na table from a database to another (as long as they are on\nthe same filesystem):\n \nRENAME TABLE db1.t TO db2.t;\n \nNote that moving a table to another database is not possible\nif it has some triggers. Trying to do so produces the\nfollowing error:\n \nERROR 1435 (HY000): Trigger in wrong schema\n \nAlso, views cannot be moved to another database:\n \nERROR 1450 (HY000): Changing schema from \'old_db\' to\n\'new_db\' is not allowed.\n \nIf a RENAME TABLE renames more than one table and one\nrenaming fails, all renames executed by the same statement\nare rolled back.\n \nRenames are always executed in the specified order. Knowing\nthis, it is also possible to swap two tables\' names:\n \nRENAME TABLE t1 TO tmp_table,\n t2 TO t1,\n tmp_table TO t2;\n \nPrivileges\n \nExecuting the RENAME TABLE statement requires the DROP,\nCREATE and INSERT privileges for the table or the database.\n \nWAIT/NOWAIT\n \nSet the lock wait timeout. See WAIT and NOWAIT.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/rename-table/','','https://mariadb.com/kb/en/library/rename-table/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (679,39,'TRUNCATE TABLE','Syntax\n------ \nTRUNCATE [TABLE] tbl_name\n [WAIT n | NOWAIT]\n \nDescription\n----------- \nTRUNCATE TABLE empties a table completely. It requires the\nDROP privilege. See GRANT.\n \ntbl_name can also be specified in the form db_name.tbl_name\n(see Identifier Qualifiers).\n \nLogically, TRUNCATE TABLE is equivalent to a DELETE\nstatement that deletes all rows, but there are practical\ndifferences under some circumstances.\n \nTRUNCATE TABLE will fail for an InnoDB table if any FOREIGN\nKEY constraints from other tables reference the table,\nreturning the error:\n \nERROR 1701 (42000): Cannot truncate a table referenced in a\nforeign key constraint\n \nForeign Key constraints between columns in the same table\nare permitted.\n \nFor an InnoDB table, if there are no FOREIGN KEY\nconstraints, InnoDB performs fast truncation by dropping the\noriginal table and creating an empty one with the same\ndefinition, which is much faster than deleting rows one by\none. The AUTO_INCREMENT counter is reset by TRUNCATE TABLE,\nregardless of whether there is a FOREIGN KEY constraint.\n \nThe count of rows affected by TRUNCATE TABLE is accurate\nonly\nwhen it is mapped to a DELETE statement.\n \nFor other storage engines, TRUNCATE TABLE differs from\nDELETE in the following ways:\nTruncate operations drop and re-create the table, which is\nmuch\n faster than deleting rows one by one, particularly for\nlarge tables.\nTruncate operations cause an implicit commit.\nTruncation operations cannot be performed if the session\nholds an\n active table lock.\nTruncation operations do not return a meaningful value for\nthe number\n of deleted rows. The usual result is \"0 rows affected,\"\nwhich should\n be interpreted as \"no information.\"\nAs long as the table format file tbl_name.frm is valid, the\n table can be re-created as an empty table\n with TRUNCATE TABLE, even if the data or index files have\nbecome\n corrupted.\nThe table handler does not remember the last\n used AUTO_INCREMENT value, but starts counting\n from the beginning. This is true even for MyISAM and\nInnoDB, which normally\n do not reuse sequence values.\nWhen used with partitioned tables, TRUNCATE TABLE preserves\n the partitioning; that is, the data and index files are\ndropped and\n re-created, while the partition definitions (.par) file is\n unaffected.\nSince truncation of a table does not make any use of DELETE,\n the TRUNCATE statement does not invoke ON DELETE triggers.\nTRUNCATE TABLE will only reset the values in the Performance\nSchema summary tables to zero or null, and will not remove\nthe rows.\n \nFor the purposes of binary logging and replication, TRUNCATE\nTABLE is treated as DROP TABLE followed by CREATE TABLE (DDL\nrather than DML).\n \nTRUNCATE TABLE does not work on views. Currently, TRUNCATE\nTABLE drops all historical records from a system-versioned\ntable.\n \nWAIT/NOWAIT\n \nSet the lock wait timeout. See WAIT and NOWAIT.\n \nOracle-mode\n \nOracle-mode from MariaDB 10.3 permits the optional keywords\nREUSE STORAGE or DROP STORAGE to be used.\n \nTRUNCATE [TABLE] tbl_name [{DROP | REUSE} STORAGE]\n \nThese have no effect on the operation.\n \nPerformance\n \nTRUNCATE TABLE is faster than DELETE, because it drops and\nre-creates a table.\n \nWith XtraDB/InnoDB, TRUNCATE TABLE is slower if\ninnodb_file_per_table=ON is set (the default since MariaDB\n5.5). This is because TRUNCATE TABLE unlinks the underlying\ntablespace file, which can be an expensive operation. See\nMDEV-8069 for more details.\n \nThe performance issues with innodb_file_per_table=ON can be\nexacerbated in cases where the InnoDB buffer pool is very\nlarge and innodb_adaptive_hash_index=ON is set. In that\ncase, using DROP TABLE followed by CREATE TABLE instead of\nTRUNCATE TABLE may perform better. Setting\ninnodb_adaptive_hash_index=OFF can also help. In MariaDB\n10.2.19 and later, this performance can also be improved by\nsetting innodb_safe_truncate=OFF. See MDEV-9459 for more\ndetails.\n \nSetting innodb_adaptive_hash_index=OFF can also improve\nTRUNCATE TABLE performance in general. See MDEV-16796 for\nmore details.\n \n\n\nURL: https://mariadb.com/kb/en/library/truncate-table/','','https://mariadb.com/kb/en/library/truncate-table/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (680,40,'LASTVAL','LASTVAL is a synonym for PREVIOUS VALUE for sequence_name.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/lastval/','','https://mariadb.com/kb/en/library/lastval/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (681,40,'NEXT VALUE for sequence_name','SEQUENCEs were introduced in MariaDB 10.3\n \nSyntax\n------ \nNEXT VALUE FOR sequence\n \nor\n \nNEXTVAL(sequence_name)\n \nor in Oracle mode (SQL_MODE=ORACLE)\n \nsequence_name.nextval\n \nNEXT VALUE FOR is ANSI SQL syntax while NEXTVAL() is\nPostgreSQL syntax.\n \nDescription\n----------- \nGenerate next value for a SEQUENCE.\nYou can greatly speed up NEXT VALUE by creating the sequence\nwith the CACHE option. If not, every NEXT VALUE usage will\ncause changes in the stored SEQUENCE table.\nWhen using NEXT VALUE the value will be reserved at once and\nwill not be reused, except if the SEQUENCE was created with\nCYCLE. This means that when you are using SEQUENCEs you have\nto expect gaps in the generated sequence numbers.\nIf one updates the SEQUENCE with SETVAL() or ALTER SEQUENCE\n... RESTART, NEXT VALUE FOR will notice this and start from\nthe next requested value.\nFLUSH TABLES will close the sequence and the next sequence\nnumber generated will be according to what\'s stored in the\nSEQUENCE object. In effect, this will discard the cached\nvalues.\nNEXT VALUE requires the INSERT privilege.\n \nYou can also use NEXT VALUE FOR sequence for column DEFAULT.\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/next-value-for-sequence_name/','','https://mariadb.com/kb/en/library/next-value-for-sequence_name/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (682,40,'NEXTVAL','NEXTVAL is a synonym for NEXT VALUE for sequence_name.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/library/nextval/','','https://mariadb.com/kb/en/library/nextval/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (683,40,'PREVIOUS VALUE FOR sequence_name','SEQUENCEs were introduced in MariaDB 10.3.\n \nSyntax\n------ \nPREVIOUS VALUE FOR sequence_name\n \nor\n \nLASTVAL(sequence_name)\n \nor in Oracle mode (SQL_MODE=ORACLE)\n \nsequence_name.currval\n \nPREVIOUS VALUE FOR is IBM DB2 syntax while LASTVAL() is\nPostgreSQL syntax.\n \nDescription\n----------- \nGet last value in the current connection generated from a\nsequence.\nIf the sequence has not yet been used by the connection,\nPREVIOUS VALUE FOR returns NULL\nIf a SEQUENCE has been dropped and re-created then it\'s\ntreated as a new SEQUENCE and PREVIOUS VALUE FOR will return\nNULL.\nFLUSH TABLES has no effect on PREVIOUS VALUE FOR.\nPrevious values for all used sequences are stored per\nconnection until connection ends.\n \nPREVIOUS VALUE FOR requires the SELECT privilege.\n \nExample\n \nSELECT PREVIOUS VALUE FOR s;\n \n+----------------------+\n| PREVIOUS VALUE FOR s |\n+----------------------+\n| 100 |\n+----------------------+\n \n\n\nURL:\nhttps://mariadb.com/kb/en/library/previous-value-for-sequence_name/','','https://mariadb.com/kb/en/library/previous-value-for-sequence_name/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (684,40,'Sequence Overview','Sequences were introduced in MariaDB 10.3.\n \nIntroduction\n \nA sequence is an object that generates a sequence of numeric\nvalues, as specified by the CREATE SEQUENCE statement. \n \nCREATE SEQUENCE will create a sequence that generates new\nvalues when called with NEXT VALUE FOR sequence_name. It\'s\nan alternative to AUTO INCREMENT when one wants to have more\ncontrol of how the numbers are generated. As the SEQUENCE\ncaches values (up to the CACHE value in the CREATE SEQUENCE\nstatement, by default 1000) it can in some cases be much\nfaster than AUTO INCREMENT. Another benefit is that one can\naccess the last value generated by all used sequences, which\nsolves one of the limitations with LAST_INSERT_ID().\n \nCreating a Sequence\n \nThe CREATE SEQUENCE statement is used to create a sequence.\nHere is an example of a sequence starting at 100,\nincrementing by 10 each time:\n \nCREATE SEQUENCE s START WITH 100 INCREMENT BY 10;\n \nThe CREATE SEQUENCE statement, along with defaults, can be\nviewd with the SHOW CREATE SEQUENCE STATEMENT, for example:\n \nSHOW CREATE SEQUENCE s\\G\n*************************** 1. row\n***************************\n Table: s\nCreate Table: CREATE SEQUENCE `s` start with 100 minvalue 1\nmaxvalue 9223372036854775806 \n increment by 10 cache 1000 nocycle ENGINE=InnoDB\n \nUsing Sequence Objects\n \nTo get the next value from a sequence, use\n \nNEXT VALUE FOR sequence_name\n \nor\n \nNEXTVAL(sequence_name)\n \nor in Oracle mode (SQL_MODE=ORACLE)\n \nsequence_name.nextval\n \nFor retrieving the last value used by the current connection\nfrom a sequence\nuse:\n \nPREVIOUS VALUE FOR sequence_name\n \nor\n \nLASTVAL(sequence_name)\n \nor in Oracle mode (SQL_MODE=ORACLE)\n \nsequence_name.currval\n \nFor example:\n \nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n| 100 |\n+------------+\n \nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n| 110 |\n+------------+\n \nSELECT LASTVAL(s);\n+------------+\n| LASTVAL(s) |\n+------------+\n| 110 |\n+------------+\n \nUsing Sequences in DEFAULT\n \nStarting from 10.3.3 you can use Sequences in DEFAULT:\n \ncreate sequence s1;\n \ncreate table t1 (a int primary key default (next value for\ns1), b int);\ninsert into t1 (b) values (1),(2);\nselect * from t1;\n \n+---+------+\n| a | b |\n+---+------+\n| 1 | 1 |\n| 2 | 2 |\n+---+------+\n \nChanging a Sequence\n \nThe ALTER SEQUENCE statement is used for changing sequences.\nFor example, to restart the sequence at another value:\n \nALTER SEQUENCE s RESTART 50;\n \nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n| 50 |\n+------------+\n \nThe SETVAL function can also be used to set the next value\nto be returned for a SEQUENCE, for example:\n \nSELECT SETVAL(s, 100);\n+----------------+\n| SETVAL(s, 100) |\n+----------------+\n| 100 |\n+----------------+\n \nSETVAL can only be used to increase the sequence value.\nAttempting to set a lower value will fail, returning NULL:\n \nSELECT SETVAL(s, 50);\n+---------------+\n| SETVAL(s, 50) |\n+---------------+\n| NULL |\n+---------------+\n \nDropping a Sequence\n \nThe DROP SEQUENCE statement is used to drop a sequence, for\nexample:\n \nDROP SEQUENCE s;\n \nReplication\n \nIf one wants to use Sequences in a master-master setup or\nwith Galera one\nshould use INCREMENT=0. This will tell the Sequence to use\nauto_increment_increment and auto_increment_offset to\ngenerate unique values for each server.\n \nStandards Compliance\n \nMariaDB 10.3 supports both ANSI SQL and Oracle syntax for\nsequences.\n \nHowever as SEQUENCE is implemented as a special kind of\ntable, it uses the same namespace as tables. The benefits\nare that sequences show up in SHOW TABLES, and one can also\ncreate a sequence with CREATE TABLE and drop it with DROP\nTABLE. One can SELECT from it as from any other table. This\nensures that all old tools that work with tables should work\nwith sequences.\n \nSince sequence objects act as regular tables in many\ncontexts, they will be affected by LOCK TABLES. This is not\nthe case in other DBMS, such as Oracle, where LOCK TABLE\ndoes not affect sequences.\n \nNotes\n \nOne of the goals with the Sequence implementation is that\nall old\ntools, such as mysqldump, should work unchanged, while still\nkeeping the\nnormal usage of sequence standard compatibly.\n \nTo make this possible, sequence is currently implemented as\na table with a few exclusive properties.\n \nThe special properties for sequence tables are:\nA sequence table has always one row.\nWhen one creates a sequence, either with CREATE TABLE or\nCREATE SEQUENCE, one row will be inserted.\nIf one tries to insert into a sequence table, the single row\nwill be updated. This allows mysqldump to work but also\ngives the additional benefit that one can change all\nproperties of a sequence with a single insert. New\napplications should of course also use ALTER SEQUENCE.\nUPDATE or DELETE can\'t be performed on Sequence objects.\nDoing a select on the sequence shows the current state of\nthe sequence, except the values that are reserved in the\ncache. The next_value column shows the next value not\nreserved by the cache.\nFLUSH TABLES will close the sequence and the next sequence\nnumber generated will be according to what\'s stored in the\nSequence object. In effect, this will discard the cached\nvalues.\nA number of normal table operations work on Sequence tables.\nSee next section.\n \nTable Operations that Work with Sequences\n \nSHOW CREATE TABLE sequence_name. This shows the table\nstructure that is behind the SEQUENCE including the field\nnames that can be used with SELECT or even CREATE TABLE.\nCREATE TABLE sequence-structure ... SEQUENCE=1\nALTER TABLE sequence RENAME TO sequence2\nRENAME TABLE sequence_name TO new_sequence_name\nDROP TABLE sequence_name. This is allowed mainly to get old\ntools like mysqldump to work with sequence tables.\nSHOW TABLES\n \nImplementation\n \nInternally, sequence tables are created as a normal table\nwithout\nrollback (the InnoDB, Aria and MySAM engines support this),\nwrapped by a\nsequence engine object. This allowed us to create sequences\nwith\nalmost no performance impact for normal tables. (The cost is\none \'if\'\nper insert if the binary log is enabled).\n \nUnderlying Table Structure\n \nThe following example shows the table structure of sequences\nand how it\ncan be used as a table.\n(Output of results are slightly edited to make them easier\nto read)\n \ncreate sequence t1;\nshow create sequence t1\\G\n***** 1. row *****\n CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue\n9223372036854775806\n increment by 1 cache 1000 nocycle ENGINE=InnoDB\n \nshow create table t1\\G\n***** 1. row *****\nCreate Table: CREATE TABLE `t1` (\n `next_not_cached_value` bigint(21) NOT NULL,\n `minimum_value` bigint(21) NOT NULL,\n `maximum_value` bigint(21) NOT NULL,\n `start_value` bigint(21) NOT NULL COMMENT \'start value\nwhen sequences is created or value if RESTART is used\',\n `increment` bigint(21) NOT NULL COMMENT \'increment\nvalue\',\n `cache_size` bigint(21) unsigned NOT NULL,\n `cycle_option` tinyint(1) unsigned NOT NULL COMMENT \'0 if\nno cycles are allowed, 1 if the sequence should begin a new\ncycle when maximum_value is passed\',\n `cycle_count` bigint(21) NOT NULL COMMENT \'How many cycles\nhave been done\'\n) ENGINE=InnoDB SEQUENCE=1\n \nselect * from t1\\G\nnext_not_cached_value: 1\n minimum_value: 1\n maximum_value: 9223372036854775806\n start_value: 1\n increment: 1\n cache_size: 1000\n cycle_option: 0\n cycle_count: 0\nThe cycle_count column is incremented every time the\nsequence wraps around.\n \nCredits\n \nThanks to Jianwe Zhao from Aliyun for his work on SEQUENCE\nin AliSQL, which gave ideas and inspiration for this work.\nThanks to Peter Gulutzan,who helped test and gave useful\ncomments about the implementation.\n \n\n\nURL: https://mariadb.com/kb/en/library/sequence-overview/','','https://mariadb.com/kb/en/library/sequence-overview/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (685,40,'SETVAL()','SEQUENCEs were introduced in MariaDB 10.3.\n \nSyntax\n------ \nSETVAL(sequence_name, next_value, [is_used, [round]])\n \nDescription\n----------- \nSet the next value to be returned for a SEQUENCE.\n \nThis function is compatible with PostgreSQL syntax, extended\nwith the round argument.\n \nIf the is_used argument is not given or is 1 or true, then\nthe next used value will\none after the given value. If is_used is 0 or false then the\nnext generated value\nwill be the given value.\n \nIf round is used then it will set the round value (or the\ninternal cycle count, starting at zero) for the sequence.\nIf round is not used, it\'s assumed to be 0.\n \nnext_value must be an integer literal.\n \nFor SEQUENCE tables defined with CYCLE (see CREATE SEQUENCE)\none should use both next_value and round to define the next\nvalue. In this case the\ncurrent sequence value is defined to be round, next_value.\n \nThe result returned by SETVAL() is next_value or NULL if the\ngiven next_value and round is smaller than the current\nvalue.\n \nSETVAL() will not set the SEQUENCE value to a something that\nis less than\nits current value. This is needed to ensure that SETVAL()\nis replication safe. If you want to set the SEQUENCE to a\nsmaller number\nuse ALTER SEQUENCE.\n \nIf CYCLE is used, first round and then next_value are\ncompared\nto see if the value is bigger than the current value.\n \nInternally, in the MariaDB server, SETVAL() is used to\ninform\nslaves that a SEQUENCE has changed value. The slave may get\nSETVAL() statements out of order, but this is ok as only the\nbiggest one will have an effect.\n \nSETVAL requires the INSERT privilege.\n \nExamples\n-------- \nSELECT setval(foo, 42); -- Next nextval will return 43\nSELECT setval(foo, 42, true); -- Same as above\nSELECT setval(foo, 42, false); -- Next nextval will return\n42\n \nSETVAL setting higher and lower values on a sequence with an\nincrement of 10:\n \nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n| 50 |\n+------------+\n \nSELECT SETVAL(s, 100);\n+----------------+\n| SETVAL(s, 100) |\n+----------------+\n| 100 |\n+----------------+\n \nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n| 110 |\n+------------+\n \nSELECT SETVAL(s, 50);\n+---------------+\n| SETVAL(s, 50) |\n+---------------+\n| NULL |\n+---------------+\n \nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n| 120 |\n+------------+\n \nExample demonstrating round:\n \nCREATE OR REPLACE SEQUENCE s1\n START WITH 1\n MINVALUE 1\n MAXVALUE 99\n INCREMENT BY 1 \n CACHE 20 \n CYCLE;\n \nSELECT SETVAL(s1, 99, 1, 0);\n+----------------------+\n| SETVAL(s1, 99, 1, 0) |\n+----------------------+\n| 99 |\n+----------------------+\n \nSELECT NEXTVAL(s1);\n+-------------+\n| NEXTVAL(s1) |\n+-------------+\n| 1 |\n+-------------+\n \nThe following statement returns NULL, as the given\nnext_value and round is smaller than the current value.\n \nSELECT SETVAL(s1, 99, 1, 0);\n+----------------------+\n| SETVAL(s1, 99, 1, 0) |\n+----------------------+\n| NULL |\n+----------------------+\n \nSELECT NEXTVAL(s1);\n+-------------+\n| NEXTVAL(s1) |\n+-------------+\n| 2 |\n+-------------+\n \nIncreasing the round from zero to 1 will allow next_value to\nbe returned.\n \nSELECT SETVAL(s1, 99, 1, 1);\n+----------------------+\n| SETVAL(s1, 99, 1, 1) |\n+----------------------+\n| 99 |\n+----------------------+\n \nSELECT NEXTVAL(s1);\n+-------------+\n| NEXTVAL(s1) |\n+-------------+\n| 1 |\n+-------------+\n \n\n\nURL: https://mariadb.com/kb/en/library/setval/','','https://mariadb.com/kb/en/library/setval/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (686,41,'JSON_ARRAY','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_ARRAY([value[, value2] ...])\n \nDescription\n----------- \nReturns a JSON array containing the listed values. The list\ncan be empty.\n \nExample\n \nSELECT Json_Array(56, 3.1416, \'My name is \"Foo\"\', NULL);\n+--------------------------------------------------+\n| Json_Array(56, 3.1416, \'My name is \"Foo\"\', NULL) |\n+--------------------------------------------------+\n| [56, 3.1416, \"My name is \\\"Foo\\\"\", null] |\n+--------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_array/','','https://mariadb.com/kb/en/json_array/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (687,41,'JSON_ARRAY_APPEND','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_ARRAY_APPEND(json_doc, path, value[, path, value] ...)\n \nDescription\n----------- \nAppends values to the end of the specified arrays within a\nJSON document, returning the result, or NULL if any of the\narguments are NULL.\n \nEvaluation is performed from left to right, with the\nresulting document from the previous pair becoming the new\nvalue against which the next pair is evaluated.\n \nIf the json_doc is not a valid JSON document, or if any of\nthe paths are not valid, or contain a * or ** wildcard, an\nerror is returned.\n \nExamples\n-------- \nSET @json = \'[1, 2, [3, 4]]\';\n \nSELECT JSON_ARRAY_APPEND(@json, \'$[0]\', 5)\n+-------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$[0]\', 5) |\n+-------------------------------------+\n| [[1, 5], 2, [3, 4]] |\n+-------------------------------------+\n \nSELECT JSON_ARRAY_APPEND(@json, \'$[1]\', 6);\n+-------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$[1]\', 6) |\n+-------------------------------------+\n| [1, [2, 6], [3, 4]] |\n+-------------------------------------+\n \nSELECT JSON_ARRAY_APPEND(@json, \'$[1]\', 6, \'$[2]\', 7);\n+------------------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$[1]\', 6, \'$[2]\', 7) |\n+------------------------------------------------+\n| [1, [2, 6], [3, 4, 7]] |\n+------------------------------------------------+\n \nSELECT JSON_ARRAY_APPEND(@json, \'$\', 5);\n+----------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$\', 5) |\n+----------------------------------+\n| [1, 2, [3, 4], 5] |\n+----------------------------------+\n \nSET @json = \'{\"A\": 1, \"B\": [2], \"C\": [3, 4]}\';\n \nSELECT JSON_ARRAY_APPEND(@json, \'$.B\', 5);\n+------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$.B\', 5) |\n+------------------------------------+\n| {\"A\": 1, \"B\": [2, 5], \"C\": [3, 4]} |\n+------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_array_append/','','https://mariadb.com/kb/en/json_array_append/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (688,41,'JSON_ARRAY_INSERT','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_ARRAY_INSERT(json_doc, path, value[, path, value] ...)\n \nDescription\n----------- \nInserts a value into a JSON document, returning the modified\ndocument, or NULL if any of the arguments are NULL.\n \nEvaluation is performed from left to right, with the\nresulting document from the previous pair becoming the new\nvalue against which the next pair is evaluated.\n \nIf the json_doc is not a valid JSON document, or if any of\nthe paths are not valid, or contain a * or ** wildcard, an\nerror is returned.\n \nExamples\n-------- \nSET @json = \'[1, 2, [3, 4]]\';\n \nSELECT JSON_ARRAY_INSERT(@json, \'$[0]\', 5);\n+-------------------------------------+\n| JSON_ARRAY_INSERT(@json, \'$[0]\', 5) |\n+-------------------------------------+\n| [5, 1, 2, [3, 4]] |\n+-------------------------------------+\n \nSELECT JSON_ARRAY_INSERT(@json, \'$[1]\', 6);\n+-------------------------------------+\n| JSON_ARRAY_INSERT(@json, \'$[1]\', 6) |\n+-------------------------------------+\n| [1, 6, 2, [3, 4]] |\n+-------------------------------------+\n \nSELECT JSON_ARRAY_INSERT(@json, \'$[1]\', 6, \'$[2]\', 7);\n+------------------------------------------------+\n| JSON_ARRAY_INSERT(@json, \'$[1]\', 6, \'$[2]\', 7) |\n+------------------------------------------------+\n| [1, 6, 7, 2, [3, 4]] |\n+------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_array_insert/','','https://mariadb.com/kb/en/json_array_insert/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (689,41,'JSON_COMPACT','This function was added in MariaDB 10.2.4.\n \nSyntax\n------ \nJSON_COMPACT(json_doc)\n \nDescription\n----------- \nRemoves all unnecessary spaces so the json document is as\nshort as possible.\n \nExample\n \nSET @j = \'{ \"A\": 1, \"B\": [2, 3]}\';\n \nSELECT JSON_COMPACT(@j), @j;\n+-------------------+------------------------+\n| JSON_COMPACT(@j) | @j |\n+-------------------+------------------------+\n| {\"A\":1,\"B\":[2,3]} | { \"A\": 1, \"B\": [2, 3]} |\n+-------------------+------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_compact/','','https://mariadb.com/kb/en/json_compact/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (690,41,'JSON_CONTAINS','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_CONTAINS(json_doc, val[, path])\n \nDescription\n----------- \nReturns whether or not the specified value is found in the\ngiven JSON document or, optionally, at the specified path\nwithin the document. Returns 1 if it does, 0 if not and NULL\nif any of the arguments are null. An error occurs if the\ndocument or path is not valid, or contains the * or **\nwildcards.\n \nExamples\n-------- \nSET @json = \'{\"A\": 0, \"B\": {\"C\": 1}, \"D\": 2}\';\n \nSELECT JSON_CONTAINS(@json, \'2\', \'$.A\');\n+----------------------------------+\n| JSON_CONTAINS(@json, \'2\', \'$.A\') |\n+----------------------------------+\n| 0 |\n+----------------------------------+\n \nSELECT JSON_CONTAINS(@json, \'2\', \'$.D\');\n+----------------------------------+\n| JSON_CONTAINS(@json, \'2\', \'$.D\') |\n+----------------------------------+\n| 1 |\n+----------------------------------+\n \nSELECT JSON_CONTAINS(@json, \'{\"C\": 1}\', \'$.A\');\n+-----------------------------------------+\n| JSON_CONTAINS(@json, \'{\"C\": 1}\', \'$.A\') |\n+-----------------------------------------+\n| 0 |\n+-----------------------------------------+\n \nSELECT JSON_CONTAINS(@json, \'{\"C\": 1}\', \'$.B\');\n+-----------------------------------------+\n| JSON_CONTAINS(@json, \'{\"C\": 1}\', \'$.B\') |\n+-----------------------------------------+\n| 1 |\n+-----------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_contains/','','https://mariadb.com/kb/en/json_contains/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (691,41,'JSON_CONTAINS_PATH','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_CONTAINS_PATH(json_doc, return_arg, path[, path] ...)\n \nDescription\n----------- \nIndicates whether the given JSON document contains data at\nthe specified path or paths. Returns 1 if it does, 0 if not\nand NULL if any of the arguments are null.\n \nThe return_arg can be one or all:\none - Returns 1 if at least one path exists within the JSON\ndocument. \nall - Returns 1 only if all paths exist within the JSON\ndocument.\n \nExamples\n-------- \nSET @json = \'{\"A\": 1, \"B\": [2], \"C\": [3, 4]}\';\n \nSELECT JSON_CONTAINS_PATH(@json, \'one\', \'$.A\', \'$.D\');\n+------------------------------------------------+\n| JSON_CONTAINS_PATH(@json, \'one\', \'$.A\', \'$.D\') |\n+------------------------------------------------+\n| 1 |\n+------------------------------------------------+\n1 row in set (0.00 sec)\n \nSELECT JSON_CONTAINS_PATH(@json, \'all\', \'$.A\', \'$.D\');\n+------------------------------------------------+\n| JSON_CONTAINS_PATH(@json, \'all\', \'$.A\', \'$.D\') |\n+------------------------------------------------+\n| 0 |\n+------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_contains_path/','','https://mariadb.com/kb/en/json_contains_path/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (692,41,'JSON_DEPTH','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_DEPTH(json_doc)\n \nDescription\n----------- \nReturns the maximum depth of the given JSON document, or\nNULL if the argument is null. An error will occur if the\nargument is an invalid JSON document.\nScalar values or empty arrays or objects have a depth of 1.\nArrays or objects that are not empty but contain only\nelements or member values of depth 1 will have a depth of 2.\nIn other cases, the depth will be greater than 2.\n \nExamples\n-------- \nSELECT JSON_DEPTH(\'[]\'), JSON_DEPTH(\'true\'),\nJSON_DEPTH(\'{}\');\n+------------------+--------------------+------------------+\n| JSON_DEPTH(\'[]\') | JSON_DEPTH(\'true\') |\nJSON_DEPTH(\'{}\') |\n+------------------+--------------------+------------------+\n| 1 | 1 | 1 |\n+------------------+--------------------+------------------+\n \nSELECT JSON_DEPTH(\'[1, 2, 3]\'), JSON_DEPTH(\'[[], {},\n[]]\');\n+-------------------------+----------------------------+\n| JSON_DEPTH(\'[1, 2, 3]\') | JSON_DEPTH(\'[[], {}, []]\') |\n+-------------------------+----------------------------+\n| 2 | 2 |\n+-------------------------+----------------------------+\n \nSELECT JSON_DEPTH(\'[1, 2, [3, 4, 5, 6], 7]\');\n+---------------------------------------+\n| JSON_DEPTH(\'[1, 2, [3, 4, 5, 6], 7]\') |\n+---------------------------------------+\n| 3 |\n+---------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_depth/','','https://mariadb.com/kb/en/json_depth/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (693,41,'JSON_DETAILED','This function was added in MariaDB 10.2.4.\n \nSyntax\n------ \nJSON_DETAILED(json_doc[, tab_size])\n \nDescription\n----------- \nRepresents JSON in the most understandable way emphasizing\nnested structures.\n \nExample\n \nSET @j = \'{ \"A\":1,\"B\":[2,3]}\';\n \nSELECT @j;\n+--------------------+\n| @j |\n+--------------------+\n| { \"A\":1,\"B\":[2,3]} |\n+--------------------+\n \nSELECT JSON_DETAILED(@j);\n+------------------------------------------------------------+\n| JSON_DETAILED(@j) |\n+------------------------------------------------------------+\n| {\n \"A\": 1,\n \"B\": \n [\n 2,\n 3\n ]\n} |\n+------------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_detailed/','','https://mariadb.com/kb/en/json_detailed/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (694,41,'JSON_EXISTS','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nDescription\n----------- \nDetermines whether a specified JSON value exists in the\ngiven data. Returns 1 if found, 0 if not, or NULL if any of\nthe inputs were NULL.\n \nExamples\n-------- \nSELECT JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2,\n3]}\', \"$.key2\");\n+------------------------------------------------------------+\n| JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\',\n\"$.key2\") |\n+------------------------------------------------------------+\n| 1 |\n+------------------------------------------------------------+\n \nSELECT JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2,\n3]}\', \"$.key3\");\n+------------------------------------------------------------+\n| JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\',\n\"$.key3\") |\n+------------------------------------------------------------+\n| 0 |\n+------------------------------------------------------------+\n \nSELECT JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2,\n3]}\', \"$.key2[1]\");\n+---------------------------------------------------------------+\n| JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\',\n\"$.key2[1]\") |\n+---------------------------------------------------------------+\n| 1 |\n+---------------------------------------------------------------+\n \nSELECT JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2,\n3]}\', \"$.key2[10]\");\n+----------------------------------------------------------------+\n| JSON_EXISTS(\'{\"key1\":\"xxxx\", \"key2\":[1, 2, 3]}\',\n\"$.key2[10]\") |\n+----------------------------------------------------------------+\n| 0 |\n+----------------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_exists/','','https://mariadb.com/kb/en/json_exists/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (695,41,'JSON_EXTRACT','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_EXTRACT(json_doc, path[, path] ...)\n \nDescription\n----------- \nExtracts data from a JSON document. The extracted data is\nselected from the parts matching the path arguments. Returns\nall matched values; either as a single matched value, or, if\nthe arguments could return multiple values, a result\nautowrapped as an array in the matching order.\n \nReturns NULL if no paths match or if any of the arguments\nare NULL. \n \nAn error will occur if any path argument is not a valid\npath, or if the json_doc argument is not a valid JSON\ndocument.\n \nExamples\n-------- \nSET @json = \'[1, 2, [3, 4]]\';\n \nSELECT JSON_EXTRACT(@json, \'$[1]\');\n+-----------------------------+\n| JSON_EXTRACT(@json, \'$[1]\') |\n+-----------------------------+\n| 2 |\n+-----------------------------+\n \nSELECT JSON_EXTRACT(@json, \'$[2]\');\n+-----------------------------+\n| JSON_EXTRACT(@json, \'$[2]\') |\n+-----------------------------+\n| [3, 4] |\n+-----------------------------+\n \nSELECT JSON_EXTRACT(@json, \'$[2][1]\');\n+--------------------------------+\n| JSON_EXTRACT(@json, \'$[2][1]\') |\n+--------------------------------+\n| 4 |\n+--------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_extract/','','https://mariadb.com/kb/en/json_extract/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (696,41,'JSON_INSERT','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_INSERT(json_doc, path, val[, path, val] ...)\n \nDescription\n----------- \nInserts data into a JSON document, returning the resulting\ndocument or NULL if any argument is null. \n \nAn error will occur if the JSON document is not invalid, or\nif any of the paths are invalid or contain a * or **\nwildcard.\n \nJSON_INSERT can only insert data while JSON_REPLACE can only\nupdate. JSON_SET can update or insert data. \n \nExamples\n-------- \nSET @json = \'{ \"A\": 0, \"B\": [1, 2]}\';\n \nSELECT JSON_INSERT(@json, \'$.C\', \'[3, 4]\');\n+--------------------------------------+\n| JSON_INSERT(@json, \'$.C\', \'[3, 4]\') |\n+--------------------------------------+\n| { \"A\": 0, \"B\": [1, 2], \"C\":\"[3, 4]\"} |\n+--------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_insert/','','https://mariadb.com/kb/en/json_insert/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (697,41,'JSON_KEYS','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_KEYS(json_doc[, path])\n \nDescription\n----------- \nReturns the keys as a JSON array from the top-level value of\na JSON object or, if the optional path argument is provided,\nthe top-level keys from the path. \n \nExcludes keys from nested sub-objects in the top level\nvalue. The resulting array will be empty if the selected\nobject is empty.\n \nReturns NULL if any of the arguments are null, a given path\ndoes not locate an object, or if the json_doc argument is\nnot an object.\n \nAn error will occur if JSON document is invalid, the path is\ninvalid or if the path contains a * or ** wildcard.\n \nExamples\n-------- \nSELECT JSON_KEYS(\'{\"A\": 1, \"B\": {\"C\": 2}}\');\n+--------------------------------------+\n| JSON_KEYS(\'{\"A\": 1, \"B\": {\"C\": 2}}\') |\n+--------------------------------------+\n| [\"A\", \"B\"] |\n+--------------------------------------+\n \nSELECT JSON_KEYS(\'{\"A\": 1, \"B\": 2, \"C\": {\"D\":\n3}}\', \'$.C\');\n+-----------------------------------------------------+\n| JSON_KEYS(\'{\"A\": 1, \"B\": 2, \"C\": {\"D\": 3}}\',\n\'$.C\') |\n+-----------------------------------------------------+\n| [\"D\"] |\n+-----------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_keys/','','https://mariadb.com/kb/en/json_keys/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (698,41,'JSON_LENGTH','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_LENGTH(json_doc[, path])\n \nDescription\n----------- \nReturns the length of a JSON document, or, if the optional\npath argument is given, the length of the value within the\ndocument specified by the path. \n \nReturns NULL if any of the arguments argument are null or\nthe path argument does not identify a value in the document.\n\n \nAn error will occur if the JSON document is invalid, the\npath is invalid or if the path contains a * or ** wildcard.\n \nLength will be determined as follow:\nA scalar\'s length is always 1.\nIf an array, the number of elements in the array.\nIf an object, the number of members in the object.\n \nThe length of nested arrays or objects are not counted.\n \nExamples\n-------- \n\n \n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_length/','','https://mariadb.com/kb/en/json_length/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (699,41,'JSON_LOOSE','This function was added in MariaDB 10.2.4.\n \nSyntax\n------ \nJSON_LOOSE(json_doc)\n \nDescription\n----------- \nAdds spaces to a JSON document to make it look more\nreadable.\n \nExample\n \nSET @j = \'{ \"A\":1,\"B\":[2,3]}\';\n \nSELECT JSON_LOOSE(@j), @j;\n+-----------------------+--------------------+\n| JSON_LOOSE(@j) | @j |\n+-----------------------+--------------------+\n| {\"A\": 1, \"B\": [2, 3]} | { \"A\":1,\"B\":[2,3]} |\n+-----------------------+--------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_loose/','','https://mariadb.com/kb/en/json_loose/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (700,41,'JSON_MERGE','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_MERGE(json_doc, json_doc[, json_doc] ...)\n \nDescription\n----------- \nMerges the given JSON documents.\n \nReturns the merged result,or NULL if any argument is NULL.\n \nAn error occurs if any of the arguments are not valid JSON\ndocuments.\n \nExample\n \nSET @json1 = \'[1, 2]\';\n \nSET @json2 = \'[3, 4]\';\n \nSELECT JSON_MERGE(@json1,@json2);\n+---------------------------+\n| JSON_MERGE(@json1,@json2) |\n+---------------------------+\n| [1, 2, 3, 4] |\n+---------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_merge/','','https://mariadb.com/kb/en/json_merge/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (701,41,'JSON_OBJECT','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_OBJECT([key, value[, key, value] ...])\n \nDescription\n----------- \nReturns a JSON object containing the given key/value pairs.\nThe key/value list can be empty.\n \nAn error will occur if there are an odd number of arguments,\nor any key name is NULL.\n \nExample\n \nSELECT JSON_OBJECT(\"id\", 1, \"name\", \"Monty\");\n+---------------------------------------+\n| JSON_OBJECT(\"id\", 1, \"name\", \"Monty\") |\n+---------------------------------------+\n| {\"id\": 1, \"name\": \"Monty\"} |\n+---------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_object/','','https://mariadb.com/kb/en/json_object/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (702,41,'JSON_QUERY','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_QUERY(json_doc, path)\n \nDescription\n----------- \nGiven a JSON document, returns an object or array specified\nby the path. Returns NULL if not given a valid JSON\ndocument, or if there is no match.\n \nExamples\n-------- \nselect json_query(\'{\"key1\":{\"a\":1, \"b\":[1,2]}}\',\n\'$.key1\');\n+-----------------------------------------------------+\n| json_query(\'{\"key1\":{\"a\":1, \"b\":[1,2]}}\',\n\'$.key1\') |\n+-----------------------------------------------------+\n| {\"a\":1, \"b\":[1,2]} |\n+-----------------------------------------------------+\n \nselect json_query(\'{\"key1\":123, \"key1\": [1,2,3]}\',\n\'$.key1\');\n+-------------------------------------------------------+\n| json_query(\'{\"key1\":123, \"key1\": [1,2,3]}\',\n\'$.key1\') |\n+-------------------------------------------------------+\n| [1,2,3] |\n+-------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_query/','','https://mariadb.com/kb/en/json_query/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (703,41,'JSON_QUOTE','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_QUOTE(json_value)\n \nDescription\n----------- \nQuotes a string as a JSON value, usually for producing valid\nJSON string literals for inclusion in JSON documents. Wraps\nthe string with double quote characters and escapes interior\nquotes and other special characters, returning a utf8mb4\nstring. \n \nReturns NULL if the argument is NULL.\n \nExamples\n-------- \nSELECT JSON_QUOTE(\'A\'), JSON_QUOTE(\"B\"),\nJSON_QUOTE(\'\"C\"\');\n+-----------------+-----------------+-------------------+\n| JSON_QUOTE(\'A\') | JSON_QUOTE(\"B\") |\nJSON_QUOTE(\'\"C\"\') |\n+-----------------+-----------------+-------------------+\n| \"A\" | \"B\" | \"\\\"C\\\"\" |\n+-----------------+-----------------+-------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_quote/','','https://mariadb.com/kb/en/json_quote/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (704,41,'JSON_REMOVE','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_REMOVE(json_doc, path[, path] ...)\n \nDescription\n----------- \nRemoves data from a JSON document returning the result, or\nNULL if any of the arguments are null. If the element does\nnot exist in the document, no changes are made.\n \nAn error will occur if JSON document is invalid, the path is\ninvalid or if the path contains a * or ** wildcard.\n \nPath arguments are evaluated from left to right, with the\nresult from the earlier evaluation being used as the value\nfor the next.\n \nExamples\n-------- \nSELECT JSON_REMOVE(\'{\"A\": 1, \"B\": 2, \"C\": {\"D\":\n3}}\', \'$.C\');\n+-------------------------------------------------------+\n| JSON_REMOVE(\'{\"A\": 1, \"B\": 2, \"C\": {\"D\": 3}}\',\n\'$.C\') |\n+-------------------------------------------------------+\n| {\"A\": 1, \"B\": 2} |\n+-------------------------------------------------------+\n \nSELECT JSON_REMOVE(\'[\"A\", \"B\", [\"C\", \"D\"],\n\"E\"]\', \'$[1]\');\n+----------------------------------------------------+\n| JSON_REMOVE(\'[\"A\", \"B\", [\"C\", \"D\"], \"E\"]\',\n\'$[1]\') |\n+----------------------------------------------------+\n| [\"A\", [\"C\", \"D\"], \"E\"] |\n+----------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_remove/','','https://mariadb.com/kb/en/json_remove/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (705,41,'JSON_REPLACE','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_REPLACE(json_doc, path, val[, path, val] ...)\n \nDescription\n----------- \nReplaces existing values in a JSON document, returning the\nresult, or NULL if any of the arguments are NULL. \n \nAn error will occur if the JSON document is invalid, the\npath is invalid or if the path contains a * or ** wildcard.\n \nPaths and values are evaluated from left to right, with the\nresult from the earlier evaluation being used as the value\nfor the next.\n \nJSON_REPLACE can only update data, while JSON_INSERT can\nonly insert. JSON_SET can update or insert data. \n \nExamples\n-------- \nSELECT JSON_REPLACE(\'{ \"A\": 1, \"B\": [2, 3]}\',\n\'$.B[1]\', 4);\n+-----------------------------------------------------+\n| JSON_REPLACE(\'{ \"A\": 1, \"B\": [2, 3]}\', \'$.B[1]\',\n4) |\n+-----------------------------------------------------+\n| { \"A\": 1, \"B\": [2, 4]} |\n+-----------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_replace/','','https://mariadb.com/kb/en/json_replace/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (706,41,'JSON_SEARCH','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_SEARCH(json_doc, return_arg, search_str[, escape_char[,\npath] ...])\n \nDescription\n----------- \nReturns the path to the given string within a JSON document,\nor NULL if any of json_doc, search_str or a path argument is\nNULL; if the search string is not found, or if no path\nexists within the document. \n \nA warning will occur if the JSON document is not valid, any\nof the path arguments are not valid, if return_arg is\nneither one nor all, or if the escape character is not a\nconstant. NULL will be returned.\n \nreturn_arg can be one of two values:\n\'one: Terminates after finding the first match, so will\nreturn one path string. If there is more than one match, it\nis undefined which is considered first.\nall: Returns all matching path strings, without duplicates.\nMultiple strings are autowrapped as an array. The order is\nundefined.\n \nExamples\n-------- \nSET @json = \'[\"A\", [{\"B\": \"1\"}], {\"C\":\"AB\"},\n{\"D\":\"BC\"}]\';\n \nSELECT JSON_SEARCH(@json, \'one\', \'AB\');\n+---------------------------------+\n| JSON_SEARCH(@json, \'one\', \'AB\') |\n+---------------------------------+\n| \"$[2].C\" |\n+---------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_search/','','https://mariadb.com/kb/en/json_search/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (707,41,'JSON_SET','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_SET(json_doc, path, val[, path, val] ...)\n \nDescription\n----------- \nUpdates or inserts data into a JSON document, returning the\nresult, or NULL if any of the arguments are NULL or the\noptional path fails to find an object.\n \nAn error will occur if the JSON document is invalid, the\npath is invalid or if the path contains a * or wildcard.\n \nJSON_SET can update or insert data, while JSON_REPLACE can\nonly update, and JSON_INSERT only insert. \n \nExamples\n-------- \n\n \n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_set/','','https://mariadb.com/kb/en/json_set/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (708,41,'JSON_TYPE','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_TYPE(json_val)\n \nDescription\n----------- \nReturns the type of a JSON value, or NULL if the argument is\nnull.\n \nAn error will occur if the argument is an invalid JSON\nvalue.\n \nThe following is a complete list of the possible return\ntypes:\n \nReturn type | Value | \n \nARRAY | JSON array | \n \nBIT | MariaDB BIT scalar | \n \nBLOB | MariaDB binary types (BINARY, VARBINARY or BLOB) | \n \nBOOLEAN | JSON true/false literals | \n \nDATE | MariaDB DATE scalar | \n \nDATETIME | MariaDB DATETIME or TIMESTAMP scalar | \n \nDECIMAL | MariaDB DECIMAL or NUMERIC scalar | \n \nDOUBLE | MariaDB DOUBLE FLOAT scalar | \n \nINTEGER | MariaDB integer types (TINYINT, SMALLINT,\nMEDIUMINT, INT or BIGINT) | \n \nNULL | JSON null literal or NULL argument | \n \nOBJECT | JSON object | \n \nOPAQUE | Any valid JSON value that is not one of the other\ntypes. | \n \nSTRING | MariaDB character types (CHAR, VARCHAR, TEXT, ENUM\nor SET) | \n \nTIME | MariaDB TIME scalar | \n \nExamples\n-------- \nSELECT JSON_TYPE(\'{\"A\": 1, \"B\": 2, \"C\": 3}\');\n+---------------------------------------+\n| JSON_TYPE(\'{\"A\": 1, \"B\": 2, \"C\": 3}\') |\n+---------------------------------------+\n| OBJECT |\n+---------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_type/','','https://mariadb.com/kb/en/json_type/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (709,41,'JSON_UNQUOTE','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_UNQUOTE(val)\n \nDescription\n----------- \nUnquotes a JSON value, returning a string, or NULL if the\nargument is null. \n \nAn error will occur if the given value begins and ends with\ndouble quotes and is an invalid JSON string literal.\n \nCertain character sequences have special meanings within a\nstring. Usually, a backspace is ignored, but the escape\nsequences in the table below are recognised by MariaDB,\nunless the SQL Mode is set to NO_BACKSLASH_ESCAPES SQL.\n \nEscape sequence | Character | \n \n\\\" | Double quote (\") | \n \n\\b | Backspace | \n \n\\f | Formfeed | \n \n\\n | Newline (linefeed) | \n \n\\r | Carriage return | \n \n\\t | Tab | \n \n\\\\ | Backslash (\\) | \n \n\\uXXXX | UTF-8 bytes for Unicode value XXXX | \n \nExamples\n-------- \nSELECT JSON_UNQUOTE(\'\"Monty\"\');\n+-------------------------+\n| JSON_UNQUOTE(\'\"Monty\"\') |\n+-------------------------+\n| Monty |\n+-------------------------+\n \nWith the default SQL Mode:\n \nSELECT JSON_UNQUOTE(\'Si\\bng\\ting\');\n+-----------------------------+\n| JSON_UNQUOTE(\'Si\\bng\\ting\') |\n+-----------------------------+\n| Sng ing |\n+-----------------------------+\n \nSetting NO_BACKSLASH_ESCAPES:\n \nSET @@sql_mode = \'NO_BACKSLASH_ESCAPES\';\n \nSELECT JSON_UNQUOTE(\'Si\\bng\\ting\');\n+-----------------------------+\n| JSON_UNQUOTE(\'Si\\bng\\ting\') |\n+-----------------------------+\n| Si\\bng\\ting |\n+-----------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_unquote/','','https://mariadb.com/kb/en/json_unquote/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (710,41,'JSON_VALID','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_VALID(value)\n \nDescription\n----------- \nIndicates whether the given value is a valid JSON document\nor not. Returns 1 if valid, 0 if not, and NULL if the\nargument is NULL.\n \nFrom MariaDB 10.4.3, the JSON_VALID function is\nautomatically used as a CHECK constraint for the JSON data\ntype alias in order to ensure that a valid json document is\ninserted. \n \nExamples\n-------- \nSELECT JSON_VALID(\'{\"id\": 1, \"name\": \"Monty\"}\');\n+------------------------------------------+\n| JSON_VALID(\'{\"id\": 1, \"name\": \"Monty\"}\') |\n+------------------------------------------+\n| 1 |\n+------------------------------------------+\n \nSELECT JSON_VALID(\'{\"id\": 1, \"name\": \"Monty\",\n\"oddfield\"}\');\n+------------------------------------------------------+\n| JSON_VALID(\'{\"id\": 1, \"name\": \"Monty\",\n\"oddfield\"}\') |\n+------------------------------------------------------+\n| 0 |\n+------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_valid/','','https://mariadb.com/kb/en/json_valid/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (711,41,'JSON_VALUE','JSON functions were added in MariaDB 10.2.3.\n \nSyntax\n------ \nJSON_VALUE(json_doc, path)\n \nDescription\n----------- \nGiven a JSON document, returns the scalar specified by the\npath. Returns NULL if not given a valid JSON document, or if\nthere is no match.\n \nExamples\n-------- \nselect json_value(\'{\"key1\":123}\', \'$.key1\');\n+--------------------------------------+\n| json_value(\'{\"key1\":123}\', \'$.key1\') |\n+--------------------------------------+\n| 123 |\n+--------------------------------------+\n \nselect json_value(\'{\"key1\": [1,2,3], \"key1\":123}\',\n\'$.key1\');\n+-------------------------------------------------------+\n| json_value(\'{\"key1\": [1,2,3], \"key1\":123}\',\n\'$.key1\') |\n+-------------------------------------------------------+\n| 123 |\n+-------------------------------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/json_value/','','https://mariadb.com/kb/en/json_value/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (712,42,'CUME_DIST','The CUME_DIST() function was first introduced with window\nfunctions in MariaDB 10.2.0.\n \nSyntax\n------ \nCUME_DIST() OVER ( \n [ PARTITION BY partition_expression ] \n [ ORDER BY order_list ]\n)\n \nDescription\n----------- \nCUME_DIST() is a window function that returns the cumulative\ndistribution of a given row. The following formula is used\nto calculate the value:\n \n(number of rows \n\nURL: https://mariadb.com/kb/en/cume_dist/','','https://mariadb.com/kb/en/cume_dist/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (713,42,'DENSE_RANK','The DENSE_RANK() function was first introduced with window\nfunctions in MariaDB 10.2.0.\n \nSyntax\n------ \nDENSE_RANK() OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n) \n \nDescription\n----------- \nDENSE_RANK() is a window function that displays the number\nof a given row, starting at one and following the ORDER BY\nsequence of the window function, with identical values\nreceiving the same result. Unlike the RANK() function, there\nare no skipped values if the preceding results are\nidentical. It is also similar to the ROW_NUMBER() function\nexcept that in that function, identical values will receive\na different row number for each result.\n \nExamples\n-------- \nThe distinction between DENSE_RANK(), RANK() and\nROW_NUMBER():\n \nCREATE TABLE student(course VARCHAR(10), mark int, name\nvarchar(10));\n \nINSERT INTO student VALUES \n (\'Maths\', 60, \'Thulile\'),\n (\'Maths\', 60, \'Pritha\'),\n (\'Maths\', 70, \'Voitto\'),\n (\'Maths\', 55, \'Chun\'),\n (\'Biology\', 60, \'Bilal\'),\n (\'Biology\', 70, \'Roger\');\n \nSELECT \n RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS\nrank, \n DENSE_RANK() OVER (PARTITION BY course ORDER BY mark DESC)\nAS dense_rank, \n ROW_NUMBER() OVER (PARTITION BY course ORDER BY mark DESC)\nAS row_num, \n course, mark, name \nFROM student ORDER BY course, mark DESC;\n \n+------+------------+---------+---------+------+---------+\n| rank | dense_rank | row_num | course | mark | name |\n+------+------------+---------+---------+------+---------+\n| 1 | 1 | 1 | Biology | 70 | Roger |\n| 2 | 2 | 2 | Biology | 60 | Bilal |\n| 1 | 1 | 1 | Maths | 70 | Voitto |\n| 2 | 2 | 2 | Maths | 60 | Thulile |\n| 2 | 2 | 3 | Maths | 60 | Pritha |\n| 4 | 3 | 4 | Maths | 55 | Chun |\n+------+------------+---------+---------+------+---------+\n \n\n\nURL: https://mariadb.com/kb/en/dense_rank/','','https://mariadb.com/kb/en/dense_rank/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (714,42,'FIRST_VALUE','The FIRST_VALUE() function was first introduced with other\nwindow functions in MariaDB 10.2.\n \nSyntax\n------ \nFIRST_VALUE(expr) OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n) \n \nDescription\n----------- \nFIRST_VALUE returns the first result from an ordered set, or\nNULL if no such result exists.\n \nExamples\n-------- \nCREATE TABLE t1 (\n pk int primary key,\n a int,\n b int,\n c char(10),\n d decimal(10, 3),\n e real\n);\n \nINSERT INTO t1 VALUES\n( 1, 0, 1, \'one\', 0.1, 0.001),\n( 2, 0, 2, \'two\', 0.2, 0.002),\n( 3, 0, 3, \'three\', 0.3, 0.003),\n( 4, 1, 2, \'three\', 0.4, 0.004),\n( 5, 1, 1, \'two\', 0.5, 0.005),\n( 6, 1, 1, \'one\', 0.6, 0.006),\n( 7, 2, NULL, \'n_one\', 0.5, 0.007),\n( 8, 2, 1, \'n_two\', NULL, 0.008),\n( 9, 2, 2, NULL, 0.7, 0.009),\n(10, 2, 0, \'n_four\', 0.8, 0.010),\n(11, 2, 10, NULL, 0.9, NULL);\n \nSELECT pk, FIRST_VALUE(pk) OVER (ORDER BY pk) AS first_asc,\n LAST_VALUE(pk) OVER (ORDER BY pk) AS last_asc,\n FIRST_VALUE(pk) OVER (ORDER BY pk DESC) AS first_desc,\n LAST_VALUE(pk) OVER (ORDER BY pk DESC) AS last_desc\nFROM t1\nORDER BY pk DESC;\n \n+----+-----------+----------+------------+-----------+\n| pk | first_asc | last_asc | first_desc | last_desc |\n+----+-----------+----------+------------+-----------+\n| 11 | 1 | 11 | 11 | 11 |\n| 10 | 1 | 10 | 11 | 10 |\n| 9 | 1 | 9 | 11 | 9 |\n| 8 | 1 | 8 | 11 | 8 |\n| 7 | 1 | 7 | 11 | 7 |\n| 6 | 1 | 6 | 11 | 6 |\n| 5 | 1 | 5 | 11 | 5 |\n| 4 | 1 | 4 | 11 | 4 |\n| 3 | 1 | 3 | 11 | 3 |\n| 2 | 1 | 2 | 11 | 2 |\n| 1 | 1 | 1 | 11 | 1 |\n+----+-----------+----------+------------+-----------+\n \nCREATE OR REPLACE TABLE t1 (i int);\nINSERT INTO t1 VALUES\n(1),(2),(3),(4),(5),(6),(7),(8),(9),(10);\n \nSELECT i,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW\nand 1 FOLLOWING) AS f_1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and\n1 FOLLOWING) AS l_1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING\nAND 1 FOLLOWING) AS f_1p1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND\n1 FOLLOWING) AS f_1p1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING\nAND 1 PRECEDING) AS f_2p1p,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND\n1 PRECEDING) AS f_2p1p,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING\nAND 2 FOLLOWING) AS f_1f2f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND\n2 FOLLOWING) AS f_1f2f\nFROM t1;\n \n+------+------+------+--------+--------+--------+--------+--------+--------+\n| i | f_1f | l_1f | f_1p1f | f_1p1f | f_2p1p | f_2p1p |\nf_1f2f | f_1f2f |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n| 1 | 1 | 2 | 1 | 2 | NULL | NULL | 2 | 3 |\n| 2 | 2 | 3 | 1 | 3 | 1 | 1 | 3 | 4 |\n| 3 | 3 | 4 | 2 | 4 | 1 | 2 | 4 | 5 |\n| 4 | 4 | 5 | 3 | 5 | 2 | 3 | 5 | 6 |\n| 5 | 5 | 6 | 4 | 6 | 3 | 4 | 6 | 7 |\n| 6 | 6 | 7 | 5 | 7 | 4 | 5 | 7 | 8 |\n| 7 | 7 | 8 | 6 | 8 | 5 | 6 | 8 | 9 |\n| 8 | 8 | 9 | 7 | 9 | 6 | 7 | 9 | 10 |\n| 9 | 9 | 10 | 8 | 10 | 7 | 8 | 10 | 10 |\n| 10 | 10 | 10 | 9 | 10 | 8 | 9 | NULL | NULL |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n \n\n\nURL: https://mariadb.com/kb/en/first_value/','','https://mariadb.com/kb/en/first_value/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (715,42,'LAG','The LAG() function was first introduced with other window\nfunctions in MariaDB 10.2.\n \nSyntax\n------ \nLAG (expr[, offset]) OVER ( \n [ PARTITION BY partition_expression ] \n < ORDER BY order_list >\n)\n \nDescription\n----------- \nThe LAG function accesses data from a previous row according\nto the ORDER BY clause without the need for a self-join. The\nspecific row is determined by the offset (default 1), which\nspecifies the number of rows behind the current row to use.\nAn offset of 0 is the current row.\n \nExamples\n-------- \nCREATE TABLE t1 (pk int primary key, a int, b int, c\nchar(10), d decimal(10, 3), e real);\n \nINSERT INTO t1 VALUES\n ( 1, 0, 1, \'one\', 0.1, 0.001),\n ( 2, 0, 2, \'two\', 0.2, 0.002),\n ( 3, 0, 3, \'three\', 0.3, 0.003),\n ( 4, 1, 2, \'three\', 0.4, 0.004),\n ( 5, 1, 1, \'two\', 0.5, 0.005),\n ( 6, 1, 1, \'one\', 0.6, 0.006),\n ( 7, 2, NULL, \'n_one\', 0.5, 0.007),\n ( 8, 2, 1, \'n_two\', NULL, 0.008),\n ( 9, 2, 2, NULL, 0.7, 0.009),\n (10, 2, 0, \'n_four\', 0.8, 0.010),\n (11, 2, 10, NULL, 0.9, NULL);\n \nSELECT pk, LAG(pk) OVER (ORDER BY pk) AS l,\n LAG(pk,1) OVER (ORDER BY pk) AS l1,\n LAG(pk,2) OVER (ORDER BY pk) AS l2,\n LAG(pk,0) OVER (ORDER BY pk) AS l0,\n LAG(pk,-1) OVER (ORDER BY pk) AS lm1,\n LAG(pk,-2) OVER (ORDER BY pk) AS lm2 \nFROM t1;\n \n+----+------+------+------+------+------+------+\n| pk | l | l1 | l2 | l0 | lm1 | lm2 |\n+----+------+------+------+------+------+------+\n| 1 | NULL | NULL | NULL | 1 | 2 | 3 |\n| 2 | 1 | 1 | NULL | 2 | 3 | 4 |\n| 3 | 2 | 2 | 1 | 3 | 4 | 5 |\n| 4 | 3 | 3 | 2 | 4 | 5 | 6 |\n| 5 | 4 | 4 | 3 | 5 | 6 | 7 |\n| 6 | 5 | 5 | 4 | 6 | 7 | 8 |\n| 7 | 6 | 6 | 5 | 7 | 8 | 9 |\n| 8 | 7 | 7 | 6 | 8 | 9 | 10 |\n| 9 | 8 | 8 | 7 | 9 | 10 | 11 |\n| 10 | 9 | 9 | 8 | 10 | 11 | NULL |\n| 11 | 10 | 10 | 9 | 11 | NULL | NULL |\n+----+------+------+------+------+------+------+\n \n\n\nURL: https://mariadb.com/kb/en/lag/','','https://mariadb.com/kb/en/lag/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (717,42,'MEDIAN','The MEDIAN() window function was first introduced with in\nMariaDB 10.3.3.\n \nSyntax\n------ \nMEDIAN(median expression) OVER (\n [ PARTITION BY partition_expression ] \n)\n \nDescription\n----------- \nMEDIAN() is a window function that returns the median value\nof a range of values.\n \nIt is a specific case of PERCENTILE_CONT, with an argument\nof 0.5 and the ORDER BY column the one in MEDIAN\'s\nargument. \n \nMEDIAN() OVER ( [ PARTITION BY partition_expression] )\n \nIs equivalent to:\n \nPERCENTILE_CONT(0.5) WITHIN \n GROUP (ORDER BY ) OVER ( [ PARTITION BY\npartition_expression ])\n \nExamples\n-------- \nCREATE TABLE book_rating (name CHAR(30), star_rating\nTINYINT);\n \nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\',\n5);\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\',\n3);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 1);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 2);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 5);\n \nSELECT name, median(star_rating) OVER (PARTITION BY name)\nFROM book_rating;\n \n+-----------------------+----------------------------------------------+\n| name | median(star_rating) OVER (PARTITION BY name) |\n+-----------------------+----------------------------------------------+\n| Lord of the Ladybirds | 4.0000000000 |\n| Lord of the Ladybirds | 4.0000000000 |\n| Lady of the Flies | 2.0000000000 |\n| Lady of the Flies | 2.0000000000 |\n| Lady of the Flies | 2.0000000000 |\n+-----------------------+----------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/median/','','https://mariadb.com/kb/en/median/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (718,42,'NTH_VALUE','The NTH_VALUE() function was first introduced with other\nwindow functions in MariaDB 10.2.\n \nSyntax\n------ \nNTH_VALUE (expr[, num_row]) OVER ( \n [ PARTITION BY partition_expression ] \n [ ORDER BY order_list ]\n)\n \nDescription\n----------- \nThe NTH_VALUE function returns the value evaluated at row\nnumber num_row of the window frame, starting from 1, or NULL\nif the row does not exist.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/nth_value/','','https://mariadb.com/kb/en/nth_value/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (719,42,'NTILE','The NTILE() function was first introduced with window\nfunctions in MariaDB 10.2.0.\n \nSyntax\n------ \nNTILE (expr) OVER ( \n [ PARTITION BY partition_expression ] \n [ ORDER BY order_list ]\n)\n \nDescription\n----------- \nNTILE() is a window function that returns an integer\nindicating which group a given row falls into. The number of\ngroups is specified in the argument (expr), starting at one.\nOrdered rows in the partition are divided into the specified\nnumber of groups with as equal a size as possible. \n \nExamples\n-------- \ncreate table t1 (\n pk int primary key,\n a int,\n b int\n );\n \ninsert into t1 values\n (11 , 0, 10),\n (12 , 0, 10),\n (13 , 1, 10),\n (14 , 1, 10),\n (18 , 2, 10),\n (15 , 2, 20),\n (16 , 2, 20),\n (17 , 2, 20),\n (19 , 4, 20),\n (20 , 4, 20);\n \nselect pk, a, b,\n ntile(1) over (order by pk)\n from t1;\n \n+----+------+------+-----------------------------+\n| pk | a | b | ntile(1) over (order by pk) |\n+----+------+------+-----------------------------+\n| 11 | 0 | 10 | 1 |\n| 12 | 0 | 10 | 1 |\n| 13 | 1 | 10 | 1 |\n| 14 | 1 | 10 | 1 |\n| 15 | 2 | 20 | 1 |\n| 16 | 2 | 20 | 1 |\n| 17 | 2 | 20 | 1 |\n| 18 | 2 | 10 | 1 |\n| 19 | 4 | 20 | 1 |\n| 20 | 4 | 20 | 1 |\n+----+------+------+-----------------------------+\n \nselect pk, a, b,\n ntile(4) over (order by pk)\n from t1;\n \n+----+------+------+-----------------------------+\n| pk | a | b | ntile(4) over (order by pk) |\n+----+------+------+-----------------------------+\n| 11 | 0 | 10 | 1 |\n| 12 | 0 | 10 | 1 |\n| 13 | 1 | 10 | 1 |\n| 14 | 1 | 10 | 2 |\n| 15 | 2 | 20 | 2 |\n| 16 | 2 | 20 | 2 |\n| 17 | 2 | 20 | 3 |\n| 18 | 2 | 10 | 3 |\n| 19 | 4 | 20 | 4 |\n| 20 | 4 | 20 | 4 |\n+----+------+------+-----------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/ntile/','','https://mariadb.com/kb/en/ntile/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (720,42,'PERCENT_RANK','The PERCENT_RANK() function was first introduced with window\nfunctions in MariaDB 10.2.0.\n \nSyntax\n------ \nPERCENT_RANK() OVER (\n [ PARTITION BY partition_expression ] \n [ ORDER BY order_list ]\n)\n \nDescription\n----------- \nPERCENT_RANK() is a window function that returns the\nrelative percent rank of a given row. The following formula\nis used to calculate the percent rank:\n \n(rank - 1) / (number of rows in the window or partition - 1)\n \nExamples\n-------- \ncreate table t1 (\n pk int primary key,\n a int,\n b int\n);\n \ninsert into t1 values\n( 1 , 0, 10),\n( 2 , 0, 10),\n( 3 , 1, 10),\n( 4 , 1, 10),\n( 8 , 2, 10),\n( 5 , 2, 20),\n( 6 , 2, 20),\n( 7 , 2, 20),\n( 9 , 4, 20),\n(10 , 4, 20);\n \nselect pk, a, b,\n rank() over (order by a) as rank,\n percent_rank() over (order by a) as pct_rank,\n cume_dist() over (order by a) as cume_dist\nfrom t1;\n \n+----+------+------+------+--------------+--------------+\n| pk | a | b | rank | pct_rank | cume_dist |\n+----+------+------+------+--------------+--------------+\n| 1 | 0 | 10 | 1 | 0.0000000000 | 0.2000000000 |\n| 2 | 0 | 10 | 1 | 0.0000000000 | 0.2000000000 |\n| 3 | 1 | 10 | 3 | 0.2222222222 | 0.4000000000 |\n| 4 | 1 | 10 | 3 | 0.2222222222 | 0.4000000000 |\n| 5 | 2 | 20 | 5 | 0.4444444444 | 0.8000000000 |\n| 6 | 2 | 20 | 5 | 0.4444444444 | 0.8000000000 |\n| 7 | 2 | 20 | 5 | 0.4444444444 | 0.8000000000 |\n| 8 | 2 | 10 | 5 | 0.4444444444 | 0.8000000000 |\n| 9 | 4 | 20 | 9 | 0.8888888889 | 1.0000000000 |\n| 10 | 4 | 20 | 9 | 0.8888888889 | 1.0000000000 |\n+----+------+------+------+--------------+--------------+\n \nselect pk, a, b,\n percent_rank() over (order by pk) as pct_rank,\n cume_dist() over (order by pk) as cume_dist\nfrom t1 order by pk;\n \n+----+------+------+--------------+--------------+\n| pk | a | b | pct_rank | cume_dist |\n+----+------+------+--------------+--------------+\n| 1 | 0 | 10 | 0.0000000000 | 0.1000000000 |\n| 2 | 0 | 10 | 0.1111111111 | 0.2000000000 |\n| 3 | 1 | 10 | 0.2222222222 | 0.3000000000 |\n| 4 | 1 | 10 | 0.3333333333 | 0.4000000000 |\n| 5 | 2 | 20 | 0.4444444444 | 0.5000000000 |\n| 6 | 2 | 20 | 0.5555555556 | 0.6000000000 |\n| 7 | 2 | 20 | 0.6666666667 | 0.7000000000 |\n| 8 | 2 | 10 | 0.7777777778 | 0.8000000000 |\n| 9 | 4 | 20 | 0.8888888889 | 0.9000000000 |\n| 10 | 4 | 20 | 1.0000000000 | 1.0000000000 |\n+----+------+------+--------------+--------------+\n \nselect pk, a, b,\n percent_rank() over (partition by a order by a) as\npct_rank,\n cume_dist() over (partition by a order by a) as cume_dist\nfrom t1;\n \n+----+------+------+--------------+--------------+\n| pk | a | b | pct_rank | cume_dist |\n+----+------+------+--------------+--------------+\n| 1 | 0 | 10 | 0.0000000000 | 1.0000000000 |\n| 2 | 0 | 10 | 0.0000000000 | 1.0000000000 |\n| 3 | 1 | 10 | 0.0000000000 | 1.0000000000 |\n| 4 | 1 | 10 | 0.0000000000 | 1.0000000000 |\n| 5 | 2 | 20 | 0.0000000000 | 1.0000000000 |\n| 6 | 2 | 20 | 0.0000000000 | 1.0000000000 |\n| 7 | 2 | 20 | 0.0000000000 | 1.0000000000 |\n| 8 | 2 | 10 | 0.0000000000 | 1.0000000000 |\n| 9 | 4 | 20 | 0.0000000000 | 1.0000000000 |\n| 10 | 4 | 20 | 0.0000000000 | 1.0000000000 |\n+----+------+------+--------------+--------------+\n \n\n\nURL: https://mariadb.com/kb/en/percent_rank/','','https://mariadb.com/kb/en/percent_rank/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (721,42,'PERCENTILE_CONT','The PERCENTILE_CONT() window function was first introduced\nwith in MariaDB 10.3.3.\n \nSyntax\n------ \nDescription\n----------- \nPERCENTILE_CONT() (standing for continuous percentile) is a\nwindow function which returns a value which corresponds to\nthe given fraction in the sort order. If required, it will\ninterpolate between adjacent input items.\n \nEssentially, the following process is followed to find the\nvalue to return:\nGet the number of rows in the partition, denoted by N\nRN = p*(N-1), where p denotes the argument to the\nPERCENTILE_CONT function\ncalculate the FRN(floor row number) and CRN(column row\nnumber for the group( FRN= floor(RN) and CRN = ceil(RN))\nlook up rows FRN and CRN\nIf (CRN = FRN = RN) then the result is (value of expression\nfrom row at RN)\nOtherwise the result is\n(CRN - RN) * (value of expression for row at FRN) +\n(RN - FRN) * (value of expression for row at CRN)\n \nThe MEDIAN function is a specific case of PERCENTILE_CONT,\nequivalent to PERCENTILE_CONT(0.5).\n \nExamples\n-------- \nCREATE TABLE book_rating (name CHAR(30), star_rating\nTINYINT);\n \nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\',\n5);\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\',\n3);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 1);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 2);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 5);\n \nSELECT name, PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY\nstar_rating) \n OVER (PARTITION BY name) AS pc \n FROM book_rating;\n \n+-----------------------+--------------+\n| name | pc |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 4.0000000000 |\n| Lord of the Ladybirds | 4.0000000000 |\n| Lady of the Flies | 2.0000000000 |\n| Lady of the Flies | 2.0000000000 |\n| Lady of the Flies | 2.0000000000 |\n+-----------------------+--------------+\n \nSELECT name, PERCENTILE_CONT(1) WITHIN GROUP (ORDER BY\nstar_rating) \n OVER (PARTITION BY name) AS pc \n FROM book_rating;\n \n+-----------------------+--------------+\n| name | pc |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 5.0000000000 |\n| Lord of the Ladybirds | 5.0000000000 |\n| Lady of the Flies | 5.0000000000 |\n| Lady of the Flies | 5.0000000000 |\n| Lady of the Flies | 5.0000000000 |\n+-----------------------+--------------+\n \nSELECT name, PERCENTILE_CONT(0) WITHIN GROUP (ORDER BY\nstar_rating) \n OVER (PARTITION BY name) AS pc \n FROM book_rating;\n \n+-----------------------+--------------+\n| name | pc |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 3.0000000000 |\n| Lord of the Ladybirds | 3.0000000000 |\n| Lady of the Flies | 1.0000000000 |\n| Lady of the Flies | 1.0000000000 |\n| Lady of the Flies | 1.0000000000 |\n+-----------------------+--------------+\n \nSELECT name, PERCENTILE_CONT(0.6) WITHIN GROUP (ORDER BY\nstar_rating) \n OVER (PARTITION BY name) AS pc \n FROM book_rating;\n \n+-----------------------+--------------+\n| name | pc |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 4.2000000000 |\n| Lord of the Ladybirds | 4.2000000000 |\n| Lady of the Flies | 2.6000000000 |\n| Lady of the Flies | 2.6000000000 |\n| Lady of the Flies | 2.6000000000 |\n+-----------------------+--------------+\n \n\n\nURL: https://mariadb.com/kb/en/percentile_cont/','','https://mariadb.com/kb/en/percentile_cont/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (722,42,'PERCENTILE_DISC','The PERCENTILE_DISC() window function was first introduced\nwith in MariaDB 10.3.3.\n \nSyntax\n------ \n\nDescription\n----------- \nPERCENTILE_DISC() (standing for discrete percentile) is a\nwindow function which returns the first value in the set\nwhose ordered position is the same or more than the\nspecified fraction.\n \nEssentially, the following process is followed to find the\nvalue to return:\nGet the number of rows in the partition.\nWalk through the partition, in order, until finding the the\nfirst row with CUME_DIST() > function_argument.\n \nExamples\n-------- \nCREATE TABLE book_rating (name CHAR(30), star_rating\nTINYINT);\n \nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\',\n5);\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\',\n3);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 1);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 2);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 5);\n \nSELECT name, PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY\nstar_rating)\n OVER (PARTITION BY name) AS pc FROM book_rating;\n \n+-----------------------+------+\n| name | pc |\n+-----------------------+------+\n| Lord of the Ladybirds | 3 |\n| Lord of the Ladybirds | 3 |\n| Lady of the Flies | 2 |\n| Lady of the Flies | 2 |\n| Lady of the Flies | 2 |\n+-----------------------+------+\n5 rows in set (0.000 sec)\n \nSELECT name, PERCENTILE_DISC(0) WITHIN GROUP (ORDER BY\nstar_rating) \n OVER (PARTITION BY name) AS pc FROM book_rating;\n \n+-----------------------+------+\n| name | pc |\n+-----------------------+------+\n| Lord of the Ladybirds | 3 |\n| Lord of the Ladybirds | 3 |\n| Lady of the Flies | 1 |\n| Lady of the Flies | 1 |\n| Lady of the Flies | 1 |\n+-----------------------+------+\n5 rows in set (0.000 sec)\n \nSELECT name, PERCENTILE_DISC(1) WITHIN GROUP (ORDER BY\nstar_rating) \n OVER (PARTITION BY name) AS pc FROM book_rating;\n \n+-----------------------+------+\n| name | pc |\n+-----------------------+------+\n| Lord of the Ladybirds | 5 |\n| Lord of the Ladybirds | 5 |\n| Lady of the Flies | 5 |\n| Lady of the Flies | 5 |\n| Lady of the Flies | 5 |\n+-----------------------+------+\n5 rows in set (0.000 sec)\n \nSELECT name, PERCENTILE_DISC(0.6) WITHIN GROUP (ORDER BY\nstar_rating) \n OVER (PARTITION BY name) AS pc FROM book_rating;\n \n+-----------------------+------+\n| name | pc |\n+-----------------------+------+\n| Lord of the Ladybirds | 5 |\n| Lord of the Ladybirds | 5 |\n| Lady of the Flies | 2 |\n| Lady of the Flies | 2 |\n| Lady of the Flies | 2 |\n+-----------------------+------\n \n\n\nURL: https://mariadb.com/kb/en/percentile_disc/','','https://mariadb.com/kb/en/percentile_disc/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (723,42,'RANK','The RANK() function was first introduced with window\nfunctions in MariaDB 10.2.0.\n \nSyntax\n------ \nRANK() OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n) \n \nDescription\n----------- \nRANK() is a window function that displays the number of a\ngiven row, starting at one and following the ORDER BY\nsequence of the window function, with identical values\nreceiving the same result. It is similar to the ROW_NUMBER()\nfunction except that in that function, identical values will\nreceive a different row number for each result.\n \nExamples\n-------- \nThe distinction between DENSE_RANK(), RANK() and\nROW_NUMBER():\n \nCREATE TABLE student(course VARCHAR(10), mark int, name\nvarchar(10));\n \nINSERT INTO student VALUES \n (\'Maths\', 60, \'Thulile\'),\n (\'Maths\', 60, \'Pritha\'),\n (\'Maths\', 70, \'Voitto\'),\n (\'Maths\', 55, \'Chun\'),\n (\'Biology\', 60, \'Bilal\'),\n (\'Biology\', 70, \'Roger\');\n \nSELECT \n RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS\nrank, \n DENSE_RANK() OVER (PARTITION BY course ORDER BY mark DESC)\nAS dense_rank, \n ROW_NUMBER() OVER (PARTITION BY course ORDER BY mark DESC)\nAS row_num, \n course, mark, name \nFROM student ORDER BY course, mark DESC;\n \n+------+------------+---------+---------+------+---------+\n| rank | dense_rank | row_num | course | mark | name |\n+------+------------+---------+---------+------+---------+\n| 1 | 1 | 1 | Biology | 70 | Roger |\n| 2 | 2 | 2 | Biology | 60 | Bilal |\n| 1 | 1 | 1 | Maths | 70 | Voitto |\n| 2 | 2 | 2 | Maths | 60 | Thulile |\n| 2 | 2 | 3 | Maths | 60 | Pritha |\n| 4 | 3 | 4 | Maths | 55 | Chun |\n+------+------------+---------+---------+------+---------+\n \n\n\nURL: https://mariadb.com/kb/en/rank/','','https://mariadb.com/kb/en/rank/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (724,42,'ROW_NUMBER','ROW_NUMBER() was first introduced with window functions in\nMariaDB 10.2.0.\n \nSyntax\n------ \nROW_NUMBER() OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n) \n \nDescription\n----------- \nROW_NUMBER() is a window function that displays the number\nof a given row, starting at one and following the ORDER BY\nsequence of the window function, with identical values\nreceiving different row numbers. It is similar to the RANK()\nand DENSE_RANK() functions except that in that function,\nidentical values will receive the same rank for each result.\n \nExamples\n-------- \nThe distinction between DENSE_RANK(), RANK() and\nROW_NUMBER():\n \nCREATE TABLE student(course VARCHAR(10), mark int, name\nvarchar(10));\n \nINSERT INTO student VALUES \n (\'Maths\', 60, \'Thulile\'),\n (\'Maths\', 60, \'Pritha\'),\n (\'Maths\', 70, \'Voitto\'),\n (\'Maths\', 55, \'Chun\'),\n (\'Biology\', 60, \'Bilal\'),\n (\'Biology\', 70, \'Roger\');\n \nSELECT \n RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS\nrank, \n DENSE_RANK() OVER (PARTITION BY course ORDER BY mark DESC)\nAS dense_rank, \n ROW_NUMBER() OVER (PARTITION BY course ORDER BY mark DESC)\nAS row_num, \n course, mark, name \nFROM student ORDER BY course, mark DESC;\n \n+------+------------+---------+---------+------+---------+\n| rank | dense_rank | row_num | course | mark | name |\n+------+------------+---------+---------+------+---------+\n| 1 | 1 | 1 | Biology | 70 | Roger |\n| 2 | 2 | 2 | Biology | 60 | Bilal |\n| 1 | 1 | 1 | Maths | 70 | Voitto |\n| 2 | 2 | 2 | Maths | 60 | Thulile |\n| 2 | 2 | 3 | Maths | 60 | Pritha |\n| 4 | 3 | 4 | Maths | 55 | Chun |\n+------+------------+---------+---------+------+---------+\n \n\n\nURL: https://mariadb.com/kb/en/row_number/','','https://mariadb.com/kb/en/row_number/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (725,43,'SPIDER_BG_DIRECT_SQL','Syntax\n------ \nSPIDER_BG_DIRECT_SQL(\'sql\', \'tmp_table_list\',\n\'parameters\')\n \nDescription\n----------- \nExecutes the given SQL statement in the background on the\nremote server, as defined in the parameters listing. If the\nquery returns a result-set, it sttores the results in the\ngiven temporary table. When the given SQL statement executes\nsuccessfully, this function returns the number of called\nUDF\'s. It returns 0 when the given SQL statement fails.\n \nThis function is a UDF installed with the Spider storage\nengine.\n \nExamples\n-------- \nSELECT SPIDER_BG_DIRECT_SQL(\'SELECT * FROM example_table\',\n\'\', \n \'srv \"node1\", port \"8607\"\') AS \"Direct Query\";\n+--------------+\n| Direct Query | \n+--------------+\n| 1 |\n+--------------+\n \nParameters\n \nerror_rw_mode\n \nDescription: Returns empty results on network error.\n0 : Return error on getting network error.\n1: Return 0 records on getting network error.\n \nDefault Table Value: 0\nDSN Parameter Name: erwm\n \n\n\nURL: https://mariadb.com/kb/en/spider_bg_direct_sql/','','https://mariadb.com/kb/en/spider_bg_direct_sql/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (726,43,'SPIDER_COPY_TABLES','Syntax\n------ \nSPIDER_COPY_TABLES(spider_table_name, \n source_link_id, destination_link_id_list [,parameters])\n \nDescription\n----------- \nA UDF installed with the Spider Storage Engine, this\nfunction copies table data from source_link_id to\ndestination_link_id_list. The service does not need to be\nstopped in order to copy.\n \nIf the Spider table is partitioned, the name must be of the\nformat table_name#P#partition_name. The partition name can\nbe viewed in the mysql.spider_tables table, for example:\n \nSELECT table_name FROM mysql.spider_tables;\n+-------------+\n| table_name |\n+-------------+\n| spt_a#P#pt1 |\n| spt_a#P#pt2 |\n| spt_a#P#pt3 |\n+-------------+\n \nReturns 1 if the data was copied successfully, or 0 if\ncopying the data failed.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/spider_copy_tables/','','https://mariadb.com/kb/en/spider_copy_tables/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (727,43,'SPIDER_DIRECT_SQL','Syntax\n------ \nSPIDER_DIRECT_SQL(\'sql\', \'tmp_table_list\',\n\'parameters\')\n \nDescription\n----------- \nA UDF installed with the Spider Storage Engine, this\nfunction is used to execute the SQL string sql on the remote\nserver, as defined in parameters. If any resultsets are\nreturned, they are stored in the tmp_table_list.\n \nThe function returns 1 if the SQL executes successfully, or\n0 if it fails.\n \nExamples\n-------- \nSELECT SPIDER_DIRECT_SQL(\'SELECT * FROM s\', \'\', \'srv\n\"node1\", port \"8607\"\');\n+----------------------------------------------------------------------+\n| SPIDER_DIRECT_SQL(\'SELECT * FROM s\', \'\', \'srv\n\"node1\", port \"8607\"\') |\n+----------------------------------------------------------------------+\n| 1 |\n+----------------------------------------------------------------------+\n \n\n\nURL: https://mariadb.com/kb/en/spider_direct_sql/','','https://mariadb.com/kb/en/spider_direct_sql/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (728,43,'SPIDER_FLUSH_TABLE_MON_CACHE','Syntax\n------ \nSPIDER_FLUSH_TABLE_MON_CACHE()\n \nDescription\n----------- \nA UDF installed with the Spider Storage Engine, this\nfunction is used for refreshing monitoring server\ninformation. It returns a value of 1.\n \nExamples\n-------- \nSELECT SPIDER_FLUSH_TABLE_MON_CACHE();\n+--------------------------------+\n| SPIDER_FLUSH_TABLE_MON_CACHE() |\n+--------------------------------+\n| 1 |\n+--------------------------------+\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/spider_flush_table_mon_cache/','','https://mariadb.com/kb/en/spider_flush_table_mon_cache/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (729,44,'COLUMN_ADD','The Dynamic columns feature was introduced in MariaDB 5.3.\n \nSyntax\n------ \nCOLUMN_ADD(dyncol_blob, column_nr, value [as type],\n[column_nr, value [as type]]...);\nCOLUMN_ADD(dyncol_blob, column_name, value [as type],\n[column_name, value [as type]]...);\n \nDescription\n----------- \nAdds or updates dynamic columns.\ndyncol_blob must be either a valid dynamic columns blob (for\nexample, COLUMN_CREATE returns such blob), or an empty\nstring.\ncolumn_name specifies the name of the column to be added. If\ndyncol_blob already has a column with this name, it will be\noverwritten.\nvalue specifies the new value for the column. Passing a NULL\nvalue will cause the column to be deleted.\nas type is optional. See #datatypes section for a discussion\nabout types.\n \nThe return value is a dynamic column blob after the\nmodifications.\n \nExamples\n-------- \n-- MariaDB 5.3+:\nUPDATE tbl SET dyncol_blob=COLUMN_ADD(dyncol_blob, 1\n/*column id*/, \"value\") WHERE id=1;\n \n-- MariaDB 10.0.1+:\nUPDATE t1 SET dyncol_blob=COLUMN_ADD(dyncol_blob,\n\"column_name\", \"value\") WHERE id=1;\n \nNote: COLUMN_ADD() is a regular function (just like\nCONCAT()), hence, in order to update the value in the table\nyou have to use the UPDATE ... SET\ndynamic_col=COLUMN_ADD(dynamic_col,\n....) pattern.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/column_add/','','https://mariadb.com/kb/en/column_add/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (730,44,'COLUMN_CHECK','The COLUMN_CHECK function was added in MariaDB 10.0.1.\n \nSyntax\n------ \nCOLUMN_CHECK(dyncol_blob);\n \nDescription\n----------- \nCheck if dyncol_blob is a valid packed dynamic columns blob.\nReturn value of 1 means the blob is valid, return value of 0\nmeans it is not.\n \nRationale:\nNormally, one works with valid dynamic column blobs.\nFunctions like COLUMN_CREATE, COLUMN_ADD, COLUMN_DELETE\nalways return valid dynamic column blobs. However, if a\ndynamic column blob is accidentally truncated, or transcoded\nfrom one character set to another, it will be corrupted.\nThis function can be used to check if a value in a blob\nfield is a valid dynamic column blob.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/column_check/','','https://mariadb.com/kb/en/column_check/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (731,44,'COLUMN_CREATE','The Dynamic columns feature was introduced in MariaDB 5.3.\n \nSyntax\n------ \nCOLUMN_CREATE(column_nr, value [as type], [column_nr, value\n[as type]]...);\nCOLUMN_CREATE(column_name, value [as type], [column_name,\nvalue [as type]]...);\n \nDescription\n----------- \nReturns a dynamic columns blob that stores the specified\ncolumns with values.\n \nThe return value is suitable for \nstoring in a table\nfurther modification with other dynamic columns functions\n \nThe as type part allows one to specify the value type. In\nmost cases,\nthis is redundant because MariaDB will be able to deduce the\ntype of the\nvalue. Explicit type specification may be needed when the\ntype of the value is\nnot apparent. For example, a literal \'2012-12-01\' has a\nCHAR type by\ndefault, one will need to specify \'2012-12-01\' AS DATE to\nhave it stored as\na date. See Dynamic Columns:Datatypes for further details.\n \nExamples\n-------- \n-- MariaDB 5.3+:\nINSERT INTO tbl SET dyncol_blob=COLUMN_CREATE(1 /*column\nid*/, \"value\");\n-- MariaDB 10.0.1+:\nINSERT INTO tbl SET\ndyncol_blob=COLUMN_CREATE(\"column_name\", \"value\");\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/column_create/','','https://mariadb.com/kb/en/column_create/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (732,44,'COLUMN_DELETE','The Dynamic columns feature was introduced in MariaDB 5.3.\n \nSyntax\n------ \nCOLUMN_DELETE(dyncol_blob, column_nr, column_nr...);\nCOLUMN_DELETE(dyncol_blob, column_name, column_name...);\n \nDescription\n----------- \nDeletes a dynamic column with the specified name. Multiple\nnames can be given. The return value is a dynamic column\nblob after the modification.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/column_delete/','','https://mariadb.com/kb/en/column_delete/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (733,44,'COLUMN_EXISTS','The Dynamic columns feature was introduced in MariaDB 5.3.\n \nSyntax\n------ \nCOLUMN_EXISTS(dyncol_blob, column_nr);\nCOLUMN_EXISTS(dyncol_blob, column_name);\n \nDescription\n----------- \nChecks if a column with name column_name exists in\ndyncol_blob. If yes, return 1, otherwise return 0. See\ndynamic columns for more information.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/column_exists/','','https://mariadb.com/kb/en/column_exists/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (734,44,'COLUMN_GET','The Dynamic columns feature was introduced in MariaDB 5.3.\n \nSyntax\n------ \nCOLUMN_GET(dyncol_blob, column_nr as type);\nCOLUMN_GET(dyncol_blob, column_name as type);\n \nDescription\n----------- \nGets the value of a dynamic column by its name. If no column\nwith the given name exists, NULL will be returned.\n \ncolumn_name as type requires that one specify the datatype\nof the dynamic column they are reading. \n \nThis may seem counter-intuitive: why would one need to\nspecify which datatype they\'re retrieving? Can\'t the\ndynamic columns system figure the datatype from the data\nbeing stored?\n \nThe answer is: SQL is a statically-typed language. The SQL\ninterpreter needs to know the datatypes of all expressions\nbefore the query is run (for example, when one is using\nprepared statements and runs \"select COLUMN_GET(...)\", the\nprepared statement API requires the server to inform the\nclient about the datatype of the column being read before\nthe query is executed and the server can see what datatype\nthe column actually has).\n \nA note about lengths\n \nIf you\'re running queries like:\n \nSELECT COLUMN_GET(blob, \'colname\' as CHAR) ...\n \nwithout specifying a maximum length (i.e. using #as CHAR#,\nnot as CHAR(n)), MariaDB will report the maximum length of\nthe resultset column to be 53,6870,911 for MariaDB\n5.3-10.0.0 and 16,777,216 for MariaDB 10.0.1+. This may\ncause excessive memory usage in some client libraries,\nbecause they try to pre-allocate a buffer of maximum\nresultset width. To avoid this problem, use CHAR(n) whenever\nyou\'re using COLUMN_GET in the select list.\n \nSee Dynamic Columns:Datatypes for more information about\ndatatypes.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/column_get/','','https://mariadb.com/kb/en/column_get/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (735,44,'COLUMN_JSON','COLUMN_JSON was introduced in MariaDB 10.0.1\n \nSyntax\n------ \nCOLUMN_JSON(dyncol_blob)\n \nDescription\n----------- \nReturns a JSON representation of data in dyncol_blob. Can\nalso be used to display nested columns. See dynamic columns\nfor more information.\n \nExample\n \nselect item_name, COLUMN_JSON(dynamic_cols) from assets;\n+-----------------+----------------------------------------+\n| item_name | COLUMN_JSON(dynamic_cols) |\n+-----------------+----------------------------------------+\n| MariaDB T-shirt | {\"size\":\"XL\",\"color\":\"blue\"} |\n| Thinkpad Laptop | {\"color\":\"black\",\"warranty\":\"3\nyears\"} |\n+-----------------+----------------------------------------+\n \nLimitation: COLUMN_JSON will decode nested dynamic columns\nat a nesting level of not more than 10 levels deep. Dynamic\ncolumns that are nested deeper than 10 levels will be shown\nas BINARY string, without encoding.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/column_json/','','https://mariadb.com/kb/en/column_json/');
-insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (736,44,'COLUMN_LIST','The Dynamic columns feature was introduced in MariaDB 5.3.\n \nSyntax\n------ \nCOLUMN_LIST(dyncol_blob);\n \nDescription\n----------- \nSince MariaDB 10.0.1, this function returns a\ncomma-separated list of column names. The names are quoted\nwith backticks.\n \nBefore MariaDB 10.0.1, it returned a comma-separated list of\ncolumn numbers, not names.\n \nSee dynamic columns for more information.\n \n\n \n \n \n \n \n \n \n\nURL: https://mariadb.com/kb/en/column_list/','','https://mariadb.com/kb/en/column_list/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (1,9,'HELP_DATE','Help contents generated from the MariaDB Knowledge Base on 28 June 2022.','','');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (2,2,'AREA','A synonym for ST_AREA.\n\n\n\nURL: mariadb.com/kb/en/polygon-properties-area/','','https://mariadb.com/kb/en/polygon-properties-area/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (3,2,'CENTROID','A synonym for ST_CENTROID.\n\n\n\nURL: mariadb.com/kb/en/centroid/','','https://mariadb.com/kb/en/centroid/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (4,2,'ExteriorRing','A synonym for ST_ExteriorRing.\n\n\n\nURL: mariadb.com/kb/en/polygon-properties-exteriorring/','','https://mariadb.com/kb/en/polygon-properties-exteriorring/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (5,2,'InteriorRingN','A synonym for ST_InteriorRingN.\n\n\n\nURL: mariadb.com/kb/en/polygon-properties-interiorringn/','','https://mariadb.com/kb/en/polygon-properties-interiorringn/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (6,2,'NumInteriorRings','A synonym for ST_NumInteriorRings.\n\n\n\nURL: mariadb.com/kb/en/polygon-properties-numinteriorrings/','','https://mariadb.com/kb/en/polygon-properties-numinteriorrings/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (7,2,'ST_AREA','Syntax\n------\n\nST_Area(poly)\nArea(poly)\n\nDescription\n-----------\n\nReturns as a double-precision number the area of the Polygon value poly, as\nmeasured in its spatial reference system.\n\nST_Area() and Area() are synonyms.\n\nExamples\n--------\n\nSET @poly = \'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1 1))\';\n\nSELECT Area(GeomFromText(@poly));\n+---------------------------+\n| Area(GeomFromText(@poly)) |\n+---------------------------+\n| 4 |\n+---------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_area/','','https://mariadb.com/kb/en/st_area/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (8,2,'ST_CENTROID','Syntax\n------\n\nST_Centroid(mpoly)\nCentroid(mpoly)\n\nDescription\n-----------\n\nReturns a point reflecting the mathematical centroid (geometric center) for\nthe MultiPolygon mpoly. The resulting point will not necessarily be on the\nMultiPolygon.\n\nST_Centroid() and Centroid() are synonyms.\n\nExamples\n--------\n\nSET @poly = ST_GeomFromText(\'POLYGON((0 0,20 0,20 20,0 20,0 0))\');\nSELECT ST_AsText(ST_Centroid(@poly)) AS center;\n+--------------+\n| center |\n+--------------+\n| POINT(10 10) |\n+--------------+\n\n\n\nURL: mariadb.com/kb/en/st_centroid/','','https://mariadb.com/kb/en/st_centroid/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (9,2,'ST_ExteriorRing','Syntax\n------\n\nST_ExteriorRing(poly)\nExteriorRing(poly)\n\nDescription\n-----------\n\nReturns the exterior ring of the Polygon value poly as a LineString.\n\nST_ExteriorRing() and ExteriorRing() are synonyms.\n\nExamples\n--------\n\nSET @poly = \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\n\nSELECT AsText(ExteriorRing(GeomFromText(@poly)));\n+-------------------------------------------+\n| AsText(ExteriorRing(GeomFromText(@poly))) |\n+-------------------------------------------+\n| LINESTRING(0 0,0 3,3 3,3 0,0 0) |\n+-------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_exteriorring/','','https://mariadb.com/kb/en/st_exteriorring/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (10,2,'ST_InteriorRingN','Syntax\n------\n\nST_InteriorRingN(poly,N)\nInteriorRingN(poly,N)\n\nDescription\n-----------\n\nReturns the N-th interior ring for the Polygon value poly as a LineString.\nRings are numbered beginning with 1.\n\nST_InteriorRingN() and InteriorRingN() are synonyms.\n\nExamples\n--------\n\nSET @poly = \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\n\nSELECT AsText(InteriorRingN(GeomFromText(@poly),1));\n+----------------------------------------------+\n| AsText(InteriorRingN(GeomFromText(@poly),1)) |\n+----------------------------------------------+\n| LINESTRING(1 1,1 2,2 2,2 1,1 1) |\n+----------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_interiorringn/','','https://mariadb.com/kb/en/st_interiorringn/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (11,2,'ST_NumInteriorRings','Syntax\n------\n\nST_NumInteriorRings(poly)\nNumInteriorRings(poly)\n\nDescription\n-----------\n\nReturns an integer containing the number of interior rings in the Polygon\nvalue poly.\n\nNote that according the the OpenGIS standard, a POLYGON should have exactly\none ExteriorRing and all other rings should lie within that ExteriorRing and\nthus be the InteriorRings. Practically, however, some systems, including\nMariaDB\'s, permit polygons to have several \'ExteriorRings\'. In the case of\nthere being multiple, non-overlapping exterior rings ST_NumInteriorRings()\nwill return 1.\n\nST_NumInteriorRings() and NumInteriorRings() are synonyms.\n\nExamples\n--------\n\nSET @poly = \'Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))\';\n\nSELECT NumInteriorRings(GeomFromText(@poly));\n+---------------------------------------+\n| NumInteriorRings(GeomFromText(@poly)) |\n+---------------------------------------+\n| 1 |\n+---------------------------------------+\n\nNon-overlapping \'polygon\':\n\nSELECT ST_NumInteriorRings(ST_PolyFromText(\'POLYGON((0 0,10 0,10 10,0 10,0 0),\n (-1 -1,-5 -1,-5 -5,-1 -5,-1 -1))\')) AS NumInteriorRings;\n+------------------+\n| NumInteriorRings |\n+------------------+\n| 1 |\n+------------------+\n\n\n\nURL: mariadb.com/kb/en/st_numinteriorrings/','','https://mariadb.com/kb/en/st_numinteriorrings/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (12,3,'WKT Definition','Description\n-----------\n\nThe Well-Known Text (WKT) representation of Geometry is designed to exchange\ngeometry data in ASCII form. Examples of the basic geometry types include:\n\n+------------------------------------------------------------------------------\n\n| Geometry Types \n|\n+------------------------------------------------------------------------------\n\n| POINT \n|\n+------------------------------------------------------------------------------\n\n| LINESTRING \n|\n+------------------------------------------------------------------------------\n\n| POLYGON \n|\n+------------------------------------------------------------------------------\n\n| MULTIPOINT \n|\n+------------------------------------------------------------------------------\n\n| MULTILINESTRING \n|\n+------------------------------------------------------------------------------\n\n| MULTIPOLYGON \n|\n+------------------------------------------------------------------------------\n\n| GEOMETRYCOLLECTION \n|\n+------------------------------------------------------------------------------\n\n| GEOMETRY \n|\n+------------------------------------------------------------------------------\n\n\n\nURL: mariadb.com/kb/en/wkt-definition/','','https://mariadb.com/kb/en/wkt-definition/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (13,3,'AsText','A synonym for ST_AsText().\n\n\n\nURL: mariadb.com/kb/en/wkt-astext/','','https://mariadb.com/kb/en/wkt-astext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (14,3,'AsWKT','A synonym for ST_AsText().\n\n\n\nURL: mariadb.com/kb/en/wkt-aswkt/','','https://mariadb.com/kb/en/wkt-aswkt/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (15,3,'GeomCollFromText','A synonym for ST_GeomCollFromText.\n\n\n\nURL: mariadb.com/kb/en/wkt-geomcollfromtext/','','https://mariadb.com/kb/en/wkt-geomcollfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (16,3,'GeometryCollectionFromText','A synonym for ST_GeomCollFromText.\n\n\n\nURL: mariadb.com/kb/en/geometrycollectionfromtext/','','https://mariadb.com/kb/en/geometrycollectionfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (17,3,'GeometryFromText','A synonym for ST_GeomFromText.\n\n\n\nURL: mariadb.com/kb/en/geometryfromtext/','','https://mariadb.com/kb/en/geometryfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (18,3,'GeomFromText','A synonym for ST_GeomFromText.\n\n\n\nURL: mariadb.com/kb/en/wkt-geomfromtext/','','https://mariadb.com/kb/en/wkt-geomfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (19,3,'LineFromText','A synonym for ST_LineFromText.\n\n\n\nURL: mariadb.com/kb/en/wkt-linefromtext/','','https://mariadb.com/kb/en/wkt-linefromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (20,3,'LineStringFromText','A synonym for ST_LineFromText.\n\n\n\nURL: mariadb.com/kb/en/linestringfromtext/','','https://mariadb.com/kb/en/linestringfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (21,3,'MLineFromText','Syntax\n------\n\nMLineFromText(wkt[,srid])\nMultiLineStringFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a MULTILINESTRING value using its WKT representation and SRID.\n\nMLineFromText() and MultiLineStringFromText() are synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_multi_line (g MULTILINESTRING);\nSHOW FIELDS FROM gis_multi_line;\nINSERT INTO gis_multi_line VALUES\n (MultiLineStringFromText(\'MULTILINESTRING((10 48,10 21,10 0),(16 0,16\n23,16 48))\')),\n (MLineFromText(\'MULTILINESTRING((10 48,10 21,10 0))\')),\n (MLineFromWKB(AsWKB(MultiLineString(\n LineString(Point(1, 2), Point(3, 5)),\n LineString(Point(2, 5), Point(5, 8), Point(21, 7))))));\n\n\n\nURL: mariadb.com/kb/en/mlinefromtext/','','https://mariadb.com/kb/en/mlinefromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (22,3,'MPointFromText','Syntax\n------\n\nMPointFromText(wkt[,srid])\nMultiPointFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a MULTIPOINT value using its WKT representation and SRID.\n\nMPointFromText() and MultiPointFromText() are synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_multi_point (g MULTIPOINT);\nSHOW FIELDS FROM gis_multi_point;\nINSERT INTO gis_multi_point VALUES\n (MultiPointFromText(\'MULTIPOINT(0 0,10 10,10 20,20 20)\')),\n (MPointFromText(\'MULTIPOINT(1 1,11 11,11 21,21 21)\')),\n (MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10)))));\n\n\n\nURL: mariadb.com/kb/en/mpointfromtext/','','https://mariadb.com/kb/en/mpointfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (23,3,'MPolyFromText','Syntax\n------\n\nMPolyFromText(wkt[,srid])\nMultiPolygonFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a MULTIPOLYGON value using its WKT representation and SRID.\n\nMPolyFromText() and MultiPolygonFromText() are synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_multi_polygon (g MULTIPOLYGON);\nSHOW FIELDS FROM gis_multi_polygon;\nINSERT INTO gis_multi_polygon VALUES\n (MultiPolygonFromText(\'MULTIPOLYGON(\n ((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),\n ((59 18,67 18,67 13,59 13,59 18)))\')),\n (MPolyFromText(\'MULTIPOLYGON(\n ((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),\n ((59 18,67 18,67 13,59 13,59 18)))\')),\n (MPolyFromWKB(AsWKB(MultiPolygon(Polygon(\n LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))));\n\n\n\nURL: mariadb.com/kb/en/mpolyfromtext/','','https://mariadb.com/kb/en/mpolyfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (24,3,'MultiLineStringFromText','A synonym for MLineFromText.\n\n\n\nURL: mariadb.com/kb/en/multilinestringfromtext/','','https://mariadb.com/kb/en/multilinestringfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (25,3,'MultiPointFromText','A synonym for MPointFromText.\n\n\n\nURL: mariadb.com/kb/en/multipointfromtext/','','https://mariadb.com/kb/en/multipointfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (26,3,'MultiPolygonFromText','A synonym for MPolyFromText.\n\n\n\nURL: mariadb.com/kb/en/multipolygonfromtext/','','https://mariadb.com/kb/en/multipolygonfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (27,3,'PointFromText','A synonym for ST_PointFromText.\n\n\n\nURL: mariadb.com/kb/en/wkt-pointfromtext/','','https://mariadb.com/kb/en/wkt-pointfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (28,3,'PolyFromText','A synonym for ST_PolyFromText.\n\n\n\nURL: mariadb.com/kb/en/wkt-polyfromtext/','','https://mariadb.com/kb/en/wkt-polyfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (29,3,'PolygonFromText','A synonym for ST_PolyFromText.\n\n\n\nURL: mariadb.com/kb/en/polygonfromtext/','','https://mariadb.com/kb/en/polygonfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (30,3,'ST_AsText','Syntax\n------\n\nST_AsText(g)\nAsText(g)\nST_AsWKT(g)\nAsWKT(g)\n\nDescription\n-----------\n\nConverts a value in internal geometry format to its WKT representation and\nreturns the string result.\n\nST_AsText(), AsText(), ST_AsWKT() and AsWKT() are all synonyms.\n\nExamples\n--------\n\nSET @g = \'LineString(1 1,4 4,6 6)\';\n\nSELECT ST_AsText(ST_GeomFromText(@g));\n+--------------------------------+\n| ST_AsText(ST_GeomFromText(@g)) |\n+--------------------------------+\n| LINESTRING(1 1,4 4,6 6) |\n+--------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_astext/','','https://mariadb.com/kb/en/st_astext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (31,3,'ST_ASWKT','A synonym for ST_ASTEXT().\n\n\n\nURL: mariadb.com/kb/en/st_aswkt/','','https://mariadb.com/kb/en/st_aswkt/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (32,3,'ST_GeomCollFromText','Syntax\n------\n\nST_GeomCollFromText(wkt[,srid])\nST_GeometryCollectionFromText(wkt[,srid])\nGeomCollFromText(wkt[,srid])\nGeometryCollectionFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a GEOMETRYCOLLECTION value using its WKT representation and SRID.\n\nST_GeomCollFromText(), ST_GeometryCollectionFromText(), GeomCollFromText() and\nGeometryCollectionFromText() are all synonyms.\n\nExample\n-------\n\nCREATE TABLE gis_geometrycollection (g GEOMETRYCOLLECTION);\nSHOW FIELDS FROM gis_geometrycollection;\nINSERT INTO gis_geometrycollection VALUES\n (GeomCollFromText(\'GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10\n10))\')),\n (GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6),\nLineString(Point(3, 6), Point(7, 9)))))),\n (GeomFromText(\'GeometryCollection()\')),\n (GeomFromText(\'GeometryCollection EMPTY\'));\n\n\n\nURL: mariadb.com/kb/en/st_geomcollfromtext/','','https://mariadb.com/kb/en/st_geomcollfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (33,3,'ST_GeometryCollectionFromText','A synonym for ST_GeomCollFromText.\n\n\n\nURL: mariadb.com/kb/en/st_geometrycollectionfromtext/','','https://mariadb.com/kb/en/st_geometrycollectionfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (34,3,'ST_GeometryFromText','A synonym for ST_GeomFromText.\n\n\n\nURL: mariadb.com/kb/en/st_geometryfromtext/','','https://mariadb.com/kb/en/st_geometryfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (35,3,'ST_GeomFromText','Syntax\n------\n\nST_GeomFromText(wkt[,srid])\nST_GeometryFromText(wkt[,srid])\nGeomFromText(wkt[,srid])\nGeometryFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a geometry value of any type using its WKT representation and SRID.\n\nGeomFromText(), GeometryFromText(), ST_GeomFromText() and\nST_GeometryFromText() are all synonyms.\n\nExample\n-------\n\nSET @g = ST_GEOMFROMTEXT(\'POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1 1))\');\n\n\n\nURL: mariadb.com/kb/en/st_geomfromtext/','','https://mariadb.com/kb/en/st_geomfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (36,3,'ST_LineFromText','Syntax\n------\n\nST_LineFromText(wkt[,srid])\nST_LineStringFromText(wkt[,srid])\nLineFromText(wkt[,srid])\nLineStringFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a LINESTRING value using its WKT representation and SRID.\n\nST_LineFromText(), ST_LineStringFromText(), ST_LineFromText() and\nST_LineStringFromText() are all synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_line (g LINESTRING);\nSHOW FIELDS FROM gis_line;\nINSERT INTO gis_line VALUES\n (LineFromText(\'LINESTRING(0 0,0 10,10 0)\')),\n (LineStringFromText(\'LINESTRING(10 10,20 10,20 20,10 20,10 10)\')),\n (LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));\n\n\n\nURL: mariadb.com/kb/en/st_linefromtext/','','https://mariadb.com/kb/en/st_linefromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (37,3,'ST_LineStringFromText','A synonym for ST_LineFromText.\n\n\n\nURL: mariadb.com/kb/en/st_linestringfromtext/','','https://mariadb.com/kb/en/st_linestringfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (38,3,'ST_PointFromText','Syntax\n------\n\nST_PointFromText(wkt[,srid])\nPointFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a POINT value using its WKT representation and SRID.\n\nST_PointFromText() and PointFromText() are synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_point (g POINT);\nSHOW FIELDS FROM gis_point;\nINSERT INTO gis_point VALUES\n (PointFromText(\'POINT(10 10)\')),\n (PointFromText(\'POINT(20 10)\')),\n (PointFromText(\'POINT(20 20)\')),\n (PointFromWKB(AsWKB(PointFromText(\'POINT(10 20)\'))));\n\n\n\nURL: mariadb.com/kb/en/st_pointfromtext/','','https://mariadb.com/kb/en/st_pointfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (39,3,'ST_PolyFromText','Syntax\n------\n\nST_PolyFromText(wkt[,srid])\nST_PolygonFromText(wkt[,srid])\nPolyFromText(wkt[,srid])\nPolygonFromText(wkt[,srid])\n\nDescription\n-----------\n\nConstructs a POLYGON value using its WKT representation and SRID.\n\nST_PolyFromText(), ST_PolygonFromText(), PolyFromText() and\nST_PolygonFromText() are all synonyms.\n\nExamples\n--------\n\nCREATE TABLE gis_polygon (g POLYGON);\nINSERT INTO gis_polygon VALUES\n (PolygonFromText(\'POLYGON((10 10,20 10,20 20,10 20,10 10))\')),\n (PolyFromText(\'POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10\n20,10 10))\'));\n\n\n\nURL: mariadb.com/kb/en/st_polyfromtext/','','https://mariadb.com/kb/en/st_polyfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (40,3,'ST_PolygonFromText','A synonym for ST_PolyFromText.\n\n\n\nURL: mariadb.com/kb/en/st_polygonfromtext/','','https://mariadb.com/kb/en/st_polygonfromtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (41,4,'Addition Operator (+)','Syntax\n------\n\n+\n\nDescription\n-----------\n\nAddition.\n\nIf both operands are integers, the result is calculated with BIGINT precision.\nIf either integer is unsigned, the result is also an unsigned integer.\n\nFor real or string operands, the operand with the highest precision determines\nthe result precision.\n\nExamples\n--------\n\nSELECT 3+5;\n+-----+\n| 3+5 |\n+-----+\n| 8 |\n+-----+\n\n\n\nURL: mariadb.com/kb/en/addition-operator/','','https://mariadb.com/kb/en/addition-operator/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (42,4,'Subtraction Operator (-)','Syntax\n------\n\n-\n\nDescription\n-----------\n\nSubtraction. The operator is also used as the unary minus for changing sign.\n\nIf both operands are integers, the result is calculated with BIGINT precision.\nIf either integer is unsigned, the result is also an unsigned integer, unless\nthe NO_UNSIGNED_SUBTRACTION SQL_MODE is enabled, in which case the result is\nalways signed.\n\nFor real or string operands, the operand with the highest precision determines\nthe result precision.\n\nExamples\n--------\n\nSELECT 96-9;\n+------+\n| 96-9 |\n+------+\n| 87 |\n+------+\n\nSELECT 15-17;\n+-------+\n| 15-17 |\n+-------+\n| -2 |\n+-------+\n\nSELECT 3.66 + 1.333;\n+--------------+\n| 3.66 + 1.333 |\n+--------------+\n| 4.993 |\n+--------------+\n\nUnary minus:\n\nSELECT - (3+5);\n+---------+\n| - (3+5) |\n+---------+\n| -8 |\n+---------+\n\n\n\nURL: mariadb.com/kb/en/subtraction-operator-/','','https://mariadb.com/kb/en/subtraction-operator-/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (43,4,'Division Operator (/)','Syntax\n------\n\n/\n\nDescription\n-----------\n\nDivision operator. Dividing by zero will return NULL. By default, returns four\ndigits after the decimal. This is determined by the server system variable\ndiv_precision_increment which by default is four. It can be set from 0 to 30.\n\nDividing by zero returns NULL. If the ERROR_ON_DIVISION_BY_ZERO SQL_MODE is\nused (the default since MariaDB 10.2.4), a division by zero also produces a\nwarning.\n\nExamples\n--------\n\nSELECT 4/5;\n+--------+\n| 4/5 |\n+--------+\n| 0.8000 |\n+--------+\n\nSELECT 300/(2-2);\n+-----------+\n| 300/(2-2) |\n+-----------+\n| NULL |\n+-----------+\n\nSELECT 300/7;\n+---------+\n| 300/7 |\n+---------+\n| 42.8571 |\n+---------+\n\nChanging div_precision_increment for the session from the default of four to\nsix:\n\nSET div_precision_increment = 6;\n\nSELECT 300/7;\n+-----------+\n| 300/7 |\n+-----------+\n| 42.857143 |\n+-----------+\n\nSELECT 300/7;\n+-----------+\n| 300/7 |\n+-----------+\n| 42.857143 |\n+-----------+\n\n\n\nURL: mariadb.com/kb/en/division-operator/','','https://mariadb.com/kb/en/division-operator/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (44,4,'Multiplication Operator (*)','Syntax\n------\n\n*\n\nDescription\n-----------\n\nMultiplication operator.\n\nExamples\n--------\n\nSELECT 7*6;\n+-----+\n| 7*6 |\n+-----+\n| 42 |\n+-----+\n\nSELECT 1234567890*9876543210;\n+-----------------------+\n| 1234567890*9876543210 |\n+-----------------------+\n| -6253480962446024716 |\n+-----------------------+\n\nSELECT 18014398509481984*18014398509481984.0;\n+---------------------------------------+\n| 18014398509481984*18014398509481984.0 |\n+---------------------------------------+\n| 324518553658426726783156020576256.0 |\n+---------------------------------------+\n\nSELECT 18014398509481984*18014398509481984;\n+-------------------------------------+\n| 18014398509481984*18014398509481984 |\n+-------------------------------------+\n| 0 |\n+-------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/multiplication-operator/','','https://mariadb.com/kb/en/multiplication-operator/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (45,4,'Modulo Operator (%)','Syntax\n------\n\nN % M\n\nDescription\n-----------\n\nModulo operator. Returns the remainder of N divided by M. See also MOD.\n\nExamples\n--------\n\nSELECT 1042 % 50;\n+-----------+\n| 1042 % 50 |\n+-----------+\n| 42 |\n+-----------+\n\n\n\nURL: mariadb.com/kb/en/modulo-operator/','','https://mariadb.com/kb/en/modulo-operator/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (46,4,'DIV','Syntax\n------\n\nDIV\n\nDescription\n-----------\n\nInteger division. Similar to FLOOR(), but is safe with BIGINT values.\nIncorrect results may occur for non-integer operands that exceed BIGINT range.\n\nIf the ERROR_ON_DIVISION_BY_ZERO SQL_MODE is used, a division by zero produces\nan error. Otherwise, it returns NULL.\n\nThe remainder of a division can be obtained using the MOD operator.\n\nExamples\n--------\n\nSELECT 300 DIV 7;\n+-----------+\n| 300 DIV 7 |\n+-----------+\n| 42 |\n+-----------+\n\nSELECT 300 DIV 0;\n+-----------+\n| 300 DIV 0 |\n+-----------+\n| NULL |\n+-----------+\n\n\n\nURL: mariadb.com/kb/en/div/','','https://mariadb.com/kb/en/div/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (47,4,'ABS','Syntax\n------\n\nABS(X)\n\nDescription\n-----------\n\nReturns the absolute (non-negative) value of X. If X is not a number, it is\nconverted to a numeric type.\n\nExamples\n--------\n\nSELECT ABS(42);\n+---------+\n| ABS(42) |\n+---------+\n| 42 |\n+---------+\n\nSELECT ABS(-42);\n+----------+\n| ABS(-42) |\n+----------+\n| 42 |\n+----------+\n\nSELECT ABS(DATE \'1994-01-01\');\n+------------------------+\n| ABS(DATE \'1994-01-01\') |\n+------------------------+\n| 19940101 |\n+------------------------+\n\n\n\nURL: mariadb.com/kb/en/abs/','','https://mariadb.com/kb/en/abs/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (48,4,'ACOS','Syntax\n------\n\nACOS(X)\n\nDescription\n-----------\n\nReturns the arc cosine of X, that is, the value whose cosine is X. Returns\nNULL if X is not in the range -1 to 1.\n\nExamples\n--------\n\nSELECT ACOS(1);\n+---------+\n| ACOS(1) |\n+---------+\n| 0 |\n+---------+\n\nSELECT ACOS(1.0001);\n+--------------+\n| ACOS(1.0001) |\n+--------------+\n| NULL |\n+--------------+\n\nSELECT ACOS(0);\n+-----------------+\n| ACOS(0) |\n+-----------------+\n| 1.5707963267949 |\n+-----------------+\n\nSELECT ACOS(0.234);\n+------------------+\n| ACOS(0.234) |\n+------------------+\n| 1.33460644244679 |\n+------------------+\n\n\n\nURL: mariadb.com/kb/en/acos/','','https://mariadb.com/kb/en/acos/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (49,4,'ASIN','Syntax\n------\n\nASIN(X)\n\nDescription\n-----------\n\nReturns the arc sine of X, that is, the value whose sine is X. Returns NULL if\nX is not in the range -1 to 1.\n\nExamples\n--------\n\nSELECT ASIN(0.2);\n+--------------------+\n| ASIN(0.2) |\n+--------------------+\n| 0.2013579207903308 |\n+--------------------+\n\nSELECT ASIN(\'foo\');\n+-------------+\n| ASIN(\'foo\') |\n+-------------+\n| 0 |\n+-------------+\n\nSHOW WARNINGS;\n+---------+------+-----------------------------------------+\n| Level | Code | Message |\n+---------+------+-----------------------------------------+\n| Warning | 1292 | Truncated incorrect DOUBLE value: \'foo\' |\n+---------+------+-----------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/asin/','','https://mariadb.com/kb/en/asin/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (50,4,'ATAN','Syntax\n------\n\nATAN(X)\n\nDescription\n-----------\n\nReturns the arc tangent of X, that is, the value whose tangent is X.\n\nExamples\n--------\n\nSELECT ATAN(2);\n+--------------------+\n| ATAN(2) |\n+--------------------+\n| 1.1071487177940904 |\n+--------------------+\n\nSELECT ATAN(-2);\n+---------------------+\n| ATAN(-2) |\n+---------------------+\n| -1.1071487177940904 |\n+---------------------+\n\n\n\nURL: mariadb.com/kb/en/atan/','','https://mariadb.com/kb/en/atan/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (51,4,'ATAN2','Syntax\n------\n\nATAN(Y,X), ATAN2(Y,X)\n\nDescription\n-----------\n\nReturns the arc tangent of the two variables X and Y. It is similar to\ncalculating the arc tangent of Y / X, except that the signs of both arguments\nare used to determine the quadrant of the result.\n\nExamples\n--------\n\nSELECT ATAN(-2,2);\n+---------------------+\n| ATAN(-2,2) |\n+---------------------+\n| -0.7853981633974483 |\n+---------------------+\n\nSELECT ATAN2(PI(),0);\n+--------------------+\n| ATAN2(PI(),0) |\n+--------------------+\n| 1.5707963267948966 |\n+--------------------+\n\n\n\nURL: mariadb.com/kb/en/atan2/','','https://mariadb.com/kb/en/atan2/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (52,4,'CEIL','Syntax\n------\n\nCEIL(X)\n\nDescription\n-----------\n\nCEIL() is a synonym for CEILING().\n\n\n\nURL: mariadb.com/kb/en/ceil/','','https://mariadb.com/kb/en/ceil/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (53,4,'CEILING','Syntax\n------\n\nCEILING(X)\n\nDescription\n-----------\n\nReturns the smallest integer value not less than X.\n\nExamples\n--------\n\nSELECT CEILING(1.23);\n+---------------+\n| CEILING(1.23) |\n+---------------+\n| 2 |\n+---------------+\n\nSELECT CEILING(-1.23);\n+----------------+\n| CEILING(-1.23) |\n+----------------+\n| -1 |\n+----------------+\n\n\n\nURL: mariadb.com/kb/en/ceiling/','','https://mariadb.com/kb/en/ceiling/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (54,4,'CONV','Syntax\n------\n\nCONV(N,from_base,to_base)\n\nDescription\n-----------\n\nConverts numbers between different number bases. Returns a string\nrepresentation of the number N, converted from base from_base to base to_base.\n\nReturns NULL if any argument is NULL, or if the second or third argument are\nnot in the allowed range.\n\nThe argument N is interpreted as an integer, but may be specified as an\ninteger or a string. The minimum base is 2 and the maximum base is 36. If\nto_base is a negative number, N is regarded as a signed number. Otherwise, N\nis treated as unsigned. CONV() works with 64-bit precision.\n\nSome shortcuts for this function are also available: BIN(), OCT(), HEX(),\nUNHEX(). Also, MariaDB allows binary literal values and hexadecimal literal\nvalues.\n\nExamples\n--------\n\nSELECT CONV(\'a\',16,2);\n+----------------+\n| CONV(\'a\',16,2) |\n+----------------+\n| 1010 |\n+----------------+\n\nSELECT CONV(\'6E\',18,8);\n+-----------------+\n| CONV(\'6E\',18,8) |\n+-----------------+\n| 172 |\n+-----------------+\n\nSELECT CONV(-17,10,-18);\n+------------------+\n| CONV(-17,10,-18) |\n+------------------+\n| -H |\n+------------------+\n\nSELECT CONV(12+\'10\'+\'10\'+0xa,10,10);\n+------------------------------+\n| CONV(12+\'10\'+\'10\'+0xa,10,10) |\n+------------------------------+\n| 42 |\n+------------------------------+\n\n\n\nURL: mariadb.com/kb/en/conv/','','https://mariadb.com/kb/en/conv/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (55,4,'COS','Syntax\n------\n\nCOS(X)\n\nDescription\n-----------\n\nReturns the cosine of X, where X is given in radians.\n\nExamples\n--------\n\nSELECT COS(PI());\n+-----------+\n| COS(PI()) |\n+-----------+\n| -1 |\n+-----------+\n\n\n\nURL: mariadb.com/kb/en/cos/','','https://mariadb.com/kb/en/cos/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (56,4,'COT','Syntax\n------\n\nCOT(X)\n\nDescription\n-----------\n\nReturns the cotangent of X.\n\nExamples\n--------\n\nSELECT COT(42);\n+--------------------+\n| COT(42) |\n+--------------------+\n| 0.4364167060752729 |\n+--------------------+\n\nSELECT COT(12);\n+---------------------+\n| COT(12) |\n+---------------------+\n| -1.5726734063976893 |\n+---------------------+\n\nSELECT COT(0);\nERROR 1690 (22003): DOUBLE value is out of range in \'cot(0)\'\n\n\n\nURL: mariadb.com/kb/en/cot/','','https://mariadb.com/kb/en/cot/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (57,4,'CRC32','Syntax\n------\n\n<= MariaDB 10.7\n\nCRC32(expr)\n\nFrom MariaDB 10.8\n\nCRC32([par,]expr)\n\nDescription\n-----------\n\nComputes a cyclic redundancy check (CRC) value and returns a 32-bit unsigned\nvalue. The result is NULL if the argument is NULL. The argument is expected to\nbe a string and (if possible) is treated as one if it is not.\n\nUses the ISO 3309 polynomial that used by zlib and many others. MariaDB 10.8\nintroduced the CRC32C() function, which uses the alternate Castagnoli\npolynomia.\n\nMariaDB starting with 10.8\n--------------------------\nOften, CRC is computed in pieces. To facilitate this, MariaDB 10.8.0\nintroduced an optional parameter: CRC32(\'MariaDB\')=CRC32(CRC32(\'Maria\'),\'DB\').\n\nExamples\n--------\n\nSELECT CRC32(\'MariaDB\');\n+------------------+\n| CRC32(\'MariaDB\') |\n+------------------+\n| 4227209140 |\n+------------------+\n\nSELECT CRC32(\'mariadb\');\n+------------------+\n| CRC32(\'mariadb\') |\n+------------------+\n| 2594253378 |\n+------------------+\n\nFrom MariaDB 10.8.0\n\nSELECT CRC32(CRC32(\'Maria\'),\'DB\');\n+----------------------------+\n| CRC32(CRC32(\'Maria\'),\'DB\') |\n+----------------------------+\n| 4227209140 |\n+----------------------------+\n\n\n\nURL: mariadb.com/kb/en/crc32/','','https://mariadb.com/kb/en/crc32/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (58,4,'DEGREES','Syntax\n------\n\nDEGREES(X)\n\nDescription\n-----------\n\nReturns the argument X, converted from radians to degrees.\n\nThis is the converse of the RADIANS() function.\n\nExamples\n--------\n\nSELECT DEGREES(PI());\n+---------------+\n| DEGREES(PI()) |\n+---------------+\n| 180 |\n+---------------+\n\nSELECT DEGREES(PI() / 2);\n+-------------------+\n| DEGREES(PI() / 2) |\n+-------------------+\n| 90 |\n+-------------------+\n\nSELECT DEGREES(45);\n+-----------------+\n| DEGREES(45) |\n+-----------------+\n| 2578.3100780887 |\n+-----------------+\n\n\n\nURL: mariadb.com/kb/en/degrees/','','https://mariadb.com/kb/en/degrees/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (59,4,'EXP','Syntax\n------\n\nEXP(X)\n\nDescription\n-----------\n\nReturns the value of e (the base of natural logarithms) raised to the power of\nX. The inverse of this function is LOG() (using a single argument only) or\nLN().\n\nIf X is NULL, this function returns NULL.\n\nExamples\n--------\n\nSELECT EXP(2);\n+------------------+\n| EXP(2) |\n+------------------+\n| 7.38905609893065 |\n+------------------+\n\nSELECT EXP(-2);\n+--------------------+\n| EXP(-2) |\n+--------------------+\n| 0.1353352832366127 |\n+--------------------+\n\nSELECT EXP(0);\n+--------+\n| EXP(0) |\n+--------+\n| 1 |\n+--------+\n\nSELECT EXP(NULL);\n+-----------+\n| EXP(NULL) |\n+-----------+\n| NULL |\n+-----------+\n\n\n\nURL: mariadb.com/kb/en/exp/','','https://mariadb.com/kb/en/exp/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (60,4,'FLOOR','Syntax\n------\n\nFLOOR(X)\n\nDescription\n-----------\n\nReturns the largest integer value not greater than X.\n\nExamples\n--------\n\nSELECT FLOOR(1.23);\n+-------------+\n| FLOOR(1.23) |\n+-------------+\n| 1 |\n+-------------+\n\nSELECT FLOOR(-1.23);\n+--------------+\n| FLOOR(-1.23) |\n+--------------+\n| -2 |\n+--------------+\n\n\n\nURL: mariadb.com/kb/en/floor/','','https://mariadb.com/kb/en/floor/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (61,4,'LN','Syntax\n------\n\nLN(X)\n\nDescription\n-----------\n\nReturns the natural logarithm of X; that is, the base-e logarithm of X. If X\nis less than or equal to 0, or NULL, then NULL is returned.\n\nThe inverse of this function is EXP().\n\nExamples\n--------\n\nSELECT LN(2);\n+-------------------+\n| LN(2) |\n+-------------------+\n| 0.693147180559945 |\n+-------------------+\n\nSELECT LN(-2);\n+--------+\n| LN(-2) |\n+--------+\n| NULL |\n+--------+\n\n\n\nURL: mariadb.com/kb/en/ln/','','https://mariadb.com/kb/en/ln/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (62,4,'LOG','Syntax\n------\n\nLOG(X), LOG(B,X)\n\nDescription\n-----------\n\nIf called with one parameter, this function returns the natural logarithm of\nX. If X is less than or equal to 0, then NULL is returned.\n\nIf called with two parameters, it returns the logarithm of X to the base B. If\nB is <= 1 or X <= 0, the function returns NULL.\n\nIf any argument is NULL, the function returns NULL.\n\nThe inverse of this function (when called with a single argument) is the EXP()\nfunction.\n\nExamples\n--------\n\nLOG(X):\n\nSELECT LOG(2);\n+-------------------+\n| LOG(2) |\n+-------------------+\n| 0.693147180559945 |\n+-------------------+\n\nSELECT LOG(-2);\n+---------+\n| LOG(-2) |\n+---------+\n| NULL |\n+---------+\n\nLOG(B,X)\n\nSELECT LOG(2,16);\n+-----------+\n| LOG(2,16) |\n+-----------+\n| 4 |\n+-----------+\n\nSELECT LOG(3,27);\n+-----------+\n| LOG(3,27) |\n+-----------+\n| 3 |\n+-----------+\n\nSELECT LOG(3,1);\n+----------+\n| LOG(3,1) |\n+----------+\n| 0 |\n+----------+\n\nSELECT LOG(3,0);\n+----------+\n| LOG(3,0) |\n+----------+\n| NULL |\n+----------+\n\n\n\nURL: mariadb.com/kb/en/log/','','https://mariadb.com/kb/en/log/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (63,4,'LOG10','Syntax\n------\n\nLOG10(X)\n\nDescription\n-----------\n\nReturns the base-10 logarithm of X.\n\nExamples\n--------\n\nSELECT LOG10(2);\n+-------------------+\n| LOG10(2) |\n+-------------------+\n| 0.301029995663981 |\n+-------------------+\n\nSELECT LOG10(100);\n+------------+\n| LOG10(100) |\n+------------+\n| 2 |\n+------------+\n\nSELECT LOG10(-100);\n+-------------+\n| LOG10(-100) |\n+-------------+\n| NULL |\n+-------------+\n\n\n\nURL: mariadb.com/kb/en/log10/','','https://mariadb.com/kb/en/log10/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (64,4,'LOG2','Syntax\n------\n\nLOG2(X)\n\nDescription\n-----------\n\nReturns the base-2 logarithm of X.\n\nExamples\n--------\n\nSELECT LOG2(4398046511104);\n+---------------------+\n| LOG2(4398046511104) |\n+---------------------+\n| 42 |\n+---------------------+\n\nSELECT LOG2(65536);\n+-------------+\n| LOG2(65536) |\n+-------------+\n| 16 |\n+-------------+\n\nSELECT LOG2(-100);\n+------------+\n| LOG2(-100) |\n+------------+\n| NULL |\n+------------+\n\n\n\nURL: mariadb.com/kb/en/log2/','','https://mariadb.com/kb/en/log2/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (65,4,'MOD','Syntax\n------\n\nMOD(N,M), N % M, N MOD M\n\nDescription\n-----------\n\nModulo operation. Returns the remainder of N divided by M. See also Modulo\nOperator.\n\nIf the ERROR_ON_DIVISION_BY_ZERO SQL_MODE is used, any number modulus zero\nproduces an error. Otherwise, it returns NULL.\n\nThe integer part of a division can be obtained using DIV.\n\nExamples\n--------\n\nSELECT 1042 % 50;\n+-----------+\n| 1042 % 50 |\n+-----------+\n| 42 |\n+-----------+\n\nSELECT MOD(234, 10);\n+--------------+\n| MOD(234, 10) |\n+--------------+\n| 4 |\n+--------------+\n\nSELECT 253 % 7;\n+---------+\n| 253 % 7 |\n+---------+\n| 1 |\n+---------+\n\nSELECT MOD(29,9);\n+-----------+\n| MOD(29,9) |\n+-----------+\n| 2 |\n+-----------+\n\nSELECT 29 MOD 9;\n+----------+\n| 29 MOD 9 |\n+----------+\n| 2 |\n+----------+\n\n\n\nURL: mariadb.com/kb/en/mod/','','https://mariadb.com/kb/en/mod/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (66,4,'OCT','Syntax\n------\n\nOCT(N)\n\nDescription\n-----------\n\nReturns a string representation of the octal value of N, where N is a longlong\n(BIGINT) number. This is equivalent to CONV(N,10,8). Returns NULL if N is NULL.\n\nExamples\n--------\n\nSELECT OCT(34);\n+---------+\n| OCT(34) |\n+---------+\n| 42 |\n+---------+\n\nSELECT OCT(12);\n+---------+\n| OCT(12) |\n+---------+\n| 14 |\n+---------+\n\n\n\nURL: mariadb.com/kb/en/oct/','','https://mariadb.com/kb/en/oct/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (67,4,'PI','Syntax\n------\n\nPI()\n\nDescription\n-----------\n\nReturns the value of π (pi). The default number of decimal places displayed is\nsix, but MariaDB uses the full double-precision value internally.\n\nExamples\n--------\n\nSELECT PI();\n+----------+\n| PI() |\n+----------+\n| 3.141593 |\n+----------+\n\nSELECT PI()+0.0000000000000000000000;\n+-------------------------------+\n| PI()+0.0000000000000000000000 |\n+-------------------------------+\n| 3.1415926535897931159980 |\n+-------------------------------+\n\n\n\nURL: mariadb.com/kb/en/pi/','','https://mariadb.com/kb/en/pi/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (68,4,'POW','Syntax\n------\n\nPOW(X,Y)\n\nDescription\n-----------\n\nReturns the value of X raised to the power of Y.\n\nPOWER() is a synonym.\n\nExamples\n--------\n\nSELECT POW(2,3);\n+----------+\n| POW(2,3) |\n+----------+\n| 8 |\n+----------+\n\nSELECT POW(2,-2);\n+-----------+\n| POW(2,-2) |\n+-----------+\n| 0.25 |\n+-----------+\n\n\n\nURL: mariadb.com/kb/en/pow/','','https://mariadb.com/kb/en/pow/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (69,4,'POWER','Syntax\n------\n\nPOWER(X,Y)\n\nDescription\n-----------\n\nThis is a synonym for POW(), which returns the value of X raised to the power\nof Y.\n\n\n\nURL: mariadb.com/kb/en/power/','','https://mariadb.com/kb/en/power/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (70,4,'RADIANS','Syntax\n------\n\nRADIANS(X)\n\nDescription\n-----------\n\nReturns the argument X, converted from degrees to radians. Note that π radians\nequals 180 degrees.\n\nThis is the converse of the DEGREES() function.\n\nExamples\n--------\n\nSELECT RADIANS(45);\n+-------------------+\n| RADIANS(45) |\n+-------------------+\n| 0.785398163397448 |\n+-------------------+\n\nSELECT RADIANS(90);\n+-----------------+\n| RADIANS(90) |\n+-----------------+\n| 1.5707963267949 |\n+-----------------+\n\nSELECT RADIANS(PI());\n+--------------------+\n| RADIANS(PI()) |\n+--------------------+\n| 0.0548311355616075 |\n+--------------------+\n\nSELECT RADIANS(180);\n+------------------+\n| RADIANS(180) |\n+------------------+\n| 3.14159265358979 |\n+------------------+\n\n\n\nURL: mariadb.com/kb/en/radians/','','https://mariadb.com/kb/en/radians/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (71,4,'RAND','Syntax\n------\n\nRAND(), RAND(N)\n\nDescription\n-----------\n\nReturns a random DOUBLE precision floating point value v in the range 0 <= v <\n1.0. If a constant integer argument N is specified, it is used as the seed\nvalue, which produces a repeatable sequence of column values. In the example\nbelow, note that the sequences of values produced by RAND(3) is the same both\nplaces where it occurs.\n\nIn a WHERE clause, RAND() is evaluated each time the WHERE is executed.\n\nStatements using the RAND() function are not safe for statement-based\nreplication.\n\nPractical uses\n--------------\n\nThe expression to get a random integer from a given range is the following:\n\nFLOOR(min_value + RAND() * (max_value - min_value +1))\n\nRAND() is often used to read random rows from a table, as follows:\n\nSELECT * FROM my_table ORDER BY RAND() LIMIT 10;\n\nNote, however, that this technique should never be used on a large table as it\nwill be extremely slow. MariaDB will read all rows in the table, generate a\nrandom value for each of them, order them, and finally will apply the LIMIT\nclause.\n\nExamples\n--------\n\nCREATE TABLE t (i INT);\n\nINSERT INTO t VALUES(1),(2),(3);\n\nSELECT i, RAND() FROM t;\n+------+-------------------+\n| i | RAND() |\n+------+-------------------+\n| 1 | 0.255651095188829 |\n| 2 | 0.833920199269355 |\n| 3 | 0.40264774151393 |\n+------+-------------------+\n\nSELECT i, RAND(3) FROM t;\n+------+-------------------+\n| i | RAND(3) |\n+------+-------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.373079058130345 |\n| 3 | 0.148086053457191 |\n+------+-------------------+\n\nSELECT i, RAND() FROM t;\n+------+-------------------+\n| i | RAND() |\n+------+-------------------+\n| 1 | 0.511478140495232 |\n| 2 | 0.349447508668012 |\n| 3 | 0.212803152588013 |\n+------+-------------------+\n\nUsing the same seed, the same sequence will be returned:\n\nSELECT i, RAND(3) FROM t;\n+------+-------------------+\n| i | RAND(3) |\n+------+-------------------+\n| 1 | 0.90576975597606 |\n| 2 | 0.373079058130345 |\n| 3 | 0.148086053457191 |\n+------+-------------------+\n\nGenerating a random number from 5 to 15:\n\nSELECT FLOOR(5 + (RAND() * 11));\n\n\n\nURL: mariadb.com/kb/en/rand/','','https://mariadb.com/kb/en/rand/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (72,4,'ROUND','Syntax\n------\n\nROUND(X), ROUND(X,D)\n\nDescription\n-----------\n\nRounds the argument X to D decimal places. The rounding algorithm depends on\nthe data type of X. D defaults to 0 if not specified. D can be negative to\ncause D digits left of the decimal point of the value X to become zero.\n\nExamples\n--------\n\nSELECT ROUND(-1.23);\n+--------------+\n| ROUND(-1.23) |\n+--------------+\n| -1 |\n+--------------+\n\nSELECT ROUND(-1.58);\n+--------------+\n| ROUND(-1.58) |\n+--------------+\n| -2 |\n+--------------+\n\nSELECT ROUND(1.58); \n+-------------+\n| ROUND(1.58) |\n+-------------+\n| 2 |\n+-------------+\n\nSELECT ROUND(1.298, 1);\n+-----------------+\n| ROUND(1.298, 1) |\n+-----------------+\n| 1.3 |\n+-----------------+\n\nSELECT ROUND(1.298, 0);\n+-----------------+\n| ROUND(1.298, 0) |\n+-----------------+\n| 1 |\n+-----------------+\n\nSELECT ROUND(23.298, -1);\n+-------------------+\n| ROUND(23.298, -1) |\n+-------------------+\n| 20 |\n+-------------------+\n\n\n\nURL: mariadb.com/kb/en/round/','','https://mariadb.com/kb/en/round/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (73,4,'SIGN','Syntax\n------\n\nSIGN(X)\n\nDescription\n-----------\n\nReturns the sign of the argument as -1, 0, or 1, depending on whether X is\nnegative, zero, or positive.\n\nExamples\n--------\n\nSELECT SIGN(-32);\n+-----------+\n| SIGN(-32) |\n+-----------+\n| -1 |\n+-----------+\n\nSELECT SIGN(0);\n+---------+\n| SIGN(0) |\n+---------+\n| 0 |\n+---------+\n\nSELECT SIGN(234);\n+-----------+\n| SIGN(234) |\n+-----------+\n| 1 |\n+-----------+\n\n\n\nURL: mariadb.com/kb/en/sign/','','https://mariadb.com/kb/en/sign/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (74,4,'SIN','Syntax\n------\n\nSIN(X)\n\nDescription\n-----------\n\nReturns the sine of X, where X is given in radians.\n\nExamples\n--------\n\nSELECT SIN(1.5707963267948966);\n+-------------------------+\n| SIN(1.5707963267948966) |\n+-------------------------+\n| 1 |\n+-------------------------+\n\nSELECT SIN(PI());\n+----------------------+\n| SIN(PI()) |\n+----------------------+\n| 1.22460635382238e-16 |\n+----------------------+\n\nSELECT ROUND(SIN(PI()));\n+------------------+\n| ROUND(SIN(PI())) |\n+------------------+\n| 0 |\n+------------------+\n\n\n\nURL: mariadb.com/kb/en/sin/','','https://mariadb.com/kb/en/sin/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (75,4,'SQRT','Syntax\n------\n\nSQRT(X)\n\nDescription\n-----------\n\nReturns the square root of X. If X is negative, NULL is returned.\n\nExamples\n--------\n\nSELECT SQRT(4);\n+---------+\n| SQRT(4) |\n+---------+\n| 2 |\n+---------+\n\nSELECT SQRT(20);\n+------------------+\n| SQRT(20) |\n+------------------+\n| 4.47213595499958 |\n+------------------+\n\nSELECT SQRT(-16);\n+-----------+\n| SQRT(-16) |\n+-----------+\n| NULL |\n+-----------+\n\nSELECT SQRT(1764);\n+------------+\n| SQRT(1764) |\n+------------+\n| 42 |\n+------------+\n\n\n\nURL: mariadb.com/kb/en/sqrt/','','https://mariadb.com/kb/en/sqrt/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (76,4,'TAN','Syntax\n------\n\nTAN(X)\n\nDescription\n-----------\n\nReturns the tangent of X, where X is given in radians.\n\nExamples\n--------\n\nSELECT TAN(0.7853981633974483);\n+-------------------------+\n| TAN(0.7853981633974483) |\n+-------------------------+\n| 0.9999999999999999 |\n+-------------------------+\n\nSELECT TAN(PI());\n+-----------------------+\n| TAN(PI()) |\n+-----------------------+\n| -1.22460635382238e-16 |\n+-----------------------+\n\nSELECT TAN(PI()+1);\n+-----------------+\n| TAN(PI()+1) |\n+-----------------+\n| 1.5574077246549 |\n+-----------------+\n\nSELECT TAN(RADIANS(PI()));\n+--------------------+\n| TAN(RADIANS(PI())) |\n+--------------------+\n| 0.0548861508080033 |\n+--------------------+\n\n\n\nURL: mariadb.com/kb/en/tan/','','https://mariadb.com/kb/en/tan/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (77,4,'TRUNCATE','This page documents the TRUNCATE function. See TRUNCATE TABLE for the\nDDL statement.\n\nSyntax\n------\n\nTRUNCATE(X,D)\n\nDescription\n-----------\n\nReturns the number X, truncated to D decimal places. If D is 0, the result has\nno decimal point or fractional part. D can be negative to cause D digits left\nof the decimal point of the value X to become zero.\n\nExamples\n--------\n\nSELECT TRUNCATE(1.223,1);\n+-------------------+\n| TRUNCATE(1.223,1) |\n+-------------------+\n| 1.2 |\n+-------------------+\n\nSELECT TRUNCATE(1.999,1);\n+-------------------+\n| TRUNCATE(1.999,1) |\n+-------------------+\n| 1.9 |\n+-------------------+\n\nSELECT TRUNCATE(1.999,0); \n+-------------------+\n| TRUNCATE(1.999,0) |\n+-------------------+\n| 1 |\n+-------------------+\n\nSELECT TRUNCATE(-1.999,1);\n+--------------------+\n| TRUNCATE(-1.999,1) |\n+--------------------+\n| -1.9 |\n+--------------------+\n\nSELECT TRUNCATE(122,-2);\n+------------------+\n| TRUNCATE(122,-2) |\n+------------------+\n| 100 |\n+------------------+\n\nSELECT TRUNCATE(10.28*100,0);\n+-----------------------+\n| TRUNCATE(10.28*100,0) |\n+-----------------------+\n| 1028 |\n+-----------------------+\n\n\n\nURL: mariadb.com/kb/en/truncate/','','https://mariadb.com/kb/en/truncate/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (78,5,'Plugin Overview','Plugins are server components that enhance MariaDB in some way. These can be\nanything from new storage engines, plugins for enhancing full-text parsing, or\neven small enhancements, such as a plugin to get a timestamp as an integer.\n\nQuerying Plugin Information\n---------------------------\n\nThere are a number of ways to see which plugins are currently active.\n\nA server almost always has a large number of active plugins, because the\nserver contains a large number of built-in plugins, which are active by\ndefault and cannot be uninstalled.\n\nQuerying Plugin Information with SHOW PLUGINS\n---------------------------------------------\n\nThe SHOW PLUGINS statement can be used to query information about all active\nplugins.\n\nFor example:\n\nSHOW PLUGINS\G;\n********************** 1. row **********************\n Name: binlog\n Status: ACTIVE\n Type: STORAGE ENGINE\nLibrary: NULL\nLicense: GPL\n********************** 2. row **********************\n Name: mysql_native_password\n Status: ACTIVE\n Type: AUTHENTICATION\nLibrary: NULL\nLicense: GPL\n********************** 3. row **********************\n Name: mysql_old_password\n Status: ACTIVE\n Type: AUTHENTICATION\nLibrary: NULL\nLicense: GPL\n...\n\nIf a plugin\'s Library column has a NULL value, then the plugin is built-in,\nand it cannot be uninstalled.\n\nQuerying Plugin Information with information_schema.PLUGINS\n-----------------------------------------------------------\n\nThe information_schema.PLUGINS table can be queried to get more detailed\ninformation about plugins.\n\nFor example:\n\nSELECT * FROM information_schema.PLUGINS\G\n...\n*************************** 6. row ***************************\n PLUGIN_NAME: CSV\n PLUGIN_VERSION: 1.0\n PLUGIN_STATUS: ACTIVE\n PLUGIN_TYPE: STORAGE ENGINE\n PLUGIN_TYPE_VERSION: 100003.0\n PLUGIN_LIBRARY: NULL\nPLUGIN_LIBRARY_VERSION: NULL\n PLUGIN_AUTHOR: Brian Aker, MySQL AB\n PLUGIN_DESCRIPTION: CSV storage engine\n PLUGIN_LICENSE: GPL\n LOAD_OPTION: FORCE\n PLUGIN_MATURITY: Stable\n PLUGIN_AUTH_VERSION: 1.0\n*************************** 7. row ***************************\n PLUGIN_NAME: MEMORY\n PLUGIN_VERSION: 1.0\n PLUGIN_STATUS: ACTIVE\n PLUGIN_TYPE: STORAGE ENGINE\n PLUGIN_TYPE_VERSION: 100003.0\n PLUGIN_LIBRARY: NULL\nPLUGIN_LIBRARY_VERSION: NULL\n PLUGIN_AUTHOR: MySQL AB\n PLUGIN_DESCRIPTION: Hash based, stored in memory, useful for temporary\ntables\n PLUGIN_LICENSE: GPL\n LOAD_OPTION: FORCE\n PLUGIN_MATURITY: Stable\n PLUGIN_AUTH_VERSION: 1.0\n...\n\nIf a plugin\'s PLUGIN_LIBRARY column has the NULL value, then the plugin is\nbuilt-in, and it cannot be uninstalled.\n\nQuerying Plugin Information with mysql.plugin\n---------------------------------------------\n\nThe mysql.plugin table can be queried to get information about installed\nplugins.\n\nThis table only contains information about plugins that have been installed\nvia the following methods:\n\n* The INSTALL SONAME statement.\n* The INSTALL PLUGIN statement.\n* The mysql_plugin utility.\n\nThis table does not contain information about:\n\n* Built-in plugins.\n* Plugins loaded with the --plugin-load-add option.\n* Plugins loaded with the --plugin-load option.\n\nThis table only contains enough information to reload the plugin when the\nserver is restarted, which means it only contains the plugin name and the\nplugin library.\n\nFor example:\n\nSELECT * FROM mysql.plugin;\n\n+------+------------+\n| name | dl |\n+------+------------+\n| PBXT | libpbxt.so |\n+------+------------+\n\nInstalling a Plugin\n-------------------\n\nThere are three primary ways to install a plugin:\n\n* A plugin can be installed dynamically with an SQL statement.\n* A plugin can be installed with a mysqld option, but it requires a server\nrestart.\n* A plugin can be installed with the mysql_plugin utility, while the server is\ncompletely offline.\n\nWhen you are installing a plugin, you also have to ensure that:\n\n* The server\'s plugin directory is properly configured, and the plugin\'s\nlibrary is in the plugin directory.\n* The server\'s minimum plugin maturity is properly configured, and the plugin\nis mature enough to be installed.\n\nInstalling a Plugin Dynamically\n-------------------------------\n\nA plugin can be installed dynamically by executing either the INSTALL SONAME\nor the INSTALL PLUGIN statement.\n\nIf a plugin is installed with one of these statements, then a record will be\nadded to the mysql.plugins table for the plugin. This means that the plugin\nwill automatically be loaded every time the server restarts, unless\nspecifically uninstalled or deactivated.\n\nInstalling a Plugin with INSTALL SONAME\n---------------------------------------\n\nYou can install a plugin dynamically by executing the INSTALL SONAME\nstatement. INSTALL SONAME installs all plugins from the given plugin library.\nThis could be required for some plugin libraries.\n\nFor example, to install all plugins in the server_audit plugin library (which\nis currently only the server_audit audit plugin), you could execute the\nfollowing:\n\nINSTALL SONAME \'server_audit\';\n\nInstalling a Plugin with INSTALL PLUGIN\n---------------------------------------\n\nYou can install a plugin dynamically by executing the INSTALL PLUGIN\nstatement. INSTALL PLUGIN installs a single plugin from the given plugin\nlibrary.\n\nFor example, to install the server_audit audit plugin from the server_audit\nplugin library, you could execute the following:\n\nINSTALL PLUGIN server_audit SONAME \'server_audit\';\n\nInstalling a Plugin with Plugin Load Options\n--------------------------------------------\n\nA plugin can be installed with a mysqld option by providing either the\n--plugin-load-add or the --plugin-load option.\n\nIf a plugin is installed with one of these options, then a record will not be\nadded to the mysql.plugins table for the plugin. This means that if the server\nis restarted without the same option set, then the plugin will not\nautomatically be loaded.\n\nInstalling a Plugin with --plugin-load-add\n------------------------------------------\n\nYou can install a plugin with the --plugin-load-add option by specifying the\noption as a command-line argument to mysqld or by specifying the option in a\nrelevant server option group in an option file.\n\nThe --plugin-load-add option uses the following format:\n\n* Plugins can be specified in the format name=library, where name is the\nplugin name and library is the plugin library. This format installs a single\nplugin from the given plugin library.\n* Plugins can also be specified in the format library, where library is the\nplugin library. This format installs all plugins from the given plugin library.\n* Multiple plugins can be specified by separating them with semicolons.\n\nFor example, to install all plugins in the server_audit plugin library (which\nis currently only the server_audit audit plugin) and also the ed25519\nauthentication plugin from the auth_ed25519 plugin library, you could set the\noption to the following values on the command-line:\n\n$ mysqld --user=mysql --plugin-load-add=\'server_audit\'\n--plugin-load-add=\'ed25519=auth_ed25519\'\n\nYou could also set the option to the same values in an option file:\n\n[mariadb]\n...\nplugin_load_add = server_audit\nplugin_load_add = ed25519=auth_ed25519\n\nSpecial care must be taken when specifying both the --plugin-load option and\nthe --plugin-load-add option together. The --plugin-load option resets the\nplugin load list, and this can cause unexpected problems if you are not aware.\nThe --plugin-load-add option does not reset the plugin load list, so it is\nmuch safer to use. See Specifying Multiple Plugin Load Options for more\ninformation.\n\nInstalling a Plugin with --plugin-load\n--------------------------------------\n\nYou can install a plugin with the --plugin-load option by specifying the\noption as a command-line argument to mysqld or by specifying the option in a\nrelevant server option group in an option file.\n\nThe --plugin-load option uses the following format:\n\n* Plugins can be specified in the format name=library, where name is the\nplugin name and library is the plugin library. This format installs a single\nplugin from the given plugin library.\n* Plugins can also be specified in the format library, where library is the\nplugin library. This format installs all plugins from the given plugin library.\n* Multiple plugins can be specified by separating them with semicolons.\n\nFor example, to install all plugins in the server_audit plugin library (which\nis currently only the server_audit audit plugin) and also the ed25519\nauthentication plugin from the auth_ed25519 plugin library, you could set the\noption to the following values on the command-line:\n\n$ mysqld --user=mysql --plugin-load=\'server_audit;ed25519=auth_ed25519\'\n\nYou could also set the option to the same values in an option file:\n\n[mariadb]\n...\nplugin_load = server_audit;ed25519=auth_ed25519\n\nSpecial care must be taken when specifying the --plugin-load option multiple\ntimes, or when specifying both the --plugin-load option and the\n--plugin-load-add option together. The --plugin-load option resets the plugin\nload list, and this can cause unexpected problems if you are not aware. The\n--plugin-load-add option does not reset the plugin load list, so it is much\nsafer to use. See Specifying Multiple Plugin Load Options for more information.\n\nSpecifying Multiple Plugin Load Options\n---------------------------------------\n\nSpecial care must be taken when specifying the --plugin-load option multiple\ntimes, or when specifying both the --plugin-load option and the\n--plugin-load-add option. The --plugin-load option resets the plugin load\nlist, and this can cause unexpected problems if you are not aware. The\n--plugin-load-add option does not reset the plugin load list, so it is much\nsafer to use.\n\nThis can have the following consequences:\n\n* If the --plugin-load option is specified multiple times, then only the last\ninstance will have any effect. For example, in the following case, the first\ninstance of the option is reset:\n\n[mariadb]\n...\nplugin_load = server_audit\nplugin_load = ed25519=auth_ed25519\n\n* If the --plugin-load option is specified after the --plugin-load-add option,\nthen it will also reset the changes made by that option. For example, in the\nfollowing case, the --plugin-load-add option does not do anything, because the\nsubsequent --plugin-load option resets the plugin load list:\n\n[mariadb]\n...\nplugin_load_add = server_audit\nplugin_load = ed25519=auth_ed25519\n\n* In contrast, if the --plugin-load option is specified before the\n--plugin-load-add option, then it will work fine, because the\n--plugin-load-add option does not reset the plugin load list. For example, in\nthe following case, both plugins are properly loaded:\n\n[mariadb]\n...\nplugin_load = server_audit\nplugin_load_add = ed25519=auth_ed25519\n\nInstalling a Plugin with mysql_plugin\n-------------------------------------\n\nA plugin can be installed with the mysql_plugin utility if the server is\ncompletely offline.\n\nThe syntax is:\n\nmysql_plugin [options] <plugin> ENABLE|DISABLE\n\nFor example, to install the server_audit audit plugin, you could execute the\nfollowing:\n\nmysql_plugin server_audit ENABLE\n\nIf a plugin is installed with this utility, then a record will be added to the\nmysql.plugins table for the plugin. This means that the plugin will\nautomatically be loaded every time the server restarts, unless specifically\nuninstalled or deactivated.\n\nConfiguring the Plugin Directory\n--------------------------------\n\nWhen a plugin is being installed, the server looks for the plugin\'s library in\nthe server\'s plugin directory. This directory is configured by the plugin_dir\nsystem variable. This can be specified as a command-line argument to mysqld or\nit can be specified in a relevant server option group in an option file. For\nexample:\n\n[mariadb]\n...\nplugin_dir = /usr/lib64/mysql/plugin\n\nConfiguring the Minimum Plugin Maturity\n---------------------------------------\n\nWhen a plugin is being installed, the server compares the plugin\'s maturity\nlevel against the server\'s minimum allowed plugin maturity. This can help\nprevent users from using unstable plugins on production servers. This minimum\nplugin maturity is configured by the plugin_maturity system variable. This can\nbe specified as a command-line argument to mysqld or it can be specified in a\nrelevant server option group in an option file. For example:\n\n[mariadb]\n...\nplugin_maturity = stable\n\nConfiguring Plugin Activation at Server Startup\n-----------------------------------------------\n\nA plugin will be loaded by default when the server starts if:\n\n* The plugin was installed with the INSTALL SONAME statement.\n* The plugin was installed with the INSTALL PLUGIN statement.\n* The plugin was installed with the mysql_plugin utility.\n* The server is configured to load the plugin with the --plugin-load-add\noption.\n* The server is configured to load the plugin with the --plugin-load option.\n\nThis behavior can be changed with special options that take the form\n--plugin-name. For example, for the server_audit audit plugin, the special\noption is called --server-audit.\n\nThe possible values for these special options are:\n\n+----------------------------------------+------------------------------------+\n| Option Value | Description |\n+----------------------------------------+------------------------------------+\n| OFF | Disables the plugin without |\n| | removing it from the |\n| | mysql.plugins table. |\n+----------------------------------------+------------------------------------+\n| ON | Enables the plugin. If the plugin |\n| | cannot be initialized, then the |\n| | server will still continue |\n| | starting up, but the plugin will |\n| | be disabled. |\n+----------------------------------------+------------------------------------+\n| FORCE | Enables the plugin. If the plugin |\n| | cannot be initialized, then the |\n| | server will fail to start with an |\n| | error. |\n+----------------------------------------+------------------------------------+\n| FORCE_PLUS_PERMANENT | Enables the plugin. If the plugin |\n| | cannot be initialized, then the |\n| | server will fail to start with an |\n| | error. In addition, the plugin |\n| | cannot be uninstalled with |\n| | UNINSTALL SONAME or UNINSTALL |\n| | PLUGIN while the server is |\n| | running. |\n+----------------------------------------+------------------------------------+\n\nA plugin\'s status can be found by looking at the PLUGIN_STATUS column of the\ninformation_schema.PLUGINS table.\n\nUninstalling Plugins\n--------------------\n\nPlugins that are found in the mysql.plugin table, that is those that were\ninstalled with INSTALL SONAME, INSTALL PLUGIN or mysql_plugin can be\nuninstalled in one of two ways:\n\n* The UNINSTALL SONAME or the UNINSTALL PLUGIN statement while the server is\nrunning\n* With mysql_plugin while the server is offline.\n\nPlugins that were enabled as a --plugin-load option do not need to be\nuninstalled. If --plugin-load is omitted the next time the server starts, or\nthe plugin is not listed as one of the --plugin-load entries, the plugin will\nnot be loaded.\n\nUNINSTALL PLUGIN uninstalls a single installed plugin, while UNINSTALL SONAME\nuninstalls all plugins belonging to a given library.\n\n\n\nURL: mariadb.com/kb/en/plugin-overview/','','https://mariadb.com/kb/en/plugin-overview/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (79,5,'INSTALL PLUGIN','Syntax\n------\n\nINSTALL PLUGIN [IF NOT EXISTS] plugin_name SONAME \'plugin_library\'\n\nDescription\n-----------\n\nThis statement installs an individual plugin from the specified library. To\ninstall the whole library (which could be required), use INSTALL SONAME. See\nalso Installing a Plugin.\n\nplugin_name is the name of the plugin as defined in the plugin declaration\nstructure contained in the library file. Plugin names are not case sensitive.\nFor maximal compatibility, plugin names should be limited to ASCII letters,\ndigits, and underscore, because they are used in C source files, shell command\nlines, M4 and Bourne shell scripts, and SQL environments.\n\nplugin_library is the name of the shared library that contains the plugin\ncode. The file name extension can be omitted (which makes the statement look\nthe same on all architectures).\n\nThe shared library must be located in the plugin directory (that is, the\ndirectory named by the plugin_dir system variable). The library must be in the\nplugin directory itself, not in a subdirectory. By default, plugin_dir is\nplugin directory under the directory named by the pkglibdir configuration\nvariable, but it can be changed by setting the value of plugin_dir at server\nstartup. For example, set its value in a my.cnf file:\n\n[mysqld]\nplugin_dir=/path/to/plugin/directory\nIf the value of plugin_dir is a relative path name, it is taken to be relative\nto the MySQL base directory (the value of the basedir system variable).\n\nINSTALL PLUGIN adds a line to the mysql.plugin table that describes the\nplugin. This table contains the plugin name and library file name.\n\nINSTALL PLUGIN causes the server to read option (my.cnf) files just as during\nserver startup. This enables the plugin to pick up any relevant options from\nthose files. It is possible to add plugin options to an option file even\nbefore loading a plugin (if the loose prefix is used). It is also possible to\nuninstall a plugin, edit my.cnf, and install the plugin again. Restarting the\nplugin this way enables it to the new option values without a server restart.\n\nINSTALL PLUGIN also loads and initializes the plugin code to make the plugin\navailable for use. A plugin is initialized by executing its initialization\nfunction, which handles any setup that the plugin must perform before it can\nbe used.\n\nTo use INSTALL PLUGIN, you must have the INSERT privilege for the mysql.plugin\ntable.\n\nAt server startup, the server loads and initializes any plugin that is listed\nin the mysql.plugin table. This means that a plugin is installed with INSTALL\nPLUGIN only once, not every time the server starts. Plugin loading at startup\ndoes not occur if the server is started with the --skip-grant-tables option.\n\nWhen the server shuts down, it executes the de-initialization function for\neach plugin that is loaded so that the plugin has a chance to perform any\nfinal cleanup.\n\nIf you need to load plugins for a single server startup when the\n--skip-grant-tables option is given (which tells the server not to read system\ntables), use the --plugin-load mysqld option.\n\nMariaDB starting with 10.4.0\n----------------------------\n\nIF NOT EXISTS\n-------------\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a note instead of\nan error if the specified plugin already exists. See SHOW WARNINGS.\n\nExamples\n--------\n\nINSTALL PLUGIN sphinx SONAME \'ha_sphinx.so\';\n\nThe extension can also be omitted:\n\nINSTALL PLUGIN innodb SONAME \'ha_xtradb\';\n\nFrom MariaDB 10.4.0:\n\nINSTALL PLUGIN IF NOT EXISTS example SONAME \'ha_example\';\nQuery OK, 0 rows affected (0.104 sec)\n\nINSTALL PLUGIN IF NOT EXISTS example SONAME \'ha_example\';\nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------------------+\n| Level | Code | Message |\n+-------+------+------------------------------------+\n| Note | 1968 | Plugin \'example\' already installed |\n+-------+------+------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/install-plugin/','','https://mariadb.com/kb/en/install-plugin/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (80,5,'UNINSTALL PLUGIN','Syntax\n------\n\nUNINSTALL PLUGIN [IF EXISTS] plugin_name\n\nDescription\n-----------\n\nThis statement removes a single installed plugin. To uninstall the whole\nlibrary which contains the plugin, use UNINSTALL SONAME. You cannot uninstall\na plugin if any table that uses it is open.\n\nplugin_name must be the name of some plugin that is listed in the mysql.plugin\ntable. The server executes the plugin\'s deinitialization function and removes\nthe row for the plugin from the mysql.plugin table, so that subsequent server\nrestarts will not load and initialize the plugin. UNINSTALL PLUGIN does not\nremove the plugin\'s shared library file.\n\nTo use UNINSTALL PLUGIN, you must have the DELETE privilege for the\nmysql.plugin table.\n\nMariaDB starting with 10.4.0\n----------------------------\n\nIF EXISTS\n---------\n\nIf the IF EXISTS clause is used, MariaDB will return a note instead of an\nerror if the plugin does not exist. See SHOW WARNINGS.\n\nExamples\n--------\n\nUNINSTALL PLUGIN example;\n\nFrom MariaDB 10.4.0:\n\nUNINSTALL PLUGIN IF EXISTS example;\nQuery OK, 0 rows affected (0.099 sec)\n\nUNINSTALL PLUGIN IF EXISTS example;\nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+-------+------+-------------------------------+\n| Level | Code | Message |\n+-------+------+-------------------------------+\n| Note | 1305 | PLUGIN example does not exist |\n+-------+------+-------------------------------+\n\n\n\nURL: mariadb.com/kb/en/uninstall-plugin/','','https://mariadb.com/kb/en/uninstall-plugin/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (81,5,'INSTALL SONAME','Syntax\n------\n\nINSTALL SONAME \'plugin_library\'\n\nDescription\n-----------\n\nThis statement is a variant of INSTALL PLUGIN. It installs all plugins from a\ngiven plugin_library. See INSTALL PLUGIN for details.\n\nplugin_library is the name of the shared library that contains the plugin\ncode. The file name extension (for example, libmyplugin.so or libmyplugin.dll)\ncan be omitted (which makes the statement look the same on all architectures).\n\nThe shared library must be located in the plugin directory (that is, the\ndirectory named by the plugin_dir system variable). The library must be in the\nplugin directory itself, not in a subdirectory. By default, plugin_dir is\nplugin directory under the directory named by the pkglibdir configuration\nvariable, but it can be changed by setting the value of plugin_dir at server\nstartup. For example, set its value in a my.cnf file:\n\n[mysqld]\nplugin_dir=/path/to/plugin/directory\nIf the value of plugin_dir is a relative path name, it is taken to be relative\nto the MySQL base directory (the value of the basedir system variable).\n\nINSTALL SONAME adds one or more lines to the mysql.plugin table that describes\nthe plugin. This table contains the plugin name and library file name.\n\nINSTALL SONAME causes the server to read option (my.cnf) files just as during\nserver startup. This enables the plugin to pick up any relevant options from\nthose files. It is possible to add plugin options to an option file even\nbefore loading a plugin (if the loose prefix is used). It is also possible to\nuninstall a plugin, edit my.cnf, and install the plugin again. Restarting the\nplugin this way enables it to the new option values without a server restart.\n\nINSTALL SONAME also loads and initializes the plugin code to make the plugin\navailable for use. A plugin is initialized by executing its initialization\nfunction, which handles any setup that the plugin must perform before it can\nbe used.\n\nTo use INSTALL SONAME, you must have the INSERT privilege for the mysql.plugin\ntable.\n\nAt server startup, the server loads and initializes any plugin that is listed\nin the mysql.plugin table. This means that a plugin is installed with INSTALL\nSONAME only once, not every time the server starts. Plugin loading at startup\ndoes not occur if the server is started with the --skip-grant-tables option.\n\nWhen the server shuts down, it executes the de-initialization function for\neach plugin that is loaded so that the plugin has a chance to perform any\nfinal cleanup.\n\nIf you need to load plugins for a single server startup when the\n--skip-grant-tables option is given (which tells the server not to read system\ntables), use the --plugin-load mysqld option.\n\nIf you need to install only one plugin from a library, use the INSTALL PLUGIN\nstatement.\n\nExamples\n--------\n\nTo load the XtraDB storage engine and all of its information_schema tables\nwith one statement, use\n\nINSTALL SONAME \'ha_xtradb\';\n\nThis statement can be used instead of INSTALL PLUGIN even when the library\ncontains only one plugin:\n\nINSTALL SONAME \'ha_sequence\';\n\n\n\nURL: mariadb.com/kb/en/install-soname/','','https://mariadb.com/kb/en/install-soname/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (82,5,'UNINSTALL SONAME','Syntax\n------\n\nUNINSTALL SONAME [IF EXISTS] \'plugin_library\'\n\nDescription\n-----------\n\nThis statement is a variant of UNINSTALL PLUGIN statement, that removes all\nplugins belonging to a specified plugin_library. See UNINSTALL PLUGIN for\ndetails.\n\nplugin_library is the name of the shared library that contains the plugin\ncode. The file name extension (for example, libmyplugin.so or libmyplugin.dll)\ncan be omitted (which makes the statement look the same on all architectures).\n\nTo use UNINSTALL SONAME, you must have the DELETE privilege for the\nmysql.plugin table.\n\nMariaDB starting with 10.4.0\n----------------------------\n\nIF EXISTS\n---------\n\nIf the IF EXISTS clause is used, MariaDB will return a note instead of an\nerror if the plugin library does not exist. See SHOW WARNINGS.\n\nExamples\n--------\n\nTo uninstall the XtraDB plugin and all of its information_schema tables with\none statement, use\n\nUNINSTALL SONAME \'ha_xtradb\';\n\nFrom MariaDB 10.4.0:\n\nUNINSTALL SONAME IF EXISTS \'ha_example\';\nQuery OK, 0 rows affected (0.099 sec)\n\nUNINSTALL SONAME IF EXISTS \'ha_example\';\nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+-------+------+-------------------------------------+\n| Level | Code | Message |\n+-------+------+-------------------------------------+\n| Note | 1305 | SONAME ha_example.so does not exist |\n+-------+------+-------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/uninstall-soname/','','https://mariadb.com/kb/en/uninstall-soname/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (83,6,'MBR Definition','Description\n-----------\n\nThe MBR (Minimum Bounding Rectangle), or Envelope is the bounding geometry,\nformed by the minimum and maximum (X,Y) coordinates:\n\nExamples\n--------\n\n((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n\n\n\nURL: mariadb.com/kb/en/mbr-definition/','','https://mariadb.com/kb/en/mbr-definition/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (84,6,'MBRContains','Syntax\n------\n\nMBRContains(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangle of g1\ncontains the Minimum Bounding Rectangle of g2. This tests the opposite\nrelationship as MBRWithin().\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\n\nSET @g2 = GeomFromText(\'Point(1 1)\');\n\nSELECT MBRContains(@g1,@g2), MBRContains(@g2,@g1);\n+----------------------+----------------------+\n| MBRContains(@g1,@g2) | MBRContains(@g2,@g1) |\n+----------------------+----------------------+\n| 1 | 0 |\n+----------------------+----------------------+\n\n\n\nURL: mariadb.com/kb/en/mbrcontains/','','https://mariadb.com/kb/en/mbrcontains/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (85,6,'MBRDisjoint','Syntax\n------\n\nMBRDisjoint(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two\ngeometries g1 and g2 are disjoint. Two geometries are disjoint if they do not\nintersect, that is touch or overlap.\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECTmbrdisjoint(@g1,@g2);\n+----------------------+\n| mbrdisjoint(@g1,@g2) |\n+----------------------+\n| 1 |\n+----------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrdisjoint(@g1,@g2);\n+----------------------+\n| mbrdisjoint(@g1,@g2) |\n+----------------------+\n| 0 |\n+----------------------+\n\n\n\nURL: mariadb.com/kb/en/mbrdisjoint/','','https://mariadb.com/kb/en/mbrdisjoint/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (86,6,'MBREqual','Syntax\n------\n\nMBREqual(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two\ngeometries g1 and g2 are the same.\n\nExamples\n--------\n\nSET @g1=GEOMFROMTEXT(\'LINESTRING(0 0, 1 2)\');\nSET @g2=GEOMFROMTEXT(\'POLYGON((0 0, 0 2, 1 2, 1 0, 0 0))\');\nSELECT MbrEqual(@g1,@g2);\n+-------------------+\n| MbrEqual(@g1,@g2) |\n+-------------------+\n| 1 |\n+-------------------+\n\nSET @g1=GEOMFROMTEXT(\'LINESTRING(0 0, 1 3)\');\nSET @g2=GEOMFROMTEXT(\'POLYGON((0 0, 0 2, 1 4, 1 0, 0 0))\');\nSELECT MbrEqual(@g1,@g2);\n+-------------------+\n| MbrEqual(@g1,@g2) |\n+-------------------+\n| 0 |\n+-------------------+\n\n\n\nURL: mariadb.com/kb/en/mbrequal/','','https://mariadb.com/kb/en/mbrequal/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (87,6,'MBRIntersects','Syntax\n------\n\nMBRIntersects(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two\ngeometries g1 and g2 intersect.\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrintersects(@g1,@g2);\n+------------------------+\n| mbrintersects(@g1,@g2) |\n+------------------------+\n| 1 |\n+------------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECT mbrintersects(@g1,@g2);\n+------------------------+\n| mbrintersects(@g1,@g2) |\n+------------------------+\n| 0 |\n+------------------------+\n\n\n\nURL: mariadb.com/kb/en/mbrintersects/','','https://mariadb.com/kb/en/mbrintersects/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (88,6,'MBROverlaps','Syntax\n------\n\nMBROverlaps(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two\ngeometries g1 and g2 overlap. The term spatially overlaps is used if two\ngeometries intersect and their intersection results in a geometry of the same\ndimension but not equal to either of the given geometries.\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECT mbroverlaps(@g1,@g2);\n+----------------------+\n| mbroverlaps(@g1,@g2) |\n+----------------------+\n| 0 |\n+----------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbroverlaps(@g1,@g2);\n+----------------------+\n| mbroverlaps(@g1,@g2) |\n+----------------------+\n| 0 |\n+----------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 4,4 4,4 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbroverlaps(@g1,@g2);\n+----------------------+\n| mbroverlaps(@g1,@g2) |\n+----------------------+\n| 1 |\n+----------------------+\n\n\n\nURL: mariadb.com/kb/en/mbroverlaps/','','https://mariadb.com/kb/en/mbroverlaps/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (89,6,'MBRTouches','Syntax\n------\n\nMBRTouches(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangles of the two\ngeometries g1 and g2 touch. Two geometries spatially touch if the interiors of\nthe geometries do not intersect, but the boundary of one of the geometries\nintersects either the boundary or the interior of the other.\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((4 4,4 7,7 7,7 4,4 4))\');\nSELECT mbrtouches(@g1,@g2);\n+---------------------+\n| mbrtouches(@g1,@g2) |\n+---------------------+\n| 0 |\n+---------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrtouches(@g1,@g2);\n+---------------------+\n| mbrtouches(@g1,@g2) |\n+---------------------+\n| 1 |\n+---------------------+\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 4,4 4,4 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((3 3,3 6,6 6,6 3,3 3))\');\nSELECT mbrtouches(@g1,@g2);\n+---------------------+\n| mbrtouches(@g1,@g2) |\n+---------------------+\n| 0 |\n+---------------------+\n\n\n\nURL: mariadb.com/kb/en/mbrtouches/','','https://mariadb.com/kb/en/mbrtouches/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (90,6,'MBRWithin','Syntax\n------\n\nMBRWithin(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether the Minimum Bounding Rectangle of g1 is\nwithin the Minimum Bounding Rectangle of g2. This tests the opposite\nrelationship as MBRContains().\n\nExamples\n--------\n\nSET @g1 = GeomFromText(\'Polygon((0 0,0 3,3 3,3 0,0 0))\');\nSET @g2 = GeomFromText(\'Polygon((0 0,0 5,5 5,5 0,0 0))\');\nSELECT MBRWithin(@g1,@g2), MBRWithin(@g2,@g1);\n+--------------------+--------------------+\n| MBRWithin(@g1,@g2) | MBRWithin(@g2,@g1) |\n+--------------------+--------------------+\n| 1 | 0 |\n+--------------------+--------------------+\n\n\n\nURL: mariadb.com/kb/en/mbrwithin/','','https://mariadb.com/kb/en/mbrwithin/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (91,7,'CASE OPERATOR','Syntax\n------\n\nCASE value WHEN [compare_value] THEN result [WHEN [compare_value] THEN\nresult ...] [ELSE result] END\n\nCASE WHEN [condition] THEN result [WHEN [condition] THEN result ...]\n[ELSE result] END\n\nDescription\n-----------\n\nThe first version returns the result where value=compare_value. The second\nversion returns the result for the first condition that is true. If there was\nno matching result value, the result after ELSE is returned, or NULL if there\nis no ELSE part.\n\nThere is also a CASE statement, which differs from the CASE operator described\nhere.\n\nExamples\n--------\n\nSELECT CASE 1 WHEN 1 THEN \'one\' WHEN 2 THEN \'two\' ELSE \'more\' END;\n+------------------------------------------------------------+\n| CASE 1 WHEN 1 THEN \'one\' WHEN 2 THEN \'two\' ELSE \'more\' END |\n+------------------------------------------------------------+\n| one |\n+------------------------------------------------------------+\n\nSELECT CASE WHEN 1>0 THEN \'true\' ELSE \'false\' END;\n+--------------------------------------------+\n| CASE WHEN 1>0 THEN \'true\' ELSE \'false\' END |\n+--------------------------------------------+\n| true |\n+--------------------------------------------+\n\nSELECT CASE BINARY \'B\' WHEN \'a\' THEN 1 WHEN \'b\' THEN 2 END;\n+-----------------------------------------------------+\n| CASE BINARY \'B\' WHEN \'a\' THEN 1 WHEN \'b\' THEN 2 END |\n+-----------------------------------------------------+\n| NULL |\n+-----------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/case-operator/','','https://mariadb.com/kb/en/case-operator/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (92,7,'IF Function','Syntax\n------\n\nIF(expr1,expr2,expr3)\n\nDescription\n-----------\n\nIf expr1 is TRUE (expr1 <> 0 and expr1 <> NULL) then IF() returns expr2;\notherwise it returns expr3. IF() returns a numeric or string value, depending\non the context in which it is used.\n\nNote: There is also an IF statement which differs from the IF() function\ndescribed here.\n\nExamples\n--------\n\nSELECT IF(1>2,2,3);\n+-------------+\n| IF(1>2,2,3) |\n+-------------+\n| 3 |\n+-------------+\n\nSELECT IF(1<2,\'yes\',\'no\');\n+--------------------+\n| IF(1<2,\'yes\',\'no\') |\n+--------------------+\n| yes |\n+--------------------+\n\nSELECT IF(STRCMP(\'test\',\'test1\'),\'no\',\'yes\');\n+---------------------------------------+\n| IF(STRCMP(\'test\',\'test1\'),\'no\',\'yes\') |\n+---------------------------------------+\n| no |\n+---------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/if-function/','','https://mariadb.com/kb/en/if-function/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (93,7,'IFNULL','Syntax\n------\n\nIFNULL(expr1,expr2)\nNVL(expr1,expr2)\n\nDescription\n-----------\n\nIf expr1 is not NULL, IFNULL() returns expr1; otherwise it returns expr2.\nIFNULL() returns a numeric or string value, depending on the context in which\nit is used.\n\nFrom MariaDB 10.3, NVL() is an alias for IFNULL().\n\nExamples\n--------\n\nSELECT IFNULL(1,0); \n+-------------+\n| IFNULL(1,0) |\n+-------------+\n| 1 |\n+-------------+\n\nSELECT IFNULL(NULL,10);\n+-----------------+\n| IFNULL(NULL,10) |\n+-----------------+\n| 10 |\n+-----------------+\n\nSELECT IFNULL(1/0,10);\n+----------------+\n| IFNULL(1/0,10) |\n+----------------+\n| 10.0000 |\n+----------------+\n\nSELECT IFNULL(1/0,\'yes\');\n+-------------------+\n| IFNULL(1/0,\'yes\') |\n+-------------------+\n| yes |\n+-------------------+\n\n\n\nURL: mariadb.com/kb/en/ifnull/','','https://mariadb.com/kb/en/ifnull/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (94,7,'NULLIF','Syntax\n------\n\nNULLIF(expr1,expr2)\n\nDescription\n-----------\n\nReturns NULL if expr1 = expr2 is true, otherwise returns expr1. This is the\nsame as CASE WHEN expr1 = expr2 THEN NULL ELSE expr1 END.\n\nExamples\n--------\n\nSELECT NULLIF(1,1);\n+-------------+\n| NULLIF(1,1) |\n+-------------+\n| NULL |\n+-------------+\n\nSELECT NULLIF(1,2);\n+-------------+\n| NULLIF(1,2) |\n+-------------+\n| 1 |\n+-------------+\n\n\n\nURL: mariadb.com/kb/en/nullif/','','https://mariadb.com/kb/en/nullif/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (95,8,'CHANGE MASTER TO','The terms master and slave have historically been used in replication,\nbut the terms terms primary and replica are now preferred. The old terms are\nused still used in parts of the documentation, and in MariaDB commands,\nalthough MariaDB 10.5 has begun the process of renaming. The documentation\nprocess is ongoing. See MDEV-18777 to follow progress on this effort.\n\nSyntax\n------\n\nCHANGE MASTER [\'connection_name\'] TO master_def [, master_def] ... \n [FOR CHANNEL \'channel_name\']\n\nmaster_def:\n MASTER_BIND = \'interface_name\'\n | MASTER_HOST = \'host_name\'\n | MASTER_USER = \'user_name\'\n | MASTER_PASSWORD = \'password\'\n | MASTER_PORT = port_num\n | MASTER_CONNECT_RETRY = interval\n | MASTER_HEARTBEAT_PERIOD = interval\n | MASTER_LOG_FILE = \'master_log_name\'\n | MASTER_LOG_POS = master_log_pos\n | RELAY_LOG_FILE = \'relay_log_name\'\n | RELAY_LOG_POS = relay_log_pos\n | MASTER_DELAY = interval\n | MASTER_SSL = {0|1}\n | MASTER_SSL_CA = \'ca_file_name\'\n | MASTER_SSL_CAPATH = \'ca_directory_name\'\n | MASTER_SSL_CERT = \'cert_file_name\'\n | MASTER_SSL_CRL = \'crl_file_name\'\n | MASTER_SSL_CRLPATH = \'crl_directory_name\'\n | MASTER_SSL_KEY = \'key_file_name\'\n | MASTER_SSL_CIPHER = \'cipher_list\'\n | MASTER_SSL_VERIFY_SERVER_CERT = {0|1}\n | MASTER_USE_GTID = {current_pos|slave_pos|no}\n | IGNORE_SERVER_IDS = (server_id_list)\n | DO_DOMAIN_IDS = ([N,..])\n | IGNORE_DOMAIN_IDS = ([N,..])\n\nDescription\n-----------\n\nThe CHANGE MASTER statement sets the options that a replica uses to connect to\nand replicate from a primary.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nto using the channel_name directly after CHANGE MASTER.\n\nMulti-Source Replication\n------------------------\n\nIf you are using multi-source replication, then you need to specify a\nconnection name when you execute CHANGE MASTER. There are two ways to do this:\n\n* Setting the default_master_connection system variable prior to executing\nCHANGE MASTER.\n* Setting the connection_name parameter when executing CHANGE MASTER.\n\ndefault_master_connection\n-------------------------\n\nSET default_master_connection = \'gandalf\';\nSTOP SLAVE;\nCHANGE MASTER TO \n MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE;\n\nconnection_name\n---------------\n\nSTOP SLAVE \'gandalf\';\nCHANGE MASTER \'gandalf\' TO \n MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE \'gandalf\';\n\nOptions\n-------\n\nConnection Options\n------------------\n\nMASTER_USER\n-----------\n\nThe MASTER_USER option for CHANGE MASTER defines the user account that the\nreplica will use to connect to the primary.\n\nThis user account will need the REPLICATION SLAVE privilege (or, from MariaDB\n10.5.1, the REPLICATION REPLICA on the primary.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_USER=\'repl\',\n MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE;\n\nThe maximum length of the MASTER_USER string is 96 characters until MariaDB\n10.5, and 128 characters from MariaDB 10.6.\n\nMASTER_PASSWORD\n---------------\n\nThe MASTER_USER option for CHANGE MASTER defines the password that the replica\nwill use to connect to the primary as the user account defined by the\nMASTER_USER option.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE;\n\nThe maximum length of the MASTER_PASSWORD string is 32 characters.\n\nMASTER_HOST\n-----------\n\nThe MASTER_HOST option for CHANGE MASTER defines the hostname or IP address of\nthe primary.\n\nIf you set the value of the MASTER_HOST option to the empty string, then that\nis not the same as not setting the option\'s value at all. If you set the value\nof the MASTER_HOST option to the empty string, then the CHANGE MASTER command\nwill fail with an error. In MariaDB 5.3 and before, if you set the value of\nthe MASTER_HOST option to the empty string, then the CHANGE MASTER command\nwould succeed, but the subsequent START SLAVE command would fail.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_HOST=\'dbserver1.example.com\',\n MASTER_USER=\'repl\',\n MASTER_PASSWORD=\'new3cret\',\n MASTER_USE_GTID=slave_pos;\nSTART SLAVE;\n\nIf you set the value of the MASTER_HOST option in a CHANGE MASTER command,\nthen the replica assumes that the primary is different from before, even if\nyou set the value of this option to the same value it had previously. In this\nscenario, the replica will consider the old values for the primary\'s binary\nlog file name and position to be invalid for the new primary. As a side\neffect, if you do not explicitly set the values of the MASTER_LOG_FILE and\nMASTER_LOG_POS options in the statement, then the statement will be implicitly\nappended with MASTER_LOG_FILE=\'\' and MASTER_LOG_POS=4. However, if you enable\nGTID mode for replication by setting the MASTER_USE_GTID option to some value\nother than no in the statement, then these values will effectively be ignored\nanyway.\n\nReplicas cannot connect to primaries using Unix socket files or Windows named\npipes. The replica must connect to the primary using TCP/IP.\n\nThe maximum length of the MASTER_HOST string is 60 characters until MariaDB\n10.5, and 255 characters from MariaDB 10.6.\n\nMASTER_PORT\n-----------\n\nThe MASTER_PORT option for CHANGE MASTER defines the TCP/IP port of the\nprimary.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_HOST=\'dbserver1.example.com\',\n MASTER_PORT=3307,\n MASTER_USER=\'repl\',\n MASTER_PASSWORD=\'new3cret\',\n MASTER_USE_GTID=slave_pos;\nSTART SLAVE;\n\nIf you set the value of the MASTER_PORT option in a CHANGE MASTER command,\nthen the replica assumes that the primary is different from before, even if\nyou set the value of this option to the same value it had previously. In this\nscenario, the replica will consider the old values for the primary\'s binary\nlog file name and position to be invalid for the new primary. As a side\neffect, if you do not explicitly set the values of the MASTER_LOG_FILE and\nMASTER_LOG_POS options in the statement, then the statement will be implicitly\nappended with MASTER_LOG_FILE=\'\' and MASTER_LOG_POS=4. However, if you enable\nGTID mode for replication by setting the MASTER_USE_GTID option to some value\nother than no in the statement, then these values will effectively be ignored\nanyway.\n\nReplicas cannot connect to primaries using Unix socket files or Windows named\npipes. The replica must connect to the primary using TCP/IP.\n\nMASTER_CONNECT_RETRY\n--------------------\n\nThe MASTER_CONNECT_RETRY option for CHANGE MASTER defines how many seconds\nthat the replica will wait between connection retries. The default is 60.\n\nSTOP SLAVE;\nCHANGE MASTER TO \n MASTER_CONNECT_RETRY=20;\nSTART SLAVE;\n\nThe number of connection attempts is limited by the master_retry_count option.\nIt can be set either on the command-line or in a server option group in an\noption file prior to starting up the server. For example:\n\n[mariadb]\n...\nmaster_retry_count=4294967295\n\nMASTER_BIND\n-----------\n\nThe MASTER_BIND option for CHANGE MASTER is only supported by MySQL 5.6.2 and\nlater and by MySQL NDB Cluster 7.3.1 and later. This option is not supported\nby MariaDB. See MDEV-19248 for more information.\n\nThe MASTER_BIND option for CHANGE MASTER can be used on replicas that have\nmultiple network interfaces to choose which network interface the replica will\nuse to connect to the primary.\n\nMASTER_HEARTBEAT_PERIOD\n-----------------------\n\nThe MASTER_HEARTBEAT_PERIOD option for CHANGE MASTER can be used to set the\ninterval in seconds between replication heartbeats. Whenever the primary\'s\nbinary log is updated with an event, the waiting period for the next heartbeat\nis reset.\n\nThis option\'s interval argument has the following characteristics:\n\n* It is a decimal value with a range of 0 to 4294967 seconds.\n* It has a resolution of hundredths of a second.\n* Its smallest valid non-zero value is 0.001.\n* Its default value is the value of the slave_net_timeout system variable\ndivided by 2.\n* If it\'s set to 0, then heartbeats are disabled.\n\nHeartbeats are sent by the primary only if there are no unsent events in the\nbinary log file for a period longer than the interval.\n\nIf the RESET SLAVE statement is executed, then the heartbeat interval is reset\nto the default.\n\nIf the slave_net_timeout system variable is set to a value that is lower than\nthe current heartbeat interval, then a warning will be issued.\n\nTLS Options\n-----------\n\nThe TLS options are used for providing information about TLS. The options can\nbe set even on replicas that are compiled without TLS support. The TLS options\nare saved to either the default master.info file or the file that is\nconfigured by the master_info_file option, but these TLS options are ignored\nunless the replica supports TLS.\n\nSee Replication with Secure Connections for more information.\n\nMASTER_SSL\n----------\n\nThe MASTER_SSL option for CHANGE MASTER tells the replica whether to force TLS\nfor the connection. The valid values are 0 or 1.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL=1;\nSTART SLAVE;\n\nMASTER_SSL_CA\n-------------\n\nThe MASTER_SSL_CA option for CHANGE MASTER defines a path to a PEM file that\nshould contain one or more X509 certificates for trusted Certificate\nAuthorities (CAs) to use for TLS. This option requires that you use the\nabsolute path, not a relative path. This option implies the MASTER_SSL option.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\nSTART SLAVE;\n\nSee Secure Connections Overview: Certificate Authorities (CAs) for more\ninformation.\n\nThe maximum length of MASTER_SSL_CA string is 511 characters.\n\nMASTER_SSL_CAPATH\n-----------------\n\nThe MASTER_SSL_CAPATH option for CHANGE MASTER defines a path to a directory\nthat contains one or more PEM files that should each contain one X509\ncertificate for a trusted Certificate Authority (CA) to use for TLS. This\noption requires that you use the absolute path, not a relative path. The\ndirectory specified by this option needs to be run through the openssl rehash\ncommand. This option implies the MASTER_SSL option.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CAPATH=\'/etc/my.cnf.d/certificates/ca/\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\nSTART SLAVE;\n\nSee Secure Connections Overview: Certificate Authorities (CAs) for more\ninformation.\n\nThe maximum length of MASTER_SSL_CA_PATH string is 511 characters.\n\nMASTER_SSL_CERT\n---------------\n\nThe MASTER_SSL_CERT option for CHANGE MASTER defines a path to the X509\ncertificate file to use for TLS. This option requires that you use the\nabsolute path, not a relative path. This option implies the MASTER_SSL option.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\nSTART SLAVE;\n\nThe maximum length of MASTER_SSL_CERT string is 511 characters.\n\nMASTER_SSL_CRL\n--------------\n\nThe MASTER_SSL_CRL option for CHANGE MASTER defines a path to a PEM file that\nshould contain one or more revoked X509 certificates to use for TLS. This\noption requires that you use the absolute path, not a relative path.\n\nThis option is only supported if the server was built with OpenSSL. If the\nserver was built with yaSSL, then this option is not supported. See TLS and\nCryptography Libraries Used by MariaDB for more information about which\nlibraries are used on which platforms.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1,\n MASTER_SSL_CRL=\'/etc/my.cnf.d/certificates/crl.pem\';\nSTART SLAVE;\n\nSee Secure Connections Overview: Certificate Revocation Lists (CRLs) for more\ninformation.\n\nThe maximum length of MASTER_SSL_CRL string is 511 characters.\n\nMASTER_SSL_CRLPATH\n------------------\n\nThe MASTER_SSL_CRLPATH option for CHANGE MASTER defines a path to a directory\nthat contains one or more PEM files that should each contain one revoked X509\ncertificate to use for TLS. This option requires that you use the absolute\npath, not a relative path. The directory specified by this variable needs to\nbe run through the openssl rehash command.\n\nThis option is only supported if the server was built with OpenSSL. If the\nserver was built with yaSSL, then this option is not supported. See TLS and\nCryptography Libraries Used by MariaDB for more information about which\nlibraries are used on which platforms.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1,\n MASTER_SSL_CRLPATH=\'/etc/my.cnf.d/certificates/crl/\';\nSTART SLAVE;\n\nSee Secure Connections Overview: Certificate Revocation Lists (CRLs) for more\ninformation.\n\nThe maximum length of MASTER_SSL_CRL_PATH string is 511 characters.\n\nMASTER_SSL_KEY\n--------------\n\nThe MASTER_SSL_KEY option for CHANGE MASTER defines a path to a private key\nfile to use for TLS. This option requires that you use the absolute path, not\na relative path. This option implies the MASTER_SSL option.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\nSTART SLAVE;\n\nThe maximum length of MASTER_SSL_KEY string is 511 characters.\n\nMASTER_SSL_CIPHER\n-----------------\n\nThe MASTER_SSL_CIPHER option for CHANGE MASTER defines the list of permitted\nciphers or cipher suites to use for TLS. Besides cipher names, if MariaDB was\ncompiled with OpenSSL, this option could be set to "SSLv3" or "TLSv1.2" to\nallow all SSLv3 or all TLSv1.2 ciphers. Note that the TLSv1.3 ciphers cannot\nbe excluded when using OpenSSL, even by using this option. See Using TLSv1.3\nfor details. This option implies the MASTER_SSL option.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1,\n MASTER_SSL_CIPHER=\'TLSv1.2\';\nSTART SLAVE;\n\nThe maximum length of MASTER_SSL_CIPHER string is 511 characters.\n\nMASTER_SSL_VERIFY_SERVER_CERT\n-----------------------------\n\nThe MASTER_SSL_VERIFY_SERVER_CERT option for CHANGE MASTER enables server\ncertificate verification. This option is disabled by default.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_SSL_CERT=\'/etc/my.cnf.d/certificates/server-cert.pem\',\n MASTER_SSL_KEY=\'/etc/my.cnf.d/certificates/server-key.pem\',\n MASTER_SSL_CA=\'/etc/my.cnf.d/certificates/ca.pem\',\n MASTER_SSL_VERIFY_SERVER_CERT=1;\nSTART SLAVE;\n\nSee Secure Connections Overview: Server Certificate Verification for more\ninformation.\n\nBinary Log Options\n------------------\n\nThese options are related to the binary log position on the primary.\n\nMASTER_LOG_FILE\n---------------\n\nThe MASTER_LOG_FILE option for CHANGE MASTER can be used along with\nMASTER_LOG_POS to specify the coordinates at which the replica\'s I/O thread\nshould begin reading from the primary\'s binary logs the next time the thread\nstarts.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4;\nSTART SLAVE;\n\nThe MASTER_LOG_FILE and MASTER_LOG_POS options cannot be specified if the\nRELAY_LOG_FILE and RELAY_LOG_POS options were also specified.\n\nThe MASTER_LOG_FILE and MASTER_LOG_POS options are effectively ignored if you\nenable GTID mode for replication by setting the MASTER_USE_GTID option to some\nvalue other than no in the statement.\n\nMASTER_LOG_POS\n--------------\n\nThe MASTER_LOG_POS option for CHANGE MASTER can be used along with\nMASTER_LOG_FILE to specify the coordinates at which the replica\'s I/O thread\nshould begin reading from the primary\'s binary logs the next time the thread\nstarts.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4;\nSTART SLAVE;\n\nThe MASTER_LOG_FILE and MASTER_LOG_POS options cannot be specified if the\nRELAY_LOG_FILE and RELAY_LOG_POS options were also specified.\n\nThe MASTER_LOG_FILE and MASTER_LOG_POS options are effectively ignored if you\nenable GTID mode for replication by setting the MASTER_USE_GTID option to some\nvalue other than no in the statement.\n\nRelay Log Options\n-----------------\n\nThese options are related to the relay log position on the replica.\n\nRELAY_LOG_FILE\n--------------\n\nThe RELAY_LOG_FILE option for CHANGE MASTER can be used along with the\nRELAY_LOG_POS option to specify the coordinates at which the replica\'s SQL\nthread should begin reading from the relay log the next time the thread starts.\n\nThe CHANGE MASTER statement usually deletes all relay log files. However, if\nthe RELAY_LOG_FILE and/or RELAY_LOG_POS options are specified, then existing\nrelay log files are kept.\n\nWhen you want to change the relay log position, you only need to stop the\nreplica\'s SQL thread. The replica\'s I/O thread can continue running. The STOP\nSLAVE and START SLAVE statements support the SQL_THREAD option for this\nscenario. For example:\n\nSTOP SLAVE SQL_THREAD;\nCHANGE MASTER TO\n RELAY_LOG_FILE=\'slave-relay-bin.006\',\n RELAY_LOG_POS=4025;\nSTART SLAVE SQL_THREAD;\n\nWhen the value of this option is changed, the metadata about the replica\'s SQL\nthread\'s position in the relay logs will also be changed in the relay-log.info\nfile or the file that is configured by the relay_log_info_file system variable.\n\nThe RELAY_LOG_FILE and RELAY_LOG_POS options cannot be specified if the\nMASTER_LOG_FILE and MASTER_LOG_POS options were also specified.\n\nRELAY_LOG_POS\n-------------\n\nThe RELAY_LOG_POS option for CHANGE MASTER can be used along with the\nRELAY_LOG_FILE option to specify the coordinates at which the replica\'s SQL\nthread should begin reading from the relay log the next time the thread starts.\n\nThe CHANGE MASTER statement usually deletes all relay log files. However, if\nthe RELAY_LOG_FILE and/or RELAY_LOG_POS options are specified, then existing\nrelay log files are kept.\n\nWhen you want to change the relay log position, you only need to stop the\nreplica\'s SQL thread. The replica\'s I/O thread can continue running. The STOP\nSLAVE and START SLAVE statements support the SQL_THREAD option for this\nscenario. For example:\n\nSTOP SLAVE SQL_THREAD;\nCHANGE MASTER TO\n RELAY_LOG_FILE=\'slave-relay-bin.006\',\n RELAY_LOG_POS=4025;\nSTART SLAVE SQL_THREAD;\n\nWhen the value of this option is changed, the metadata about the replica\'s SQL\nthread\'s position in the relay logs will also be changed in the relay-log.info\nfile or the file that is configured by the relay_log_info_file system variable.\n\nThe RELAY_LOG_FILE and RELAY_LOG_POS options cannot be specified if the\nMASTER_LOG_FILE and MASTER_LOG_POS options were also specified.\n\nGTID Options\n------------\n\nMASTER_USE_GTID\n---------------\n\nThe MASTER_USE_GTID option for CHANGE MASTER can be used to configure the\nreplica to use the global transaction ID (GTID) when connecting to a primary.\nThe possible values are:\n\n* current_pos - Replicate in GTID mode and use gtid_current_pos as the\nposition to start downloading transactions from the primary.\n* slave_pos - Replicate in GTID mode and use gtid_slave_pos as the position to\nstart downloading transactions from the primary. From MariaDB 10.5.1,\nreplica_pos is an alias for slave_pos.\n* no - Don\'t replicate in GTID mode.\n\nFor example:\n\nSTOP SLAVE;\nCHANGE MASTER TO\n MASTER_USE_GTID = current_pos;\nSTART SLAVE;\n\nOr:\n\nSTOP SLAVE;\nSET GLOBAL gtid_slave_pos=\'0-1-153\';\nCHANGE MASTER TO\n MASTER_USE_GTID = slave_pos;\nSTART SLAVE;\n\nReplication Filter Options\n--------------------------\n\nAlso see Replication filters.\n\nIGNORE_SERVER_IDS\n-----------------\n\nThe IGNORE_SERVER_IDS option for CHANGE MASTER can be used to configure a\nreplica to ignore binary log events that originated from certain servers.\nFiltered binary log events will not get logged to the replica’s relay log, and\nthey will not be applied by the replica.\n\nThe option\'s value can be specified by providing a comma-separated list of\nserver_id values. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n IGNORE_SERVER_IDS = (3,5);\nSTART SLAVE;\n\nIf you would like to clear a previously set list, then you can set the value\nto an empty list. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n IGNORE_SERVER_IDS = ();\nSTART SLAVE;\n\nDO_DOMAIN_IDS\n-------------\n\nThe DO_DOMAIN_IDS option for CHANGE MASTER can be used to configure a replica\nto only apply binary log events if the transaction\'s GTID is in a specific\ngtid_domain_id value. Filtered binary log events will not get logged to the\nreplica’s relay log, and they will not be applied by the replica.\n\nThe option\'s value can be specified by providing a comma-separated list of\ngtid_domain_id values. Duplicate values are automatically ignored. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n DO_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n\nIf you would like to clear a previously set list, then you can set the value\nto an empty list. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n DO_DOMAIN_IDS = ();\nSTART SLAVE;\n\nThe DO_DOMAIN_IDS option and the IGNORE_DOMAIN_IDS option cannot both be set\nto non-empty values at the same time. If you want to set the DO_DOMAIN_IDS\noption, and the IGNORE_DOMAIN_IDS option was previously set, then you need to\nclear the value of the IGNORE_DOMAIN_IDS option. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n IGNORE_DOMAIN_IDS = (),\n DO_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n\nThe DO_DOMAIN_IDS option can only be specified if the replica is replicating\nin GTID mode. Therefore, the MASTER_USE_GTID option must also be set to some\nvalue other than no in order to use this option.\n\nIGNORE_DOMAIN_IDS\n-----------------\n\nThe IGNORE_DOMAIN_IDS option for CHANGE MASTER can be used to configure a\nreplica to ignore binary log events if the transaction\'s GTID is in a specific\ngtid_domain_id value. Filtered binary log events will not get logged to the\nreplica’s relay log, and they will not be applied by the replica.\n\nThe option\'s value can be specified by providing a comma-separated list of\ngtid_domain_id values. Duplicate values are automatically ignored. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n IGNORE_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n\nIf you would like to clear a previously set list, then you can set the value\nto an empty list. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n IGNORE_DOMAIN_IDS = ();\nSTART SLAVE;\n\nThe DO_DOMAIN_IDS option and the IGNORE_DOMAIN_IDS option cannot both be set\nto non-empty values at the same time. If you want to set the IGNORE_DOMAIN_IDS\noption, and the DO_DOMAIN_IDS option was previously set, then you need to\nclear the value of the DO_DOMAIN_IDS option. For example:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n DO_DOMAIN_IDS = (),\n IGNORE_DOMAIN_IDS = (1,2);\nSTART SLAVE;\n\nThe IGNORE_DOMAIN_IDS option can only be specified if the replica is\nreplicating in GTID mode. Therefore, the MASTER_USE_GTID option must also be\nset to some value other than no in order to use this option.\n\nDelayed Replication Options\n---------------------------\n\nMASTER_DELAY\n------------\n\nMariaDB starting with 10.2.3\n----------------------------\nThe MASTER_DELAY option for CHANGE MASTER was first added in MariaDB 10.2.3 to\nenable delayed replication.\n\nThe MASTER_DELAY option for CHANGE MASTER can be used to enable delayed\nreplication. This option specifies the time in seconds (at least) that a\nreplica should lag behind the primary up to a maximum value of 2147483647, or\nabout 68 years. Before executing an event, the replica will first wait, if\nnecessary, until the given time has passed since the event was created on the\nprimary. The result is that the replica will reflect the state of the primary\nsome time back in the past. The default is zero, no delay.\n\nSTOP SLAVE;\nCHANGE MASTER TO \n MASTER_DELAY=3600;\nSTART SLAVE;\n\nChanging Option Values\n----------------------\n\nIf you don\'t specify a given option when executing the CHANGE MASTER\nstatement, then the option keeps its old value in most cases. Most of the\ntime, there is no need to specify the options that do not need to change. For\nexample, if the password for the user account that the replica uses to connect\nto its primary has changed, but no other options need to change, then you can\njust change the MASTER_PASSWORD option by executing the following commands:\n\nSTOP SLAVE;\nCHANGE MASTER TO \n MASTER_PASSWORD=\'new3cret\';\nSTART SLAVE;\n\nThere are some cases where options are implicitly reset, such as when the\nMASTER_HOST and MASTER_PORT options are changed.\n\nOption Persistence\n------------------\n\nThe values of the MASTER_LOG_FILE and MASTER_LOG_POS options (i.e. the binary\nlog position on the primary) and most other options are written to either the\ndefault master.info file or the file that is configured by the\nmaster_info_file option. The replica\'s I/O thread keeps this binary log\nposition updated as it downloads events only when MASTER_USE_GTID option is\nset to NO. Otherwise the file is not updated on a per event basis.\n\nThe master_info_file option can be set either on the command-line or in a\nserver option group in an option file prior to starting up the server. For\nexample:\n\n[mariadb]\n...\nmaster_info_file=/mariadb/myserver1-master.info\n\nThe values of the RELAY_LOG_FILE and RELAY_LOG_POS options (i.e. the relay log\nposition) are written to either the default relay-log.info file or the file\nthat is configured by the relay_log_info_file system variable. The replica\'s\nSQL thread keeps this relay log position updated as it applies events.\n\nThe relay_log_info_file system variable can be set either on the command-line\nor in a server option group in an option file prior to starting up the server.\nFor example:\n\n[mariadb]\n...\nrelay_log_info_file=/mariadb/myserver1-relay-log.info\n\nGTID Persistence\n----------------\n\nIf the replica is replicating binary log events that contain GTIDs, then the\nreplica\'s SQL thread will write every GTID that it applies to the\nmysql.gtid_slave_pos table. This GTID can be inspected and modified through\nthe gtid_slave_pos system variable.\n\nIf the replica has the log_slave_updates system variable enabled and if the\nreplica has the binary log enabled, then every write by the replica\'s SQL\nthread will also go into the replica\'s binary log. This means that GTIDs of\nreplicated transactions would be reflected in the value of the gtid_binlog_pos\nsystem variable.\n\nCreating a Replica from a Backup\n--------------------------------\n\nThe CHANGE MASTER statement is useful for setting up a replica when you have a\nbackup of the primary and you also have the binary log position or GTID\nposition corresponding to the backup.\n\nAfter restoring the backup on the replica, you could execute something like\nthis to use the binary log position:\n\nCHANGE MASTER TO\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4;\nSTART SLAVE;\n\nOr you could execute something like this to use the GTID position:\n\nSET GLOBAL gtid_slave_pos=\'0-1-153\';\nCHANGE MASTER TO\n MASTER_USE_GTID=slave_pos;\nSTART SLAVE;\n\nSee Setting up a Replication Slave with Mariabackup for more information on\nhow to do this with Mariabackup.\n\nExample\n-------\n\nThe following example changes the primary and primary\'s binary log\ncoordinates. This is used when you want to set up the replica to replicate the\nprimary:\n\nCHANGE MASTER TO\n MASTER_HOST=\'master2.mycompany.com\',\n MASTER_USER=\'replication\',\n MASTER_PASSWORD=\'bigs3cret\',\n MASTER_PORT=3306,\n MASTER_LOG_FILE=\'master2-bin.001\',\n MASTER_LOG_POS=4,\n MASTER_CONNECT_RETRY=10;\nSTART SLAVE;\n\n\n\nURL: mariadb.com/kb/en/change-master-to/','','https://mariadb.com/kb/en/change-master-to/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (96,8,'COMMIT','The COMMIT statement ends a transaction, saving any changes to the\ndata so that they become visible to subsequent transactions. Also, unlocks\nmetadata changed by current transaction. If autocommit is set to 1, an\nimplicit commit is performed after each statement. Otherwise, all transactions\nwhich don\'t end with an explicit COMMIT are implicitly rollbacked and the\nchanges are lost. The ROLLBACK statement can be used to do this explicitly.\n\nThe required syntax for the COMMIT statement is as follows:\n\nCOMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\n\nCOMMIT is the more important transaction terminator, as well as the more\ninteresting one. The basic form of the COMMIT statement is simply the keyword\nCOMMIT (the keyword WORK is simply noise and can be omitted without changing\nthe effect).\n\nThe optional AND CHAIN clause is a convenience for initiating a new\ntransaction as soon as the old transaction terminates. If AND CHAIN is\nspecified, then there is effectively nothing between the old and new\ntransactions, although they remain separate. The characteristics of the new\ntransaction will be the same as the characteristics of the old one — that is,\nthe new transaction will have the same access mode, isolation level and\ndiagnostics area size (we\'ll discuss all of these shortly) as the transaction\njust terminated.\n\nRELEASE tells the server to disconnect the client immediately after the\ncurrent transaction.\n\nThere are NO RELEASE and AND NO CHAIN options. By default, commits do not\nRELEASE or CHAIN, but it\'s possible to change this default behavior with the\ncompletion_type server system variable. In this case, the AND NO CHAIN and NO\nRELEASE options override the server default.\n\n\n\nURL: mariadb.com/kb/en/commit/','','https://mariadb.com/kb/en/commit/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (97,8,'DEALLOCATE / DROP PREPARE','Syntax\n------\n\n{DEALLOCATE | DROP} PREPARE stmt_name\n\nDescription\n-----------\n\nTo deallocate a prepared statement produced with PREPARE, use a DEALLOCATE\nPREPARE statement that refers to the prepared statement name.\n\nA prepared statement is implicitly deallocated when a new PREPARE command is\nissued. In that case, there is no need to use DEALLOCATE.\n\nAttempting to execute a prepared statement after deallocating it results in an\nerror, as if it was not prepared at all:\n\nERROR 1243 (HY000): Unknown prepared statement handler (stmt_name) given to\nEXECUTE\n\nIf the specified statement has not been PREPAREd, an error similar to the\nfollowing will be produced:\n\nERROR 1243 (HY000): Unknown prepared statement handler (stmt_name) given to\nDEALLOCATE PREPARE\n\nExample\n-------\n\nSee example in PREPARE.\n\n\n\nURL: mariadb.com/kb/en/deallocate-drop-prepared-statement/','','https://mariadb.com/kb/en/deallocate-drop-prepared-statement/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (98,8,'EXECUTE Statement','Syntax\n------\n\nEXECUTE stmt_name\n [USING expression[, expression] ...]\n\nMariaDB starting with 10.2.3\n----------------------------\nEXECUTE with expression as parameters was introduced in MariaDB 10.2.3. Before\nthat one could only use variables (@var_name) as parameters.\n\nDescription\n-----------\n\nAfter preparing a statement with PREPARE, you execute it with an EXECUTE\nstatement that refers to the prepared statement name. If the prepared\nstatement contains any parameter markers, you must supply a USING clause that\nlists user variables containing the values to be bound to the parameters.\nParameter values can be supplied only by user variables, and the USING clause\nmust name exactly as many variables as the number of parameter markers in the\nstatement.\n\nYou can execute a given prepared statement multiple times, passing different\nvariables to it or setting the variables to different values before each\nexecution.\n\nIf the specified statement has not been PREPAREd, an error similar to the\nfollowing is produced:\n\nERROR 1243 (HY000): Unknown prepared statement handler (stmt_name) given to\nEXECUTE\n\nExample\n-------\n\nSee example in PREPARE.\n\n\n\nURL: mariadb.com/kb/en/execute-statement/','','https://mariadb.com/kb/en/execute-statement/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (99,8,'EXECUTE IMMEDIATE','MariaDB starting with 10.2.3\n----------------------------\nEXECUTE IMMEDIATE was introduced in MariaDB 10.2.3.\n\nSyntax\n------\n\nEXECUTE IMMEDIATE statement\n\nDescription\n-----------\n\nEXECUTE IMMEDIATE executes a dynamic SQL statement created on the fly, which\ncan reduce performance overhead.\n\nFor example:\n\nEXECUTE IMMEDIATE \'SELECT 1\'\n\nwhich is shorthand for:\n\nprepare stmt from "select 1";\nexecute stmt;\ndeallocate prepare stmt;\n\nEXECUTE IMMEDIATE supports complex expressions as prepare source and\nparameters:\n\nEXECUTE IMMEDIATE CONCAT(\'SELECT COUNT(*) FROM \', \'t1\', \' WHERE a=?\') USING\n5+5;\n\nLimitations: subselects and stored function calls are not supported as a\nprepare source.\n\nThe following examples return an error:\n\nCREATE OR REPLACE FUNCTION f1() RETURNS VARCHAR(64) RETURN \'SELECT * FROM t1\';\nEXECUTE IMMEDIATE f1();\nERROR 1970 (42000): EXECUTE IMMEDIATE does not support subqueries or stored\nfunctions\n\nEXECUTE IMMEDIATE (SELECT \'SELECT * FROM t1\');\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual\nthat \n corresponds to your MariaDB server version for the right syntax to use near\n \'SELECT \'SELECT * FROM t1\')\' at line 1\n\nCREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN 10;\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING f1();\nERROR 1970 (42000): EXECUTE..USING does not support subqueries or stored\nfunctions\n\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING (SELECT 10);\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual\nthat \n corresponds to your MariaDB server version for the right syntax to use near\n \'SELECT 10)\' at line 1\n\nOne can use a user or an SP variable as a workaround:\n\nCREATE OR REPLACE FUNCTION f1() RETURNS VARCHAR(64) RETURN \'SELECT * FROM t1\';\nSET @stmt=f1();\nEXECUTE IMMEDIATE @stmt;\n\nSET @stmt=(SELECT \'SELECT 1\');\nEXECUTE IMMEDIATE @stmt;\n\nCREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN 10;\nSET @param=f1();\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING @param;\n\nSET @param=(SELECT 10);\nEXECUTE IMMEDIATE \'SELECT * FROM t1 WHERE a=?\' USING @param;\n\nEXECUTE IMMEDIATE supports user variables and SP variables as OUT parameters\n\nDELIMITER $$\nCREATE OR REPLACE PROCEDURE p1(OUT a INT)\nBEGIN\n SET a:= 10;\nEND;\n$$\nDELIMITER ;\nSET @a=2;\nEXECUTE IMMEDIATE \'CALL p1(?)\' USING @a;\nSELECT @a;\n+------+\n| @a |\n+------+\n| 10 |\n+------+\n\nSimilar to PREPARE, EXECUTE IMMEDIATE is allowed in stored procedures but is\nnot allowed in stored functions.\n\nThis example uses EXECUTE IMMEDIATE inside a stored procedure:\n\nDELIMITER $$\nCREATE OR REPLACE PROCEDURE p1()\nBEGIN\n EXECUTE IMMEDIATE \'SELECT 1\';\nEND;\n$$\nDELIMITER ;\nCALL p1;\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n\nThis script returns an error:\n\nDELIMITER $$\nCREATE FUNCTION f1() RETURNS INT\nBEGIN\n EXECUTE IMMEDIATE \'DO 1\';\n RETURN 1;\nEND;\n$$\nERROR 1336 (0A000): Dynamic SQL is not allowed in stored function or trigger\n\nEXECUTE IMMEDIATE can use DEFAULT and IGNORE indicators as bind parameters:\n\nCREATE OR REPLACE TABLE t1 (a INT DEFAULT 10);\nEXECUTE IMMEDIATE \'INSERT INTO t1 VALUES (?)\' USING DEFAULT;\nSELECT * FROM t1;\n+------+\n| a |\n+------+\n| 10 |\n+------+\n\nEXECUTE IMMEDIATE increments the Com_execute_immediate status variable, as\nwell as the Com_stmt_prepare, Com_stmt_execute and Com_stmt_close status\nvariables.\n\nNote, EXECUTE IMMEDIATE does not increment the Com_execute_sql status\nvariable. Com_execute_sql is used only for PREPARE..EXECUTE.\n\nThis session screenshot demonstrates how EXECUTE IMMEDIATE affects status\nvariables:\n\nSELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME RLIKE \n (\'COM_(EXECUTE|STMT_PREPARE|STMT_EXECUTE|STMT_CLOSE)\');\n\n+-----------------------+----------------+\n| VARIABLE_NAME | VARIABLE_VALUE |\n+-----------------------+----------------+\n| COM_EXECUTE_IMMEDIATE | 0 |\n| COM_EXECUTE_SQL | 0 |\n| COM_STMT_CLOSE | 0 |\n| COM_STMT_EXECUTE | 0 |\n| COM_STMT_PREPARE | 0 |\n+-----------------------+----------------+\n\nEXECUTE IMMEDIATE \'SELECT 1\';\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n\nSELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME RLIKE \n (\'COM_(EXECUTE|STMT_PREPARE|STMT_EXECUTE|STMT_CLOSE)\');\n+-----------------------+----------------+\n| VARIABLE_NAME | VARIABLE_VALUE |\n+-----------------------+----------------+\n| COM_EXECUTE_IMMEDIATE | 1 |\n| COM_EXECUTE_SQL | 0 |\n| COM_STMT_CLOSE | 1 |\n| COM_STMT_EXECUTE | 1 |\n| COM_STMT_PREPARE | 1 |\n+-----------------------+----------------+\n\n\n\nURL: mariadb.com/kb/en/execute-immediate/','','https://mariadb.com/kb/en/execute-immediate/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (100,8,'LOCK TABLES','Syntax\n------\n\nLOCK TABLE[S]\n tbl_name [[AS] alias] lock_type\n [, tbl_name [[AS] alias] lock_type] ...\n [WAIT n|NOWAIT]\n\nlock_type:\n READ [LOCAL]\n | [LOW_PRIORITY] WRITE\n | WRITE CONCURRENT\n\nUNLOCK TABLES\n\nDescription\n-----------\n\nThe lock_type can be one of:\n\n+---------------------------+-------------------------------------------------+\n| Option | Description |\n+---------------------------+-------------------------------------------------+\n| READ | Read lock, no writes allowed |\n+---------------------------+-------------------------------------------------+\n| READ LOCAL | Read lock, but allow concurrent inserts |\n+---------------------------+-------------------------------------------------+\n| WRITE | Exclusive write lock. No other connections can |\n| | read or write to this table |\n+---------------------------+-------------------------------------------------+\n| LOW_PRIORITY WRITE | Exclusive write lock, but allow new read locks |\n| | on the table until we get the write lock. |\n+---------------------------+-------------------------------------------------+\n| WRITE CONCURRENT | Exclusive write lock, but allow READ LOCAL |\n| | locks to the table. |\n+---------------------------+-------------------------------------------------+\n\nMariaDB enables client sessions to acquire table locks explicitly for the\npurpose of cooperating with other sessions for access to tables, or to prevent\nother sessions from modifying tables during periods when a session requires\nexclusive access to them. A session can acquire or release locks only for\nitself. One session cannot acquire locks for another session or release locks\nheld by another session.\n\nLocks may be used to emulate transactions or to get more speed when updating\ntables.\n\nLOCK TABLES explicitly acquires table locks for the current client session.\nTable locks can be acquired for base tables or views. To use LOCK TABLES, you\nmust have the LOCK TABLES privilege, and the SELECT privilege for each object\nto be locked. See GRANT\n\nFor view locking, LOCK TABLES adds all base tables used in the view to the set\nof tables to be locked and locks them automatically. If you lock a table\nexplicitly with LOCK TABLES, any tables used in triggers are also locked\nimplicitly, as described in Triggers and Implicit Locks.\n\nUNLOCK TABLES explicitly releases any table locks held by the current session.\n\nMariaDB starting with 10.3.0\n----------------------------\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nLimitations\n-----------\n\n* LOCK TABLES doesn\'t work when using Galera cluster. You may experience\ncrashes or locks when used with Galera.\n* LOCK TABLES works on XtraDB/InnoDB tables only if the innodb_table_locks\nsystem variable is set to 1 (the default) and autocommit is set to 0 (1 is\ndefault). Please note that no error message will be returned on LOCK TABLES\nwith innodb_table_locks = 0.\n* LOCK TABLES implicitly commits the active transaction, if any. Also,\nstarting a transaction always releases all table locks acquired with LOCK\nTABLES. This means that there is no way to have table locks and an active\ntransaction at the same time. The only exceptions are the transactions in\nautocommit mode. To preserve the data integrity between transactional and\nnon-transactional tables, the GET_LOCK() function can be used.\n* When using LOCK TABLES on a TEMPORARY table, it will always be locked with a\nWRITE lock.\n* While a connection holds an explicit read lock on a table, it cannot modify\nit. If you try, the following error will be produced:\n\nERROR 1099 (HY000): Table \'tab_name\' was locked with a READ lock and can\'t be\nupdated\n\n* While a connection holds an explicit lock on a table, it cannot access a\nnon-locked table. If you try, the following error will be produced:\n\nERROR 1100 (HY000): Table \'tab_name\' was not locked with LOCK TABLES\n\n* While a connection holds an explicit lock on a table, it cannot issue the\nfollowing: INSERT DELAYED, CREATE TABLE, CREATE TABLE ... LIKE, and DDL\nstatements involving stored programs and views (except for triggers). If you\ntry, the following error will be produced:\n\nERROR 1192 (HY000): Can\'t execute the given command because you have active\nlocked tables or an active transaction\n\n* LOCK TABLES can not be used in stored routines - if you try, the following\nerror will be produced on creation. This restriction was removed in MariaDB\n10.6.2:\n\nERROR 1314 (0A000): LOCK is not allowed in stored procedures\n\n\n\nURL: mariadb.com/kb/en/lock-tables/','','https://mariadb.com/kb/en/lock-tables/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (101,8,'ROLLBACK','The ROLLBACK statement rolls back (ends) a transaction, destroying any\nchanges to SQL-data so that they never become visible to subsequent\ntransactions. The required syntax for the ROLLBACK statement is as follows.\n\nROLLBACK [ WORK ] [ AND [ NO ] CHAIN ] \n[ TO [ SAVEPOINT ] {<savepoint name> | <simple target specification>} ]\n\nThe ROLLBACK statement will either end a transaction, destroying all data\nchanges that happened during any of the transaction, or it will just destroy\nany data changes that happened since you established a savepoint. The basic\nform of the ROLLBACK statement is just the keyword ROLLBACK (the keyword WORK\nis simply noise and can be omitted without changing the effect).\n\nThe optional AND CHAIN clause is a convenience for initiating a new\ntransaction as soon as the old transaction terminates. If AND CHAIN is\nspecified, then there is effectively nothing between the old and new\ntransactions, although they remain separate. The characteristics of the new\ntransaction will be the same as the characteristics of the old one — that is,\nthe new transaction will have the same access mode, isolation level and\ndiagnostics area size (we\'ll discuss all of these shortly) as the transaction\njust terminated. The AND NO CHAIN option just tells your DBMS to end the\ntransaction — that is, these four SQL statements are equivalent:\n\nROLLBACK; \nROLLBACK WORK; \nROLLBACK AND NO CHAIN; \nROLLBACK WORK AND NO CHAIN;\n\nAll of them end a transaction without saving any transaction characteristics.\nThe only other options, the equivalent statements:\n\nROLLBACK AND CHAIN;\nROLLBACK WORK AND CHAIN;\n\nboth tell your DBMS to end a transaction, but to save that transaction\'s\ncharacteristics for the next transaction.\n\nROLLBACK is much simpler than COMMIT: it may involve no more than a few\ndeletions (of Cursors, locks, prepared SQL statements and log-file entries).\nIt\'s usually assumed that ROLLBACK can\'t fail, although such a thing is\nconceivable (for example, an encompassing transaction might reject an attempt\nto ROLLBACK because it\'s lining up for a COMMIT).\n\nROLLBACK cancels all effects of a transaction. It does not cancel effects on\nobjects outside the DBMS\'s control (for example the values in host program\nvariables or the settings made by some SQL/CLI function calls). But in\ngeneral, it is a convenient statement for those situations when you say "oops,\nthis isn\'t working" or when you simply don\'t care whether your temporary work\nbecomes permanent or not.\n\nHere is a moot question. If all you\'ve been doing is SELECTs, so that there\nhave been no data changes, should you end the transaction with ROLLBACK or\nCOMMIT? It shouldn\'t really matter because both ROLLBACK and COMMIT do the\nsame transaction-terminating job. However, the popular conception is that\nROLLBACK implies failure, so after a successful series of SELECT statements\nthe convention is to end the transaction with COMMIT rather than ROLLBACK.\n\nMariaDB (and most other DBMSs) supports rollback of SQL-data change\nstatements, but not of SQL-Schema statements. This means that if you use any\nof CREATE, ALTER, DROP, GRANT, REVOKE, you are implicitly committing at\nexecution time.\n\nINSERT INTO Table_2 VALUES(5); \nDROP TABLE Table_3 CASCADE; \nROLLBACK;\n\nThe result will be that both the INSERT and the DROP will go through as\nseparate transactions so the ROLLBACK will have no effect.\n\n\n\nURL: mariadb.com/kb/en/rollback/','','https://mariadb.com/kb/en/rollback/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (102,8,'SAVEPOINT','Syntax\n------\n\nSAVEPOINT identifier\nROLLBACK [WORK] TO [SAVEPOINT] identifier\nRELEASE SAVEPOINT identifier\n\nDescription\n-----------\n\nInnoDB supports the SQL statements SAVEPOINT, ROLLBACK TO SAVEPOINT, RELEASE\nSAVEPOINT and the optional WORK keyword for ROLLBACK.\n\nEach savepoint must have a legal MariaDB identifier. A savepoint is a named\nsub-transaction.\n\nNormally ROLLBACK undoes the changes performed by the whole transaction. When\nused with the TO clause, it undoes the changes performed after the specified\nsavepoint, and erases all subsequent savepoints. However, all locks that have\nbeen acquired after the save point will survive. RELEASE SAVEPOINT does not\nrollback or commit any changes, but removes the specified savepoint.\n\nWhen the execution of a trigger or a stored function begins, it is not\npossible to use statements which reference a savepoint which was defined from\nout of that stored program.\n\nWhen a COMMIT (including implicit commits) or a ROLLBACK statement (with no TO\nclause) is performed, they act on the whole transaction, and all savepoints\nare removed.\n\nErrors\n------\n\nIf COMMIT or ROLLBACK is issued and no transaction was started, no error is\nreported.\n\nIf SAVEPOINT is issued and no transaction was started, no error is reported\nbut no savepoint is created. When ROLLBACK TO SAVEPOINT or RELEASE SAVEPOINT\nis called for a savepoint that does not exist, an error like this is issued:\n\nERROR 1305 (42000): SAVEPOINT svp_name does not exist\n\n\n\nURL: mariadb.com/kb/en/savepoint/','','https://mariadb.com/kb/en/savepoint/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (103,8,'Metadata Locking','MariaDB supports metadata locking. This means that when a transaction\n(including XA transactions) uses a table, it locks its metadata until the end\nof transaction. Non-transactional tables are also locked, as well as views and\nobjects which are related to locked tables/views (stored functions, triggers,\netc). When a connection tries to use a DDL statement (like an ALTER TABLE)\nwhich modifies a table that is locked, that connection is queued, and has to\nwait until it\'s unlocked. Using savepoints and performing a partial rollback\ndoes not release metadata locks.\n\nLOCK TABLES ... WRITE are also queued. Some wrong statements which produce an\nerror may not need to wait for the lock to be freed.\n\nThe metadata lock\'s timeout is determined by the value of the\nlock_wait_timeout server system variable (in seconds). However, note that its\ndefault value is 31536000 (1 year, MariaDB <= 10.2.3), or 86400 (1 day,\nMariaDB >= 10.2.4). If this timeout is exceeded, the following error is\nreturned:\n\nERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction\n\nIf the metadata_lock_info plugin is installed, the Information Schema\nmetadata_lock_info table stores information about existing metadata locks.\n\nMariaDB starting with 10.5.2\n----------------------------\nFrom MariaDB 10.5, the Performance Schema metadata_locks table contains\nmetadata lock information.\n\nExample\n-------\n\nLet\'s use the following MEMORY (non-transactional) table:\n\nCREATE TABLE t (a INT) ENGINE = MEMORY;\n\nConnection 1 starts a transaction, and INSERTs a row into t:\n\nSTART TRANSACTION;\n\nINSERT INTO t SET a=1;\n\nt\'s metadata is now locked by connection 1. Connection 2 tries to alter t, but\nhas to wait:\n\nALTER TABLE t ADD COLUMN b INT;\n\nConnection 2\'s prompt is blocked now.\n\nNow connection 1 ends the transaction:\n\nCOMMIT;\n\n...and connection 2 finally gets the output of its command:\n\nQuery OK, 1 row affected (35.23 sec)\nRecords: 1 Duplicates: 0 Warnings: 0\n\n\n\nURL: mariadb.com/kb/en/metadata-locking/','','https://mariadb.com/kb/en/metadata-locking/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (104,8,'PREPARE Statement','Syntax\n------\n\nPREPARE stmt_name FROM preparable_stmt\n\nDescription\n-----------\n\nThe PREPARE statement prepares a statement and assigns it a name, stmt_name,\nby which to refer to the statement later. Statement names are not case\nsensitive. preparable_stmt is either a string literal or a user variable (not\na local variable, an SQL expression or a subquery) that contains the text of\nthe statement. The text must represent a single SQL statement, not multiple\nstatements. Within the statement, "?" characters can be used as parameter\nmarkers to indicate where data values are to be bound to the query later when\nyou execute it. The "?" characters should not be enclosed within quotes, even\nif you intend to bind them to string values. Parameter markers can be used\nonly where expressions should appear, not for SQL keywords, identifiers, and\nso forth.\n\nThe scope of a prepared statement is the session within which it is created.\nOther sessions cannot see it.\n\nIf a prepared statement with the given name already exists, it is deallocated\nimplicitly before the new statement is prepared. This means that if the new\nstatement contains an error and cannot be prepared, an error is returned and\nno statement with the given name exists.\n\nPrepared statements can be PREPAREd and EXECUTEd in a stored procedure, but\nnot in a stored function or trigger. Also, even if the statement is PREPAREd\nin a procedure, it will not be deallocated when the procedure execution ends.\n\nA prepared statement can access user-defined variables, but not local\nvariables or procedure\'s parameters.\n\nIf the prepared statement contains a syntax error, PREPARE will fail. As a\nside effect, stored procedures can use it to check if a statement is valid.\nFor example:\n\nCREATE PROCEDURE `test_stmt`(IN sql_text TEXT)\nBEGIN\n DECLARE EXIT HANDLER FOR SQLEXCEPTION\n BEGIN\n SELECT CONCAT(sql_text, \' is not valid\');\n END;\n SET @SQL := sql_text;\n PREPARE stmt FROM @SQL;\n DEALLOCATE PREPARE stmt;\nEND;\n\nThe FOUND_ROWS() and ROW_COUNT() functions, if called immediatly after\nEXECUTE, return the number of rows read or affected by the prepared\nstatements; however, if they are called after DEALLOCATE PREPARE, they provide\ninformation about this statement. If the prepared statement produces errors or\nwarnings, GET DIAGNOSTICS return information about them. DEALLOCATE PREPARE\nshouldn\'t clear the diagnostics area, unless it produces an error.\n\nA prepared statement is executed with EXECUTE and released with DEALLOCATE\nPREPARE.\n\nThe max_prepared_stmt_count server system variable determines the number of\nallowed prepared statements that can be prepared on the server. If it is set\nto 0, prepared statements are not allowed. If the limit is reached, an error\nsimilar to the following will be produced:\n\nERROR 1461 (42000): Can\'t create more than max_prepared_stmt_count statements \n (current value: 0)\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, PREPARE stmt FROM \'SELECT :1, :2\' is used,\ninstead of ?.\n\nPermitted Statements\n--------------------\n\nNot all statements can be prepared. Only the following SQL commands are\npermitted:\n\n* ALTER TABLE\n* ANALYZE TABLE\n* BINLOG\n* CACHE INDEX\n* CALL\n* CHANGE MASTER\n* CHECKSUM {TABLE | TABLES}\n* COMMIT\n* {CREATE | DROP} DATABASE\n* {CREATE | DROP} INDEX\n* {CREATE | RENAME | DROP} TABLE\n* {CREATE | RENAME | DROP} USER\n* {CREATE | DROP} VIEW\n* DELETE\n* DESCRIBE\n* DO\n* EXPLAIN\n* FLUSH {TABLE | TABLES | TABLES WITH READ LOCK | HOSTS | PRIVILEGES | LOGS |\nSTATUS | \n MASTER | SLAVE | DES_KEY_FILE | USER_RESOURCES | QUERY CACHE |\nTABLE_STATISTICS | \n INDEX_STATISTICS | USER_STATISTICS | CLIENT_STATISTICS}\n* GRANT\n* INSERT\n* INSTALL {PLUGIN | SONAME}\n* HANDLER READ\n* KILL\n* LOAD INDEX INTO CACHE\n* OPTIMIZE TABLE\n* REPAIR TABLE\n* REPLACE\n* RESET {MASTER | SLAVE | QUERY CACHE}\n* REVOKE\n* ROLLBACK\n* SELECT\n* SET\n* SET GLOBAL SQL_SLAVE_SKIP_COUNTER\n* SET ROLE\n* SET SQL_LOG_BIN\n* SET TRANSACTION ISOLATION LEVEL\n* SHOW EXPLAIN\n* SHOW {DATABASES | TABLES | OPEN TABLES | TABLE STATUS | COLUMNS | INDEX |\nTRIGGERS | \n EVENTS | GRANTS | CHARACTER SET | COLLATION | ENGINES | PLUGINS [SONAME] |\nPRIVILEGES | \n PROCESSLIST | PROFILE | PROFILES | VARIABLES | STATUS | WARNINGS | ERRORS |\n TABLE_STATISTICS | INDEX_STATISTICS | USER_STATISTICS | CLIENT_STATISTICS |\nAUTHORS | \n CONTRIBUTORS}\n* SHOW CREATE {DATABASE | TABLE | VIEW | PROCEDURE | FUNCTION | TRIGGER |\nEVENT}\n* SHOW {FUNCTION | PROCEDURE} CODE\n* SHOW BINLOG EVENTS\n* SHOW SLAVE HOSTS\n* SHOW {MASTER | BINARY} LOGS\n* SHOW {MASTER | SLAVE | TABLES | INNODB | FUNCTION | PROCEDURE} STATUS\n* SLAVE {START | STOP}\n* TRUNCATE TABLE\n* SHUTDOWN\n* UNINSTALL {PLUGIN | SONAME}\n* UPDATE\n\nSynonyms are not listed here, but can be used. For example, DESC can be used\ninstead of DESCRIBE.\n\nMariaDB starting with 10.1.1\n----------------------------\nCompound statements can be prepared too.\n\nNote that if a statement can be run in a stored routine, it will work even if\nit is called by a prepared statement. For example, SIGNAL can\'t be directly\nprepared. However, it is allowed in stored routines. If the x() procedure\ncontains SIGNAL, you can still prepare and execute the \'CALL x();\' prepared\nstatement.\n\nMariaDB starting with 10.2.3\n----------------------------\nPREPARE now supports most kinds of expressions as well, for example:\n\nPREPARE stmt FROM CONCAT(\'SELECT * FROM \', table_name);\n\nMariaDB starting with 10.6.2\n----------------------------\nAll statements can be prepared, except PREPARE, EXECUTE, and DEALLOCATE / DROP\nPREPARE.\n\nWhen PREPARE is used with a statement which is not supported, the following\nerror is produced:\n\nERROR 1295 (HY000): This command is not supported in the prepared statement\nprotocol yet\n\nExample\n-------\n\ncreate table t1 (a int,b char(10));\ninsert into t1 values (1,"one"),(2, "two"),(3,"three");\nprepare test from "select * from t1 where a=?";\nset @param=2;\nexecute test using @param;\n+------+------+\n| a | b |\n+------+------+\n| 2 | two |\n+------+------+\nset @param=3;\nexecute test using @param;\n+------+-------+\n| a | b |\n+------+-------+\n| 3 | three |\n+------+-------+\ndeallocate prepare test;\n\nSince identifiers are not permitted as prepared statements parameters,\nsometimes it is necessary to dynamically compose an SQL statement. This\ntechnique is called dynamic SQL). The following example shows how to use\ndynamic SQL:\n\nCREATE PROCEDURE test.stmt_test(IN tab_name VARCHAR(64))\nBEGIN\n SET @sql = CONCAT(\'SELECT COUNT(*) FROM \', tab_name);\n PREPARE stmt FROM @sql;\n EXECUTE stmt;\n DEALLOCATE PREPARE stmt;\nEND;\n\nCALL test.stmt_test(\'mysql.user\');\n+----------+\n| COUNT(*) |\n+----------+\n| 4 |\n+----------+\n\nUse of variables in prepared statements:\n\nPREPARE stmt FROM \'SELECT @x;\';\n\nSET @x = 1;\n\nEXECUTE stmt;\n+------+\n| @x |\n+------+\n| 1 |\n+------+\n\nSET @x = 0;\n\nEXECUTE stmt;\n+------+\n| @x |\n+------+\n| 0 |\n+------+\n\nDEALLOCATE PREPARE stmt;\n\n\n\nURL: mariadb.com/kb/en/prepare-statement/','','https://mariadb.com/kb/en/prepare-statement/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (105,8,'PURGE BINARY LOGS','Syntax\n------\n\nPURGE { BINARY | MASTER } LOGS\n { TO \'log_name\' | BEFORE datetime_expr }\n\nDescription\n-----------\n\nThe PURGE BINARY LOGS statement deletes all the binary log files listed in the\nlog index file prior to the specified log file name or date. BINARY and MASTER\nare synonyms. Deleted log files also are removed from the list recorded in the\nindex file, so that the given log file becomes the first in the list.\n\nThe datetime expression is in the format \'YYYY-MM-DD hh:mm:ss\'.\n\nIf a replica is active but has yet to read from a binary log file you attempt\nto delete, the statement will fail with an error. However, if the replica is\nnot connected and has yet to read from a log file you delete, the file will be\ndeleted, but the replica will be unable to continue replicating once it\nconnects again.\n\nThis statement has no effect if the server was not started with the --log-bin\noption to enable binary logging.\n\nTo list the binary log files on the server, use SHOW BINARY LOGS. To see which\nfiles they are reading, use SHOW SLAVE STATUS (or SHOW REPLICA STATUS from\nMariaDB 10.5.1). You can only delete the files that are older than the oldest\nfile that is used by the slaves.\n\nTo delete all binary log files, use RESET MASTER. To move to a new log file\n(for example if you want to remove the current log file), use FLUSH LOGS\nbefore you execute PURGE LOGS.\n\nIf the expire_logs_days server system variable is not set to 0, the server\nautomatically deletes binary log files after the given number of days. From\nMariaDB 10.6, the binlog_expire_logs_seconds variable allows more precise\ncontrol over binlog deletion, and takes precedence if both are non-zero.\n\nRequires the SUPER privilege or, from MariaDB 10.5.2, the BINLOG ADMIN\nprivilege, to run.\n\nExamples\n--------\n\nPURGE BINARY LOGS TO \'mariadb-bin.000063\';\n\nPURGE BINARY LOGS BEFORE \'2013-04-21\';\n\nPURGE BINARY LOGS BEFORE \'2013-04-22 09:55:22\';\n\n\n\nURL: mariadb.com/kb/en/purge-binary-logs/','','https://mariadb.com/kb/en/purge-binary-logs/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (106,8,'RESET MASTER','RESET MASTER [TO #]\n\nDeletes all binary log files listed in the index file, resets the binary log\nindex file to be empty, and creates a new binary log file with a suffix of\n.000001.\n\nIf TO # is given, then the first new binary log file will start from number #.\n\nThis statement is for use only when the master is started for the first time,\nand should never be used if any slaves are actively replicating from the\nbinary log.\n\n\n\nURL: mariadb.com/kb/en/reset-master/','','https://mariadb.com/kb/en/reset-master/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (107,8,'RESET SLAVE','The terms master and slave have historically been used in replication,\nbut the terms terms primary and replica are now preferred. The old terms are\nused still used in parts of the documentation, and in MariaDB commands,\nalthough MariaDB 10.5 has begun the process of renaming. The documentation\nprocess is ongoing. See MDEV-18777 to follow progress on this effort.\n\nSyntax\n------\n\nRESET REPLICA ["connection_name"] [ALL] [FOR CHANNEL "connection_name"] --\nfrom MariaDB 10.5.1 \nRESET SLAVE ["connection_name"] [ALL] [FOR CHANNEL "connection_name"]\n\nDescription\n-----------\n\nRESET REPLICA/SLAVE makes the replica forget its replication position in the\nmaster\'s binary log. This statement is meant to be used for a clean start. It\ndeletes the master.info and relay-log.info files, all the relay log files, and\nstarts a new relay log file. To use RESET REPLICA/SLAVE, the replica threads\nmust be stopped (use STOP REPLICA/SLAVE if necessary).\n\nNote: All relay log files are deleted, even if they have not been completely\nexecuted by the slave SQL thread. (This is a condition likely to exist on a\nreplication slave if you have issued a STOP REPLICA/SLAVE statement or if the\nslave is highly loaded.)\n\nNote: RESET REPLICA does not reset the global gtid_slave_pos variable. This\nmeans that a replica server configured with CHANGE MASTER TO\nMASTER_USE_GTID=slave_pos will not receive events with GTIDs occurring before\nthe state saved in gtid_slave_pos. If the intent is to reprocess these events,\ngtid_slave_pos must be manually reset, e.g. by executing set global\ngtid_slave_pos="".\n\nConnection information stored in the master.info file is immediately reset\nusing any values specified in the corresponding startup options. This\ninformation includes values such as master host, master port, master user, and\nmaster password. If the replica SQL thread was in the middle of replicating\ntemporary tables when it was stopped, and RESET REPLICA/SLAVE is issued, these\nreplicated temporary tables are deleted on the slave.\n\nThe ALL also resets the PORT, HOST, USER and PASSWORD parameters for the\nslave. If you are using a connection name, it will permanently delete it and\nit will not show up anymore in SHOW ALL REPLICAS/SLAVE STATUS.\n\nconnection_name\n---------------\n\nThe connection_name option is used for multi-source replication.\n\nIf there is only one nameless primary, or the default primary (as specified by\nthe default_master_connection system variable) is intended, connection_name\ncan be omitted. If provided, the RESET REPLICA/SLAVE statement will apply to\nthe specified primary. connection_name is case-insensitive.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after RESET REPLICA.\n\nRESET REPLICA\n-------------\n\nMariaDB starting with 10.5.1\n----------------------------\nRESET REPLICA is an alias for RESET SLAVE from MariaDB 10.5.1.\n\n\n\nURL: mariadb.com/kb/en/reset-slave-connection_name/','','https://mariadb.com/kb/en/reset-slave-connection_name/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (108,8,'SET TRANSACTION','Syntax\n------\n\nSET [GLOBAL | SESSION] TRANSACTION\n transaction_property [, transaction_property] ...\n\ntransaction_property:\n ISOLATION LEVEL level\n | READ WRITE\n | READ ONLY\n\nlevel:\n REPEATABLE READ\n | READ COMMITTED\n | READ UNCOMMITTED\n | SERIALIZABLE\n\nDescription\n-----------\n\nThis statement sets the transaction isolation level or the transaction access\nmode globally, for the current session, or for the next transaction:\n\n* With the GLOBAL keyword, the statement sets the default\n transaction level globally for all subsequent sessions. Existing sessions are\n unaffected.\n* With the SESSION keyword, the statement sets the default\n transaction level for all subsequent transactions performed within the\n current session.\n* Without any SESSION or GLOBAL keyword,\n the statement sets the isolation level for the next (not started) transaction\n performed within the current session.\n\nA change to the global default isolation level requires the SUPER privilege.\nAny session is free to change its session isolation level (even in the middle\nof a transaction), or the isolation level for its next transaction.\n\nIsolation Level\n---------------\n\nTo set the global default isolation level at server startup, use the\n--transaction-isolation=level option on the command line or in an option file.\nValues of level for this option use dashes rather than spaces, so the\nallowable values are READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, or\nSERIALIZABLE. For example, to set the default isolation level to REPEATABLE\nREAD, use these lines in the [mysqld] section of an option file:\n\n[mysqld]\ntransaction-isolation = REPEATABLE-READ\nTo determine the global and session transaction isolation levels at runtime,\ncheck the value of the tx_isolation system variable:\n\nSELECT @@GLOBAL.tx_isolation, @@tx_isolation;\n\nInnoDB supports each of the translation isolation levels described here using\ndifferent locking strategies. The default level is REPEATABLE READ. For\nadditional information about InnoDB record-level locks and how it uses them to\nexecute various types of statements, see InnoDB Lock Modes, and\nhttp://dev.mysql.com/doc/refman/en/innodb-locks-set.html.\n\nIsolation Levels\n----------------\n\nThe following sections describe how MariaDB supports the different transaction\nlevels.\n\nREAD UNCOMMITTED\n----------------\n\nSELECT statements are performed in a non-locking fashion, but a possible\nearlier version of a row might be used. Thus, using this isolation level, such\nreads are not consistent. This is also called a "dirty read." Otherwise, this\nisolation level works like READ COMMITTED.\n\nREAD COMMITTED\n--------------\n\nA somewhat Oracle-like isolation level with respect to consistent\n(non-locking) reads: Each consistent read, even within the same transaction,\nsets and reads its own fresh snapshot. See\nhttp://dev.mysql.com/doc/refman/en/innodb-consistent-read.html.\n\nFor locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE), InnoDB locks\nonly index records, not the gaps before them, and thus allows the free\ninsertion of new records next to locked records. For UPDATE and DELETE\nstatements, locking depends on whether the statement uses a unique index with\na unique search condition (such as WHERE id = 100), or a range-type search\ncondition (such as WHERE id > 100). For a unique index with a unique search\ncondition, InnoDB locks only the index record found, not the gap before it.\nFor range-type searches, InnoDB locks the index range scanned, using gap locks\nor next-key (gap plus index-record) locks to block insertions by other\nsessions into the gaps covered by the range. This is necessary because\n"phantom rows" must be blocked for MySQL replication and recovery to work.\n\nNote: If the READ COMMITTED isolation level is used or the\ninnodb_locks_unsafe_for_binlog system variable is enabled, there is no InnoDB\ngap locking except for foreign-key constraint checking and duplicate-key\nchecking. Also, record locks for non-matching rows are released after MariaDB\nhas evaluated the WHERE condition.If you use READ COMMITTED or enable\ninnodb_locks_unsafe_for_binlog, you must use row-based binary logging.\n\nREPEATABLE READ\n---------------\n\nThis is the default isolation level for InnoDB. For consistent reads, there is\nan important difference from the READ COMMITTED isolation level: All\nconsistent reads within the same transaction read the snapshot established by\nthe first read. This convention means that if you issue several plain\n(non-locking) SELECT statements within the same transaction, these SELECT\nstatements are consistent also with respect to each other. See\nhttp://dev.mysql.com/doc/refman/en/innodb-consistent-read.html.\n\nFor locking reads (SELECT with FOR UPDATE or LOCK IN SHARE MODE), UPDATE, and\nDELETE statements, locking depends on whether the statement uses a unique\nindex with a unique search condition, or a range-type search condition. For a\nunique index with a unique search condition, InnoDB locks only the index\nrecord found, not the gap before it. For other search conditions, InnoDB locks\nthe index range scanned, using gap locks or next-key (gap plus index-record)\nlocks to block insertions by other sessions into the gaps covered by the range.\n\nThis is the minimum isolation level for non-distributed XA transactions.\n\nSERIALIZABLE\n------------\n\nThis level is like REPEATABLE READ, but InnoDB implicitly converts all plain\nSELECT statements to SELECT ... LOCK IN SHARE MODE if autocommit is disabled.\nIf autocommit is enabled, the SELECT is its own transaction. It therefore is\nknown to be read only and can be serialized if performed as a consistent\n(non-locking) read and need not block for other transactions. (This means that\nto force a plain SELECT to block if other transactions have modified the\nselected rows, you should disable autocommit.)\n\nDistributed XA transactions should always use this isolation level.\n\nAccess Mode\n-----------\n\nThe access mode specifies whether the transaction is allowed to write data or\nnot. By default, transactions are in READ WRITE mode (see the tx_read_only\nsystem variable). READ ONLY mode allows the storage engine to apply\noptimizations that cannot be used for transactions which write data. The only\nexception to this rule is that read only transactions can perform DDL\nstatements on temporary tables.\n\nIt is not permitted to specify both READ WRITE and READ ONLY in the same\nstatement.\n\nREAD WRITE and READ ONLY can also be specified in the START TRANSACTION\nstatement, in which case the specified mode is only valid for one transaction.\n\nExamples\n--------\n\nSET GLOBAL TRANSACTION ISOLATION LEVEL SERIALIZABLE;\n\nAttempting to set the isolation level within an existing transaction without\nspecifying GLOBAL or SESSION.\n\nSTART TRANSACTION;\n\nSET TRANSACTION ISOLATION LEVEL SERIALIZABLE;\nERROR 1568 (25001): Transaction characteristics can\'t be changed while a\ntransaction is in progress\n\n\n\nURL: mariadb.com/kb/en/set-transaction/','','https://mariadb.com/kb/en/set-transaction/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (109,8,'START SLAVE','The terms master and slave have historically been used in replication,\nbut the terms terms primary and replica are now preferred. The old terms are\nused still used in parts of the documentation, and in MariaDB commands,\nalthough MariaDB 10.5 has begun the process of renaming. The documentation\nprocess is ongoing. See MDEV-18777 to follow progress on this effort.\n\nSyntax\n------\n\nSTART SLAVE ["connection_name"] [thread_type [, thread_type] ... ] [FOR\nCHANNEL "connection_name"]\nSTART SLAVE ["connection_name"] [SQL_THREAD] UNTIL \n MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos [FOR CHANNEL\n"connection_name"]\nSTART SLAVE ["connection_name"] [SQL_THREAD] UNTIL\n RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos [FOR CHANNEL\n"connection_name"]\nSTART SLAVE ["connection_name"] [SQL_THREAD] UNTIL\n MASTER_GTID_POS = <GTID position> [FOR CHANNEL "connection_name"]\nSTART ALL SLAVES [thread_type [, thread_type]]\n\nSTART REPLICA ["connection_name"] [thread_type [, thread_type] ... ] -- from\n10.5.1\nSTART REPLICA ["connection_name"] [SQL_THREAD] UNTIL \n MASTER_LOG_FILE = \'log_name\', MASTER_LOG_POS = log_pos -- from 10.5.1\nSTART REPLICA ["connection_name"] [SQL_THREAD] UNTIL\n RELAY_LOG_FILE = \'log_name\', RELAY_LOG_POS = log_pos -- from 10.5.1\nSTART REPLICA ["connection_name"] [SQL_THREAD] UNTIL\n MASTER_GTID_POS = <GTID position> -- from 10.5.1\nSTART ALL REPLICAS [thread_type [, thread_type]] -- from 10.5.1\n\nthread_type: IO_THREAD | SQL_THREAD\n\nDescription\n-----------\n\nSTART SLAVE (START REPLICA from MariaDB 10.5.1) with no thread_type options\nstarts both of the replica threads (see replication). The I/O thread reads\nevents from the primary server and stores them in the relay log. The SQL\nthread reads events from the relay log and executes them. START SLAVE requires\nthe SUPER privilege, or, from MariaDB 10.5.2, the REPLICATION SLAVE ADMIN\nprivilege.\n\nIf START SLAVE succeeds in starting the replica threads, it returns without\nany error. However, even in that case, it might be that the replica threads\nstart and then later stop (for example, because they do not manage to connect\nto the primary or read its binary log, or some other problem). START SLAVE\ndoes not warn you about this. You must check the replica\'s error log for error\nmessages generated by the replica threads, or check that they are running\nsatisfactorily with SHOW SLAVE STATUS (SHOW REPLICA STATUS from MariaDB\n10.5.1).\n\nSTART SLAVE UNTIL\n-----------------\n\nSTART SLAVE UNTIL refers to the SQL_THREAD replica position at which the\nSQL_THREAD replication will halt. If SQL_THREAD isn\'t specified both threads\nare started.\n\nSTART SLAVE UNTIL master_gtid_pos=xxx is also supported. See Global\nTransaction ID/START SLAVE UNTIL master_gtid_pos=xxx for more details.\n\nconnection_name\n---------------\n\nIf there is only one nameless primary, or the default primary (as specified by\nthe default_master_connection system variable) is intended, connection_name\ncan be omitted. If provided, the START SLAVE statement will apply to the\nspecified primary. connection_name is case-insensitive.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after START SLAVE.\n\nSTART ALL SLAVES\n----------------\n\nSTART ALL SLAVES starts all configured replicas (replicas with master_host not\nempty) that were not started before. It will give a note for all started\nconnections. You can check the notes with SHOW WARNINGS.\n\nSTART REPLICA\n-------------\n\nMariaDB starting with 10.5.1\n----------------------------\nSTART REPLICA is an alias for START SLAVE from MariaDB 10.5.1.\n\n\n\nURL: mariadb.com/kb/en/start-slave/','','https://mariadb.com/kb/en/start-slave/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (110,8,'START TRANSACTION','Syntax\n------\n\nSTART TRANSACTION [transaction_property [, transaction_property] ...] | BEGIN\n[WORK]\nCOMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]\nSET autocommit = {0 | 1}\n\ntransaction_property:\n WITH CONSISTENT SNAPSHOT\n | READ WRITE\n | READ ONLY\n\nDescription\n-----------\n\nThe START TRANSACTION or BEGIN statement begins a new transaction. COMMIT\ncommits the current transaction, making its changes permanent. ROLLBACK rolls\nback the current transaction, canceling its changes. The SET autocommit\nstatement disables or enables the default autocommit mode for the current\nsession.\n\nSTART TRANSACTION and SET autocommit = 1 implicitly commit the current\ntransaction, if any.\n\nThe optional WORK keyword is supported for COMMIT and ROLLBACK, as are the\nCHAIN and RELEASE clauses. CHAIN and RELEASE can be used for additional\ncontrol over transaction completion. The value of the completion_type system\nvariable determines the default completion behavior.\n\nThe AND CHAIN clause causes a new transaction to begin as soon as the current\none ends, and the new transaction has the same isolation level as the\njust-terminated transaction. The RELEASE clause causes the server to\ndisconnect the current client session after terminating the current\ntransaction. Including the NO keyword suppresses CHAIN or RELEASE completion,\nwhich can be useful if the completion_type system variable is set to cause\nchaining or release completion by default.\n\nAccess Mode\n-----------\n\nThe access mode specifies whether the transaction is allowed to write data or\nnot. By default, transactions are in READ WRITE mode (see the tx_read_only\nsystem variable). READ ONLY mode allows the storage engine to apply\noptimizations that cannot be used for transactions which write data. The only\nexception to this rule is that read only transactions can perform DDL\nstatements on temporary tables.\n\nIt is not permitted to specify both READ WRITE and READ ONLY in the same\nstatement.\n\nREAD WRITE and READ ONLY can also be specified in the SET TRANSACTION\nstatement, in which case the specified mode is valid for all sessions, or for\nall subsequent transaction used by the current session.\n\nautocommit\n----------\n\nBy default, MariaDB runs with autocommit mode enabled. This means that as soon\nas you execute a statement that updates (modifies) a table, MariaDB stores the\nupdate on disk to make it permanent. To disable autocommit mode, use the\nfollowing statement:\n\nSET autocommit=0;\n\nAfter disabling autocommit mode by setting the autocommit variable to zero,\nchanges to transaction-safe tables (such as those for InnoDB or NDBCLUSTER)\nare not made permanent immediately. You must use COMMIT to store your changes\nto disk or ROLLBACK to ignore the changes.\n\nTo disable autocommit mode for a single series of statements, use the START\nTRANSACTION statement.\n\nDDL Statements\n--------------\n\nDDL statements (CREATE, ALTER, DROP) and administrative statements (FLUSH,\nRESET, OPTIMIZE, ANALYZE, CHECK, REPAIR, CACHE INDEX), transaction management\nstatements (BEGIN, START TRANSACTION) and LOAD DATA INFILE, cause an implicit\nCOMMIT and start a new transaction. An exception to this rule are the DDL that\noperate on temporary tables: you can CREATE, ALTER and DROP them without\ncausing any COMMIT, but those actions cannot be rolled back. This means that\nif you call ROLLBACK, the temporary tables you created in the transaction will\nremain, while the rest of the transaction will be rolled back.\n\nTransactions cannot be used in Stored Functions or Triggers. In Stored\nProcedures and Events BEGIN is not allowed, so you should use START\nTRANSACTION instead.\n\nA transaction acquires a metadata lock on every table it accesses to prevent\nother connections from altering their structure. The lock is released at the\nend of the transaction. This happens even with non-transactional storage\nengines (like MEMORY or CONNECT), so it makes sense to use transactions with\nnon-transactional tables.\n\nin_transaction\n--------------\n\nThe in_transaction system variable is a session-only, read-only variable that\nreturns 1 inside a transaction, and 0 if not in a transaction.\n\nWITH CONSISTENT SNAPSHOT\n------------------------\n\nThe WITH CONSISTENT SNAPSHOT option starts a consistent read for storage\nengines such as InnoDB that can do so, the same as if a START TRANSACTION\nfollowed by a SELECT from any InnoDB table was issued.\n\nSee Enhancements for START TRANSACTION WITH CONSISTENT SNAPSHOT.\n\nExamples\n--------\n\nSTART TRANSACTION;\nSELECT @A:=SUM(salary) FROM table1 WHERE type=1;\nUPDATE table2 SET summary=@A WHERE type=1;\nCOMMIT;\n\n\n\nURL: mariadb.com/kb/en/start-transaction/','','https://mariadb.com/kb/en/start-transaction/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (111,8,'STOP SLAVE','The terms master and slave have historically been used in replication,\nbut the terms terms primary and replica are now preferred. The old terms are\nused still used in parts of the documentation, and in MariaDB commands,\nalthough MariaDB 10.5 has begun the process of renaming. The documentation\nprocess is ongoing. See MDEV-18777 to follow progress on this effort.\n\nSyntax\n------\n\nSTOP SLAVE ["connection_name"] [thread_type [, thread_type] ... ] [FOR CHANNEL\n"connection_name"]\n\nSTOP ALL SLAVES [thread_type [, thread_type]]\n\nSTOP REPLICA ["connection_name"] [thread_type [, thread_type] ... ] -- from\n10.5.1\n\nSTOP ALL REPLICAS [thread_type [, thread_type]] -- from 10.5.1\n\nthread_type: IO_THREAD | SQL_THREAD\n\nDescription\n-----------\n\nStops the replica threads. STOP SLAVE requires the SUPER privilege, or, from\nMariaDB 10.5.2, the REPLICATION SLAVE ADMIN privilege.\n\nLike START SLAVE, this statement may be used with the IO_THREAD and SQL_THREAD\noptions to name the thread or threads to be stopped. In almost all cases, one\nnever need to use the thread_type options.\n\nSTOP SLAVE waits until any current replication event group affecting one or\nmore non-transactional tables has finished executing (if there is any such\nreplication group), or until the user issues a KILL QUERY or KILL CONNECTION\nstatement.\n\nNote that STOP SLAVE doesn\'t delete the connection permanently. Next time you\nexecute START SLAVE or the MariaDB server restarts, the replica connection is\nrestored with it\'s original arguments. If you want to delete a connection, you\nshould execute RESET SLAVE.\n\nSTOP ALL SLAVES\n---------------\n\nSTOP ALL SLAVES stops all your running replicas. It will give you a note for\nevery stopped connection. You can check the notes with SHOW WARNINGS.\n\nconnection_name\n---------------\n\nThe connection_name option is used for multi-source replication.\n\nIf there is only one nameless master, or the default master (as specified by\nthe default_master_connection system variable) is intended, connection_name\ncan be omitted. If provided, the STOP SLAVE statement will apply to the\nspecified master. connection_name is case-insensitive.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after STOP SLAVE.\n\nSTOP REPLICA\n------------\n\nMariaDB starting with 10.5.1\n----------------------------\nSTOP REPLICA is an alias for STOP SLAVE from MariaDB 10.5.1.\n\n\n\nURL: mariadb.com/kb/en/stop-slave/','','https://mariadb.com/kb/en/stop-slave/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (112,8,'Transaction Timeouts','MariaDB has always had the wait_timeout and interactive_timeout\nsettings, which close connections after a certain period of inactivity.\n\nHowever, these are by default set to a long wait period. In situations where\ntransactions may be started, but not committed or rolled back, more granular\ncontrol and a shorter timeout may be desirable so as to avoid locks being held\nfor too long.\n\nMariaDB 10.3 introduced three new variables to handle this situation.\n\n* idle_transaction_timeout (all transactions)\n* idle_write_transaction_timeout (write transactions - called\nidle_readwrite_transaction_timeout until MariaDB 10.3.2)\n* idle_readonly_transaction_timeout (read transactions)\n\nThese accept a time in seconds to time out, by closing the connection,\ntransactions that are idle for longer than this period. By default all are set\nto zero, or no timeout.\n\nidle_transaction_timeout affects all transactions,\nidle_write_transaction_timeout affects write transactions only and\nidle_readonly_transaction_timeout affects read transactions only. The latter\ntwo variables work independently. However, if either is set along with\nidle_transaction_timeout, the settings for idle_write_transaction_timeout or\nidle_readonly_transaction_timeout will take precedence.\n\nExamples\n--------\n\nSET SESSION idle_transaction_timeout=2;\nBEGIN;\nSELECT * FROM t;\nEmpty set (0.000 sec)\n## wait 3 seconds\nSELECT * FROM t;\nERROR 2006 (HY000): MySQL server has gone away\n\nSET SESSION idle_write_transaction_timeout=2;\nBEGIN;\nSELECT * FROM t;\nEmpty set (0.000 sec)\n## wait 3 seconds\nSELECT * FROM t;\nEmpty set (0.000 sec)\nINSERT INTO t VALUES(1);\n## wait 3 seconds\nSELECT * FROM t;\nERROR 2006 (HY000): MySQL server has gone away\n\nSET SESSION idle_transaction_timeout=2, SESSION\nidle_readonly_transaction_timeout=10;\nBEGIN;\nSELECT * FROM t;\nEmpty set (0.000 sec)\n ## wait 3 seconds\nSELECT * FROM t;\nEmpty set (0.000 sec)\n## wait 11 seconds\nSELECT * FROM t;\nERROR 2006 (HY000): MySQL server has gone away\n\n\n\nURL: mariadb.com/kb/en/transaction-timeouts/','','https://mariadb.com/kb/en/transaction-timeouts/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (113,8,'UNLOCK TABLES','Syntax\n------\n\nUNLOCK TABLES\n\nDescription\n-----------\n\nUNLOCK TABLES explicitly releases any table locks held by the current session.\nSee LOCK TABLES for more information.\n\nIn addition to releasing table locks acquired by the LOCK TABLES statement,\nthe UNLOCK TABLES statement also releases the global read lock acquired by the\nFLUSH TABLES WITH READ LOCK statement. The FLUSH TABLES WITH READ LOCK\nstatement is very useful for performing backups. See FLUSH for more\ninformation about FLUSH TABLES WITH READ LOCK.\n\n\n\nURL: mariadb.com/kb/en/transactions-unlock-tables/','','https://mariadb.com/kb/en/transactions-unlock-tables/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (114,8,'WAIT and NOWAIT','MariaDB starting with 10.3.0\n----------------------------\nMariaDB 10.3.0 introduced extended syntax so that it is possible to set\ninnodb_lock_wait_timeout and lock_wait_timeout for the following statements:\n\nSyntax\n------\n\nALTER TABLE tbl_name [WAIT n|NOWAIT] ...\nCREATE ... INDEX ON tbl_name (index_col_name, ...) [WAIT n|NOWAIT] ...\nDROP INDEX ... [WAIT n|NOWAIT]\nDROP TABLE tbl_name [WAIT n|NOWAIT] ...\nLOCK TABLE ... [WAIT n|NOWAIT]\nOPTIMIZE TABLE tbl_name [WAIT n|NOWAIT]\nRENAME TABLE tbl_name [WAIT n|NOWAIT] ...\nSELECT ... FOR UPDATE [WAIT n|NOWAIT]\nSELECT ... LOCK IN SHARE MODE [WAIT n|NOWAIT]\nTRUNCATE TABLE tbl_name [WAIT n|NOWAIT]\n\nDescription\n-----------\n\nThe lock wait timeout can be explicitly set in the statement by using either\nWAIT n (to set the wait in seconds) or NOWAIT, in which case the statement\nwill immediately fail if the lock cannot be obtained. WAIT 0 is equivalent to\nNOWAIT.\n\n\n\nURL: mariadb.com/kb/en/wait-and-nowait/','','https://mariadb.com/kb/en/wait-and-nowait/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (115,8,'XA Transactions','Overview\n--------\n\nThe MariaDB XA implementation is based on the X/Open CAE document Distributed\nTransaction Processing: The XA Specification. This document is published by\nThe Open Group and available at\nhttp://www.opengroup.org/public/pubs/catalog/c193.htm.\n\nXA transactions are designed to allow distributed transactions, where a\ntransaction manager (the application) controls a transaction which involves\nmultiple resources. Such resources are usually DBMSs, but could be resources\nof any type. The whole set of required transactional operations is called a\nglobal transaction. Each subset of operations which involve a single resource\nis called a local transaction. XA used a 2-phases commit (2PC). With the first\ncommit, the transaction manager tells each resource to prepare an effective\ncommit, and waits for a confirm message. The changes are not still made\neffective at this point. If any of the resources encountered an error, the\ntransaction manager will rollback the global transaction. If all resources\ncommunicate that the first commit is successful, the transaction manager can\nrequire a second commit, which makes the changes effective.\n\nIn MariaDB, XA transactions can only be used with storage engines that support\nthem. At least InnoDB, TokuDB, SPIDER and MyRocks support them. For InnoDB,\nuntil MariaDB 10.2, XA transactions can be disabled by setting the\ninnodb_support_xa server system variable to 0. From MariaDB 10.3, XA\ntransactions are always supported.\n\nLike regular transactions, XA transactions create metadata locks on accessed\ntables.\n\nXA transactions require REPEATABLE READ as a minimum isolation level. However,\ndistributed transactions should always use SERIALIZABLE.\n\nTrying to start more than one XA transaction at the same time produces a 1400\nerror (SQLSTATE \'XAE09\'). The same error is produced when attempting to start\nan XA transaction while a regular transaction is in effect. Trying to start a\nregular transaction while an XA transaction is in effect produces a 1399 error\n(SQLSTATE \'XAE07\').\n\nThe statements that cause an implicit COMMIT for regular transactions produce\na 1400 error (SQLSTATE \'XAE09\') if a XA transaction is in effect.\n\nInternal XA vs External XA\n--------------------------\n\nXA transactions are an overloaded term in MariaDB. If a storage engine is\nXA-capable, it can mean one or both of these:\n\n* It supports MariaDB\'s internal two-phase commit API. This is transparent to\nthe user. Sometimes this is called "internal XA", since MariaDB\'s internal\ntransaction coordinator log can handle coordinating these transactions.\n\n* It supports XA transactions, with the XA START, XA PREPARE, XA COMMIT, etc.\nstatements. Sometimes this is called "external XA", since it requires the use\nof an external transaction coordinator to use this feature properly.\n\nTransaction Coordinator Log\n---------------------------\n\nIf you have two or more XA-capable storage engines enabled, then a transaction\ncoordinator log must be available.\n\nThere are currently two implementations of the transaction coordinator log:\n\n* Binary log-based transaction coordinator log\n* Memory-mapped file-based transaction coordinator log\n\nIf the binary log is enabled on a server, then the server will use the binary\nlog-based transaction coordinator log. Otherwise, it will use the\nmemory-mapped file-based transaction coordinator log.\n\nSee Transaction Coordinator Log for more information.\n\nSyntax\n------\n\nXA {START|BEGIN} xid [JOIN|RESUME]\n\nXA END xid [SUSPEND [FOR MIGRATE]]\n\nXA PREPARE xid\n\nXA COMMIT xid [ONE PHASE]\n\nXA ROLLBACK xid\n\nXA RECOVER [FORMAT=[\'RAW\'|\'SQL\']]\n\nxid: gtrid [, bqual [, formatID ]]\n\nThe interface to XA transactions is a set of SQL statements starting with XA.\nEach statement changes a transaction\'s state, determining which actions it can\nperform. A transaction which does not exist is in the NON-EXISTING state.\n\nXA START (or BEGIN) starts a transaction and defines its xid (a transaction\nidentifier). The JOIN or RESUME keywords have no effect. The new transaction\nwill be in ACTIVE state.\n\nThe xid can have 3 components, though only the first one is mandatory. gtrid\nis a quoted string representing a global transaction identifier. bqual is a\nquoted string representing a local transaction identifier. formatID is an\nunsigned integer indicating the format used for the first two components; if\nnot specified, defaults to 1. MariaDB does not interpret in any way these\ncomponents, and only uses them to identify a transaction. xids of transactions\nin effect must be unique.\n\nXA END declares that the specified ACTIVE transaction is finished and it\nchanges its state to IDLE. SUSPEND [FOR MIGRATE] has no effect.\n\nXA PREPARE prepares an IDLE transaction for commit, changing its state to\nPREPARED. This is the first commit.\n\nXA COMMIT definitely commits and terminates a transaction which has already\nbeen PREPARED. If the ONE PHASE clause is specified, this statements performs\na 1-phase commit on an IDLE transaction.\n\nXA ROLLBACK rolls back and terminates an IDLE or PREPARED transaction.\n\nXA RECOVER shows information about all PREPARED transactions.\n\nWhen trying to execute an operation which is not allowed for the transaction\'s\ncurrent state, an error is produced:\n\nXA COMMIT \'test\' ONE PHASE;\nERROR 1399 (XAE07): XAER_RMFAIL: The command cannot be executed when global\ntransaction is in the ACTIVE state\n\nXA COMMIT \'test2\';\nERROR 1399 (XAE07): XAER_RMFAIL: The command cannot be executed when global\ntransaction is in the NON-EXISTING state\n\nXA RECOVER\n----------\n\nThe XA RECOVER statement shows information about all transactions which are in\nthe PREPARED state. It does not matter which connection created the\ntransaction: if it has been PREPARED, it appears. But this does not mean that\na connection can commit or rollback a transaction which was started by another\nconnection. Note that transactions using a 1-phase commit are never in the\nPREPARED state, so they cannot be shown by XA RECOVER.\n\nXA RECOVER produces four columns:\n\nXA RECOVER;\n+----------+--------------+--------------+------+\n| formatID | gtrid_length | bqual_length | data |\n+----------+--------------+--------------+------+\n| 1 | 4 | 0 | test |\n+----------+--------------+--------------+------+\n\nMariaDB starting with 10.3.3\n----------------------------\nYou can use XA RECOVER FORMAT=\'SQL\' to get the data in a human readable form\nthat can be directly copy-pasted into XA COMMIT or XA ROLLBACK. This is\nparticularly useful for binary xid generated by some transaction coordinators.\n\nformatID is the formatID part of xid.\n\ndata are the gtrid and bqual parts of xid, concatenated.\n\ngtrid_length and bqual_length are the lengths of gtrid and bqual, respectevely.\n\nExamples\n--------\n\n2-phases commit:\n\nXA START \'test\';\n\nINSERT INTO t VALUES (1,2);\n\nXA END \'test\';\n\nXA PREPARE \'test\';\n\nXA COMMIT \'test\';\n\n1-phase commit:\n\nXA START \'test\';\n\nINSERT INTO t VALUES (1,2);\n\nXA END \'test\';\n\nXA COMMIT \'test\' ONE PHASE;\n\nHuman-readable:\n\nxa start \'12\r34\t67\v78\', \'abc\ndef\', 3;\n\ninsert t1 values (40);\n\nxa end \'12\r34\t67\v78\', \'abc\ndef\', 3;\n\nxa prepare \'12\r34\t67\v78\', \'abc\ndef\', 3;\n\nxa recover format=\'RAW\';\n+----------+--------------+--------------+--------------------+\n| formatID | gtrid_length | bqual_length | data |\n+----------+--------------+--------------+--------------------+\n34 67v78abc 11 | 7 | 12\ndef |\n+----------+--------------+--------------+--------------------+\n\nxa recover format=\'SQL\';\n+----------+--------------+--------------+-------------------------------------\n---------+\n| formatID | gtrid_length | bqual_length | data \n |\n+----------+--------------+--------------+-------------------------------------\n---------+\n| 3 | 11 | 7 |\nX\'31320d3334093637763738\',X\'6162630a646566\',3 |\n+----------+--------------+--------------+-------------------------------------\n---------+\n\nxa rollback X\'31320d3334093637763738\',X\'6162630a646566\',3;\n\nKnown Issues\n------------\n\nMariaDB Galera Cluster\n----------------------\n\nMariaDB Galera Cluster does not support XA transactions.\n\nHowever, MariaDB Galera Cluster builds include a built-in plugin called wsrep.\nPrior to MariaDB 10.4.3, this plugin was internally considered an XA-capable\nstorage engine. Consequently, these MariaDB Galera Cluster builds have\nmultiple XA-capable storage engines by default, even if the only "real"\nstorage engine that supports external XA transactions enabled on these builds\nby default is InnoDB. Therefore, when using one these builds MariaDB would be\nforced to use a transaction coordinator log by default, which could have\nperformance implications.\n\nSee Transaction Coordinator Log Overview: MariaDB Galera Cluster for more\ninformation.\n\n\n\nURL: mariadb.com/kb/en/xa-transactions/','','https://mariadb.com/kb/en/xa-transactions/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (116,10,'Account Locking','MariaDB starting with 10.4.2\n----------------------------\nAccount locking was introduced in MariaDB 10.4.2.\n\nDescription\n-----------\n\nAccount locking permits privileged administrators to lock/unlock user\naccounts. No new client connections will be permitted if an account is locked\n(existing connections are not affected).\n\nUser accounts can be locked at creation, with the CREATE USER statement, or\nmodified after creation with the ALTER USER statement. For example:\n\nCREATE USER \'lorin\'@\'localhost\' ACCOUNT LOCK;\n\nor\n\nALTER USER \'marijn\'@\'localhost\' ACCOUNT LOCK;\n\nThe server will return an ER_ACCOUNT_HAS_BEEN_LOCKED error when locked users\nattempt to connect:\n\nmysql -ulorin\n ERROR 4151 (HY000): Access denied, this account is locked\n\nThe ALTER USER statement is also used to unlock a user:\n\nALTER USER \'lorin\'@\'localhost\' ACCOUNT UNLOCK;\n\nThe SHOW CREATE USER statement will show whether the account is locked:\n\nSHOW CREATE USER \'marijn\'@\'localhost\';\n+-----------------------------------------------+\n| CREATE USER for marijn@localhost |\n+-----------------------------------------------+\n| CREATE USER \'marijn\'@\'localhost\' ACCOUNT LOCK |\n+-----------------------------------------------+\n\nas well as querying the mysql.global_priv table:\n\nSELECT CONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv)) FROM\nmysql.global_priv \n WHERE user=\'marijn\';\n+------------------------------------------------------------------------------\n-------+\n| CONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv)) \n |\n+------------------------------------------------------------------------------\n-------+\n| marijn@localhost => {\n "access": 0,\n "plugin": "mysql_native_password",\n "authentication_string": "",\n "account_locked": true,\n "password_last_changed": 1558017158\n} |\n+------------------------------------------------------------------------------\n-------+\n\n\n\nURL: mariadb.com/kb/en/account-locking/','','https://mariadb.com/kb/en/account-locking/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (117,10,'Authentication from MariaDB 10.4','MariaDB starting with 10.4\n--------------------------\nMariaDB 10.4 introduces a number of changes to the authentication process,\nintended to make things easier and more intuitive.\n\nOverview\n--------\n\nThere are four new main features in 10.4 relating to authentication:\n\n* It is possible to use more than one authentication plugin for each user\naccount. For example, this can be useful to slowly migrate users to the more\nsecure ed25519 authentication plugin over time, while allowing the old\nmysql_native_password authentication plugin as an alternative for the\ntransitional period.\n* The root@localhost user account created by mysql_install_db is created with\nthe ability to use two authentication plugins.\nFirst, it is configured to try to use the unix_socket authentication plugin.\nThis allows the root@localhost user to login without a password via the local\nUnix socket file defined by the socket system variable, as long as the login\nis attempted from a process owned by the operating system root user account.\nSecond, if authentication fails with the unix_socket authentication plugin,\nthen it is configured to try to use the mysql_native_password authentication\nplugin. However, an invalid password is initially set, so in order to\nauthenticate this way, a password must be set with SET PASSWORD.\nHowever, just using the unix_socket authentication plugin may be fine for many\nusers, and it is very secure. You may want to try going without password\nauthentication to see how well it works for you. Remember, the best way to\nkeep your password safe is not to have one!\n\n* All user accounts, passwords, and global privileges are now stored in the\nmysql.global_priv table. The mysql.user table still exists and has exactly the\nsame set of columns as before, but it’s now a view that references the\nmysql.global_priv table. Tools that analyze the mysql.user table should\ncontinue to work as before. From MariaDB 10.4.13, the dedicated mariadb.sys\nuser is created as the definer of this view. Previously root was the definer,\nwhich resulted in privilege problems when this username was changed.\n* MariaDB 10.4 adds supports for User Password Expiry, which is not active by\ndefault.\n\nDescription\n-----------\n\nAs a result of the above changes, the open-for-everyone all-powerful root\naccount is finally gone. And installation scripts will no longer demand that\nyou “PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !”, because\nthe root account is securely created automatically.\n\nTwo all-powerful accounts are created by default — root and the OS user that\nowns the data directory, typically mysql. They are created as:\n\nCREATE USER root@localhost IDENTIFIED VIA unix_socket OR mysql_native_password\nUSING \'invalid\'\nCREATE USER mysql@localhost IDENTIFIED VIA unix_socket OR\nmysql_native_password USING \'invalid\'\n\nUsing unix_socket means that if you are the system root user, you can login as\nroot@locahost without a password. This technique was pioneered by Otto\nKekäläinen in Debian MariaDB packages and has been successfully used in Debian\nsince as early as MariaDB 10.0.\n\nIt is based on a simple fact that asking the system root for a password adds\nno extra security — root has full access to all the data files and all process\nmemory anyway. But not asking for a password means, there is no root password\nto forget (no need for the numerous tutorials on “how to reset MariaDB root\npassword”). And if you want to script some tedious database work, there is no\nneed to store the root password in plain text for the script to use (no need\nfor debian-sys-maint user).\n\nStill, some users may wish to log in as MariaDB root without using sudo. Hence\nthe old authentication method — conventional MariaDB password — is still\navailable. By default it is disabled (“invalid” is not a valid password hash),\nbut one can set the password with a usual SET PASSWORD statement. And still\nretain the password-less access via sudo.\n\nIf you install MariaDB locally (say from a tarball), you would not want to use\nsudo to be able to login. This is why MariaDB creates a second all-powerful\nuser with the same name as a system user that owns the data directory. In\nlocal (not system-wide) installations, this will be the user who installed\nMariaDB — they automatically get convenient password-less root-like access,\nbecause they can access all the data files anyway.\n\nEven if MariaDB is installed system-wide, you may not want to run your\ndatabase maintenance scripts as system root — now you can run them as system\nmysql user. And you will know that they will never destroy your entire system,\neven if you make a typo in a shell script.\n\nHowever, seasoned MariaDB DBAs who are used to the old ways do need to makes\nsome changes. See the examples below for common tasks.\n\nCookbook\n--------\n\nAfter installing MariaDB system-wide the first thing you’ve got used to doing\nis logging in into the unprotected root account and protecting it, that is,\nsetting the root password:\n\n$ sudo dnf install MariaDB-server\n$ mysql -uroot\n...\nMariaDB> set password = password("XH4VmT3_jt");\n\nThis is not only unnecessary now, it will simply not work — there is no\nunprotected root account. To login as root use\n\n$ sudo dnf install MariaDB-server\n$ sudo mysql\n\nNote that it implies you are connecting via the unix socket, not tcp. If you\nhappen to have protocol=tcp in a system-wide /etc/my.cnf file, use sudo mysql\n--protocol=socket.\n\nAfter installing MariaDB locally you’ve also used to connect to the\nunprotected root account using mysql -uroot. This will not work either, simply\nuse mysql without specifying a username.\n\nIf you\'ve forgotten your root password, no problem — you can still connect\nusing sudo and change the password. And if you\'ve also removed unix_socket\nauthentication, to restore access do as follows:\n\n* restart MariaDB with --skip-grant-tables\n* login into the unprotected server\n* run FLUSH PRIVILEGES (note, before 10.4 this would’ve been the last step,\nnot anymore). This disables --skip-grant-tables and allows you to change the\nstored authentication method\n* run SET PASSWORD FOR root@localhost to change the root password.\n\nTo view inside privilege tables, the old mysql.user table still exists. You\ncan select from it as before, although you cannot update it anymore. It\ndoesn’t show alternative authentication plugins and this was one of the\nreasons for switching to the mysql.global_priv table — complex authentication\nrules did not fit into rigid structure of a relational table. You can select\nfrom the new table, for example:\n\nselect concat(user, \'@\', host, \' => \', json_detailed(priv)) from\nmysql.global_priv;\n\nReverting to the Previous Authentication Method for root@localhost\n------------------------------------------------------------------\n\nIf you don\'t want the root@localhost user account created by mysql_install_db\nto use unix_socket authentication by default, then there are a few ways to\nrevert to the previous mysql_native_password authentication method for this\nuser account.\n\nConfiguring mysql_install_db to Revert to the Previous Authentication Method\n----------------------------------------------------------------------------\n\nOne way to revert to the previous mysql_native_password authentication method\nfor the root@localhost user account is to execute mysql_install_db with a\nspecial option. If mysql_install_db is executed while\n--auth-root-authentication-method=normal is specified, then it will create the\ndefault user accounts using the default behavior of MariaDB 10.3 and before.\n\nThis means that the root@localhost user account will use mysql_native_password\nauthentication by default. There are some other differences as well. See\nmysql_install_db: User Accounts Created by Default for more information.\n\nFor example, the option can be set on the command-line while running\nmysql_install_db:\n\nmysql_install_db --user=mysql --datadir=/var/lib/mysql\n--auth-root-authentication-method=normal\n\nThe option can also be set in an option file in an option group supported by\nmysql_install_db. For example:\n\n[mysql_install_db]\nauth_root_authentication_method=normal\n\nIf the option is set in an option file and if mysql_install_db is executed,\nthen mysql_install_db will read this option from the option file, and it will\nautomatically set this option.\n\nAltering the User Account to Revert to the Previous Authentication Method\n-------------------------------------------------------------------------\n\nIf you have already installed MariaDB, and if the root@localhost user account\nis already using unix_socket authentication, then you can revert to the old\nmysql_native_password authentication method for the user account by executing\nthe following:\n\nALTER USER root@localhost IDENTIFIED VIA mysql_native_password USING\nPASSWORD("verysecret")\n\n\n\nURL: mariadb.com/kb/en/authentication-from-mariadb-104/','','https://mariadb.com/kb/en/authentication-from-mariadb-104/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (118,10,'CREATE USER','Syntax\n------\n\nCREATE [OR REPLACE] USER [IF NOT EXISTS] \n user_specification [,user_specification ...] \n [REQUIRE {NONE | tls_option [[AND] tls_option ...] }]\n [WITH resource_option [resource_option ...] ]\n [lock_option] [password_option]\n\nuser_specification:\n username [authentication_option]\n\nauthentication_option:\n IDENTIFIED BY \'password\'\n | IDENTIFIED BY PASSWORD \'password_hash\'\n | IDENTIFIED {VIA|WITH} authentication_rule [OR authentication_rule ...]\n\nauthentication_rule:\n authentication_plugin\n | authentication_plugin {USING|AS} \'authentication_string\'\n | authentication_plugin {USING|AS} PASSWORD(\'password\')\n\ntls_option:\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n\nresource_option:\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n | MAX_STATEMENT_TIME time\n\npassword_option:\n PASSWORD EXPIRE\n | PASSWORD EXPIRE DEFAULT\n | PASSWORD EXPIRE NEVER\n | PASSWORD EXPIRE INTERVAL N DAY\n\nlock_option:\n ACCOUNT LOCK\n | ACCOUNT UNLOCK\n}\n\nDescription\n-----------\n\nThe CREATE USER statement creates new MariaDB accounts. To use it, you must\nhave the global CREATE USER privilege or the INSERT privilege for the mysql\ndatabase. For each account, CREATE USER creates a new row in mysql.user (until\nMariaDB 10.3 this is a table, from MariaDB 10.4 it\'s a view) or\nmysql.global_priv_table (from MariaDB 10.4) that has no privileges.\n\nIf any of the specified accounts, or any permissions for the specified\naccounts, already exist, then the server returns ERROR 1396 (HY000). If an\nerror occurs, CREATE USER will still create the accounts that do not result in\nan error. Only one error is produced for all users which have not been created:\n\nERROR 1396 (HY000): \n Operation CREATE USER failed for \'u1\'@\'%\',\'u2\'@\'%\'\n\nCREATE USER, DROP USER, CREATE ROLE, and DROP ROLE all produce the same error\ncode when they fail.\n\nSee Account Names below for details on how account names are specified.\n\nOR REPLACE\n----------\n\nIf the optional OR REPLACE clause is used, it is basically a shortcut for:\n\nDROP USER IF EXISTS name;\nCREATE USER name ...;\n\nFor example:\n\nCREATE USER foo2@test IDENTIFIED BY \'password\';\nERROR 1396 (HY000): Operation CREATE USER failed for \'foo2\'@\'test\'\n\nCREATE OR REPLACE USER foo2@test IDENTIFIED BY \'password\';\nQuery OK, 0 rows affected (0.00 sec)\n\nIF NOT EXISTS\n-------------\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead\nof an error if the specified user already exists.\n\nFor example:\n\nCREATE USER foo2@test IDENTIFIED BY \'password\';\nERROR 1396 (HY000): Operation CREATE USER failed for \'foo2\'@\'test\'\n\nCREATE USER IF NOT EXISTS foo2@test IDENTIFIED BY \'password\';\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+----------------------------------------------------+\n| Level | Code | Message |\n+-------+------+----------------------------------------------------+\n| Note | 1973 | Can\'t create user \'foo2\'@\'test\'; it already exists |\n+-------+------+----------------------------------------------------+\n\nAuthentication Options\n----------------------\n\nIDENTIFIED BY \'password\'\n------------------------\n\nThe optional IDENTIFIED BY clause can be used to provide an account with a\npassword. The password should be specified in plain text. It will be hashed by\nthe PASSWORD function prior to being stored in the\nmysql.user/mysql.global_priv_table table.\n\nFor example, if our password is mariadb, then we can create the user with:\n\nCREATE USER foo2@test IDENTIFIED BY \'mariadb\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED BY PASSWORD \'password_hash\'\n--------------------------------------\n\nThe optional IDENTIFIED BY PASSWORD clause can be used to provide an account\nwith a password that has already been hashed. The password should be specified\nas a hash that was provided by the PASSWORD function. It will be stored in the\nmysql.user/mysql.global_priv_table table as-is.\n\nFor example, if our password is mariadb, then we can find the hash with:\n\nSELECT PASSWORD(\'mariadb\');\n+-------------------------------------------+\n| PASSWORD(\'mariadb\') |\n+-------------------------------------------+\n| *54958E764CE10E50764C2EECBB71D01F08549980 |\n+-------------------------------------------+\n1 row in set (0.00 sec)\n\nAnd then we can create a user with the hash:\n\nCREATE USER foo2@test IDENTIFIED BY PASSWORD\n\'*54958E764CE10E50764C2EECBB71D01F08549980\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED {VIA|WITH} authentication_plugin\n-------------------------------------------\n\nThe optional IDENTIFIED VIA authentication_plugin allows you to specify that\nthe account should be authenticated by a specific authentication plugin. The\nplugin name must be an active authentication plugin as per SHOW PLUGINS. If it\ndoesn\'t show up in that output, then you will need to install it with INSTALL\nPLUGIN or INSTALL SONAME.\n\nFor example, this could be used with the PAM authentication plugin:\n\nCREATE USER foo2@test IDENTIFIED VIA pam;\n\nSome authentication plugins allow additional arguments to be specified after a\nUSING or AS keyword. For example, the PAM authentication plugin accepts a\nservice name:\n\nCREATE USER foo2@test IDENTIFIED VIA pam USING \'mariadb\';\n\nThe exact meaning of the additional argument would depend on the specific\nauthentication plugin.\n\nMariaDB starting with 10.4.0\n----------------------------\nThe USING or AS keyword can also be used to provide a plain-text password to a\nplugin if it\'s provided as an argument to the PASSWORD() function. This is\nonly valid for authentication plugins that have implemented a hook for the\nPASSWORD() function. For example, the ed25519 authentication plugin supports\nthis:\n\nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 USING PASSWORD(\'secret\');\n\nMariaDB starting with 10.4.3\n----------------------------\nOne can specify many authentication plugins, they all work as alternatives\nways of authenticating a user:\n\nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 USING PASSWORD(\'secret\') OR\nunix_socket;\n\nBy default, when you create a user without specifying an authentication\nplugin, MariaDB uses the mysql_native_password plugin.\n\nTLS Options\n-----------\n\nBy default, MariaDB transmits data between the server and clients without\nencrypting it. This is generally acceptable when the server and client run on\nthe same host or in networks where security is guaranteed through other means.\nHowever, in cases where the server and client exist on separate networks or\nthey are in a high-risk network, the lack of encryption does introduce\nsecurity concerns as a malicious actor could potentially eavesdrop on the\ntraffic as it is sent over the network between them.\n\nTo mitigate this concern, MariaDB allows you to encrypt data in transit\nbetween the server and clients using the Transport Layer Security (TLS)\nprotocol. TLS was formerly known as Secure Socket Layer (SSL), but strictly\nspeaking the SSL protocol is a predecessor to TLS and, that version of the\nprotocol is now considered insecure. The documentation still uses the term SSL\noften and for compatibility reasons TLS-related server system and status\nvariables still use the prefix ssl_, but internally, MariaDB only supports its\nsecure successors.\n\nSee Secure Connections Overview for more information about how to determine\nwhether your MariaDB server has TLS support.\n\nYou can set certain TLS-related restrictions for specific user accounts. For\ninstance, you might use this with user accounts that require access to\nsensitive data while sending it across networks that you do not control. These\nrestrictions can be enabled for a user account with the CREATE USER, ALTER\nUSER, or GRANT statements. The following options are available:\n\n+---------------------------+-------------------------------------------------+\n| Option | Description |\n+---------------------------+-------------------------------------------------+\n| REQUIRE NONE | TLS is not required for this account, but can |\n| | still be used. |\n+---------------------------+-------------------------------------------------+\n| REQUIRE SSL | The account must use TLS, but no valid X509 |\n| | certificate is required. This option cannot be |\n| | combined with other TLS options. |\n+---------------------------+-------------------------------------------------+\n| REQUIRE X509 | The account must use TLS and must have a valid |\n| | X509 certificate. This option implies REQUIRE |\n| | SSL. This option cannot be combined with other |\n| | TLS options. |\n+---------------------------+-------------------------------------------------+\n| REQUIRE ISSUER \'issuer\' | The account must use TLS and must have a valid |\n| | X509 certificate. Also, the Certificate |\n| | Authority must be the one specified via the |\n| | string issuer. This option implies REQUIRE |\n| | X509. This option can be combined with the |\n| | SUBJECT, and CIPHER options in any order. |\n+---------------------------+-------------------------------------------------+\n| REQUIRE SUBJECT \'subject\' | The account must use TLS and must have a valid |\n| | X509 certificate. Also, the certificate\'s |\n| | Subject must be the one specified via the |\n| | string subject. This option implies REQUIRE |\n| | X509. This option can be combined with the |\n| | ISSUER, and CIPHER options in any order. |\n+---------------------------+-------------------------------------------------+\n| REQUIRE CIPHER \'cipher\' | The account must use TLS, but no valid X509 |\n| | certificate is required. Also, the encryption |\n| | used for the connection must use a specific |\n| | cipher method specified in the string cipher. |\n| | This option implies REQUIRE SSL. This option |\n| | can be combined with the ISSUER, and SUBJECT |\n| | options in any order. |\n+---------------------------+-------------------------------------------------+\n\nThe REQUIRE keyword must be used only once for all specified options, and the\nAND keyword can be used to separate individual options, but it is not required.\n\nFor example, you can create a user account that requires these TLS options\nwith the following:\n\nCREATE USER \'alice\'@\'%\'\n REQUIRE SUBJECT \'/CN=alice/O=My Dom, Inc./C=US/ST=Oregon/L=Portland\'\n AND ISSUER \'/C=FI/ST=Somewhere/L=City/ O=Some Company/CN=Peter\nParker/emailAddress=p.parker@marvel.com\'\n AND CIPHER \'SHA-DES-CBC3-EDH-RSA\';\n\nIf any of these options are set for a specific user account, then any client\nwho tries to connect with that user account will have to be configured to\nconnect with TLS.\n\nSee Securing Connections for Client and Server for information on how to\nenable TLS on the client and server.\n\nResource Limit Options\n----------------------\n\nMariaDB starting with 10.2.0\n----------------------------\nMariaDB 10.2.0 introduced a number of resource limit options.\n\nIt is possible to set per-account limits for certain server resources. The\nfollowing table shows the values that can be set per account:\n\n+--------------------------------------+--------------------------------------+\n| Limit Type | Decription |\n+--------------------------------------+--------------------------------------+\n| MAX_QUERIES_PER_HOUR | Number of statements that the |\n| | account can issue per hour |\n| | (including updates) |\n+--------------------------------------+--------------------------------------+\n| MAX_UPDATES_PER_HOUR | Number of updates (not queries) |\n| | that the account can issue per hour |\n+--------------------------------------+--------------------------------------+\n| MAX_CONNECTIONS_PER_HOUR | Number of connections that the |\n| | account can start per hour |\n+--------------------------------------+--------------------------------------+\n| MAX_USER_CONNECTIONS | Number of simultaneous connections |\n| | that can be accepted from the same |\n| | account; if it is 0, |\n| | max_connections will be used |\n| | instead; if max_connections is 0, |\n| | there is no limit for this |\n| | account\'s simultaneous connections. |\n+--------------------------------------+--------------------------------------+\n| MAX_STATEMENT_TIME | Timeout, in seconds, for statements |\n| | executed by the user. See also |\n| | Aborting Statements that Exceed a |\n| | Certain Time to Execute. |\n+--------------------------------------+--------------------------------------+\n\nIf any of these limits are set to 0, then there is no limit for that resource\nfor that user.\n\nHere is an example showing how to create a user with resource limits:\n\nCREATE USER \'someone\'@\'localhost\' WITH\n MAX_USER_CONNECTIONS 10\n MAX_QUERIES_PER_HOUR 200;\n\nThe resources are tracked per account, which means \'user\'@\'server\'; not per\nuser name or per connection.\n\nThe count can be reset for all users using FLUSH USER_RESOURCES, FLUSH\nPRIVILEGES or mysqladmin reload.\n\nPer account resource limits are stored in the user table, in the mysql\ndatabase. Columns used for resources limits are named max_questions,\nmax_updates, max_connections (for MAX_CONNECTIONS_PER_HOUR), and\nmax_user_connections (for MAX_USER_CONNECTIONS).\n\nAccount Names\n-------------\n\nAccount names have both a user name component and a host name component, and\nare specified as \'user_name\'@\'host_name\'.\n\nThe user name and host name may be unquoted, quoted as strings using double\nquotes (") or single quotes (\'), or quoted as identifiers using backticks (`).\nYou must use quotes when using special characters (such as a hyphen) or\nwildcard characters. If you quote, you must quote the user name and host name\nseparately (for example \'user_name\'@\'host_name\').\n\nHost Name Component\n-------------------\n\nIf the host name is not provided, it is assumed to be \'%\'.\n\nHost names may contain the wildcard characters % and _. They are matched as if\nby the LIKE clause. If you need to use a wildcard character literally (for\nexample, to match a domain name with an underscore), prefix the character with\na backslash. See LIKE for more information on escaping wildcard characters.\n\nHost name matches are case-insensitive. Host names can match either domain\nnames or IP addresses. Use \'localhost\' as the host name to allow only local\nclient connections.\n\nYou can use a netmask to match a range of IP addresses using \'base_ip/netmask\'\nas the host name. A user with an IP address ip_addr will be allowed to connect\nif the following condition is true:\n\nip_addr & netmask = base_ip\n\nFor example, given a user:\n\nCREATE USER \'maria\'@\'247.150.130.0/255.255.255.0\';\n\nthe IP addresses satisfying this condition range from 247.150.130.0 to\n247.150.130.255.\n\nUsing 255.255.255.255 is equivalent to not using a netmask at all. Netmasks\ncannot be used for IPv6 addresses.\n\nNote that the credentials added when creating a user with the \'%\' wildcard\nhost will not grant access in all cases. For example, some systems come with\nan anonymous localhost user, and when connecting from localhost this will take\nprecedence.\n\nBefore MariaDB 10.6, the host name component could be up to 60 characters in\nlength. Starting from MariaDB 10.6, it can be up to 255 characters.\n\nUser Name Component\n-------------------\n\nUser names must match exactly, including case. A user name that is empty is\nknown as an anonymous account and is allowed to match a login attempt with any\nuser name component. These are described more in the next section.\n\nFor valid identifiers to use as user names, see Identifier Names.\n\nIt is possible for more than one account to match when a user connects.\nMariaDB selects the first matching account after sorting according to the\nfollowing criteria:\n\n* Accounts with an exact host name are sorted before accounts using a wildcard\nin the\nhost name. Host names using a netmask are considered to be exact for sorting.\n* Accounts with a wildcard in the host name are sorted according to the\nposition of\nthe first wildcard character. Those with a wildcard character later in the\nhost name\nsort before those with a wildcard character earlier in the host name.\n* Accounts with a non-empty user name sort before accounts with an empty user\nname.\n* Accounts with an empty user name are sorted last. As mentioned previously,\nthese are known as anonymous accounts. These are described more in the next\nsection.\n\nThe following table shows a list of example account as sorted by these\ncriteria:\n\n+---------+-------------+\n| User | Host |\n+---------+-------------+\n| joffrey | 192.168.0.3 |\n| | 192.168.0.% |\n| joffrey | 192.168.% |\n| | 192.168.% |\n+---------+-------------+\n\nOnce connected, you only have the privileges granted to the account that\nmatched, not all accounts that could have matched. For example, consider the\nfollowing commands:\n\nCREATE USER \'joffrey\'@\'192.168.0.3\';\nCREATE USER \'joffrey\'@\'%\';\nGRANT SELECT ON test.t1 to \'joffrey\'@\'192.168.0.3\';\nGRANT SELECT ON test.t2 to \'joffrey\'@\'%\';\n\nIf you connect as joffrey from 192.168.0.3, you will have the SELECT privilege\non the table test.t1, but not on the table test.t2. If you connect as joffrey\nfrom any other IP address, you will have the SELECT privilege on the table\ntest.t2, but not on the table test.t1.\n\nUsernames can be up to 80 characters long before 10.6 and starting from 10.6\nit can be 128 characters long.\n\nAnonymous Accounts\n------------------\n\nAnonymous accounts are accounts where the user name portion of the account\nname is empty. These accounts act as special catch-all accounts. If a user\nattempts to log into the system from a host, and an anonymous account exists\nwith a host name portion that matches the user\'s host, then the user will log\nin as the anonymous account if there is no more specific account match for the\nuser name that the user entered.\n\nFor example, here are some anonymous accounts:\n\nCREATE USER \'\'@\'localhost\';\nCREATE USER \'\'@\'192.168.0.3\';\n\nFixing a Legacy Default Anonymous Account\n-----------------------------------------\n\nOn some systems, the mysql.db table has some entries for the \'\'@\'%\' anonymous\naccount by default. Unfortunately, there is no matching entry in the\nmysql.user/mysql.global_priv_table table, which means that this anonymous\naccount doesn\'t exactly exist, but it does have privileges--usually on the\ndefault test database created by mysql_install_db. These account-less\nprivileges are a legacy that is leftover from a time when MySQL\'s privilege\nsystem was less advanced.\n\nThis situation means that you will run into errors if you try to create a\n\'\'@\'%\' account. For example:\n\nCREATE USER \'\'@\'%\';\nERROR 1396 (HY000): Operation CREATE USER failed for \'\'@\'%\'\n\nThe fix is to DELETE the row in the mysql.db table and then execute FLUSH\nPRIVILEGES:\n\nDELETE FROM mysql.db WHERE User=\'\' AND Host=\'%\';\nFLUSH PRIVILEGES;\n\nAnd then the account can be created:\n\nCREATE USER \'\'@\'%\';\nQuery OK, 0 rows affected (0.01 sec)\n\nSee MDEV-13486 for more information.\n\nPassword Expiry\n---------------\n\nMariaDB starting with 10.4.3\n----------------------------\nBesides automatic password expiry, as determined by default_password_lifetime,\npassword expiry times can be set on an individual user basis, overriding the\nglobal setting, for example:\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\n\nSee User Password Expiry for more details.\n\nAccount Locking\n---------------\n\nMariaDB starting with 10.4.2\n----------------------------\nAccount locking permits privileged administrators to lock/unlock user\naccounts. No new client connections will be permitted if an account is locked\n(existing connections are not affected). For example:\n\nCREATE USER \'marijn\'@\'localhost\' ACCOUNT LOCK;\n\nSee Account Locking for more details.\n\nFrom MariaDB 10.4.7 and MariaDB 10.5.8, the lock_option and password_option\nclauses can occur in either order.\n\n\n\nURL: mariadb.com/kb/en/create-user/','','https://mariadb.com/kb/en/create-user/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (119,10,'ALTER USER','MariaDB starting with 10.2.0\n----------------------------\nThe ALTER USER statement was introduced in MariaDB 10.2.0.\n\nSyntax\n------\n\nALTER USER [IF EXISTS] \n user_specification [,user_specification] ...\n [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]\n [WITH resource_option [resource_option] ...]\n [lock_option] [password_option]\n\nuser_specification:\n username [authentication_option]\n\nauthentication_option:\n IDENTIFIED BY \'password\'\n | IDENTIFIED BY PASSWORD \'password_hash\'\n | IDENTIFIED {VIA|WITH} authentication_rule [OR authentication_rule] ...\n\nauthentication_rule:\n authentication_plugin\n | authentication_plugin {USING|AS} \'authentication_string\'\n | authentication_plugin {USING|AS} PASSWORD(\'password\')\n\ntls_option\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n\nresource_option\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n | MAX_STATEMENT_TIME time\n\npassword_option:\n PASSWORD EXPIRE\n | PASSWORD EXPIRE DEFAULT\n | PASSWORD EXPIRE NEVER\n | PASSWORD EXPIRE INTERVAL N DAY\n\nlock_option:\n ACCOUNT LOCK\n | ACCOUNT UNLOCK\n}\n\nDescription\n-----------\n\nThe ALTER USER statement modifies existing MariaDB accounts. To use it, you\nmust have the global CREATE USER privilege or the UPDATE privilege for the\nmysql database. The global SUPER privilege is also required if the read_only\nsystem variable is enabled.\n\nIf any of the specified user accounts do not yet exist, an error results. If\nan error occurs, ALTER USER will still modify the accounts that do not result\nin an error. Only one error is produced for all users which have not been\nmodified.\n\nIF EXISTS\n---------\n\nWhen the IF EXISTS clause is used, MariaDB will return a warning instead of an\nerror for each specified user that does not exist.\n\nAccount Names\n-------------\n\nFor ALTER USER statements, account names are specified as the username\nargument in the same way as they are for CREATE USER statements. See account\nnames from the CREATE USER page for details on how account names are specified.\n\nCURRENT_USER or CURRENT_USER() can also be used to alter the account logged\ninto the current session. For example, to change the current user\'s password\nto mariadb:\n\nALTER USER CURRENT_USER() IDENTIFIED BY \'mariadb\';\n\nAuthentication Options\n----------------------\n\nMariaDB starting with 10.4\n--------------------------\nFrom MariaDB 10.4, it is possible to use more than one authentication plugin\nfor each user account. For example, this can be useful to slowly migrate users\nto the more secure ed25519 authentication plugin over time, while allowing the\nold mysql_native_password authentication plugin as an alternative for the\ntransitional period. See Authentication from MariaDB 10.4 for more.\n\nWhen running ALTER USER, not specifying an authentication option in the\nIDENTIFIED VIA clause will remove that authentication method. (However this\nwas not the case before MariaDB 10.4.13, see MDEV-21928)\n\nFor example, a user is created with the ability to authenticate via both a\npassword and unix_socket:\n\nCREATE USER \'bob\'@\'localhost\' \n IDENTIFIED VIA mysql_native_password USING PASSWORD(\'pwd\')\n OR unix_socket;\n\nSHOW CREATE USER \'bob\'@\'localhost\'\G\n*************************** 1. row ***************************\nCREATE USER for bob@localhost: CREATE USER `bob`@`localhost` \n IDENTIFIED VIA mysql_native_password\n USING \'*975B2CD4FF9AE554FE8AD33168FBFC326D2021DD\'\n OR unix_socket\n\nIf the user\'s password is updated, but unix_socket authentication is not\nspecified in the IDENTIFIED VIA clause, unix_socket authentication will no\nlonger be permitted.\n\nALTER USER \'bob\'@\'localhost\' IDENTIFIED VIA mysql_native_password \n USING PASSWORD(\'pwd2\');\n\nSHOW CREATE USER \'bob\'@\'localhost\'\G\n*************************** 1. row ***************************\nCREATE USER for bob@localhost: CREATE USER `bob`@`localhost` \n IDENTIFIED BY PASSWORD \'*38366FDA01695B6A5A9DD4E428D9FB8F7EB75512\'\n\nIDENTIFIED BY \'password\'\n------------------------\n\nThe optional IDENTIFIED BY clause can be used to provide an account with a\npassword. The password should be specified in plain text. It will be hashed by\nthe PASSWORD function prior to being stored to the mysql.user table.\n\nFor example, if our password is mariadb, then we can set the account\'s\npassword with:\n\nALTER USER foo2@test IDENTIFIED BY \'mariadb\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED BY PASSWORD \'password_hash\'\n--------------------------------------\n\nThe optional IDENTIFIED BY PASSWORD clause can be used to provide an account\nwith a password that has already been hashed. The password should be specified\nas a hash that was provided by the PASSWORD#function. It will be stored to the\nmysql.user table as-is.\n\nFor example, if our password is mariadb, then we can find the hash with:\n\nSELECT PASSWORD(\'mariadb\');\n+-------------------------------------------+\n| PASSWORD(\'mariadb\') |\n+-------------------------------------------+\n| *54958E764CE10E50764C2EECBB71D01F08549980 |\n+-------------------------------------------+\n\nAnd then we can set an account\'s password with the hash:\n\nALTER USER foo2@test \n IDENTIFIED BY PASSWORD \'*54958E764CE10E50764C2EECBB71D01F08549980\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED {VIA|WITH} authentication_plugin\n-------------------------------------------\n\nThe optional IDENTIFIED VIA authentication_plugin allows you to specify that\nthe account should be authenticated by a specific authentication plugin. The\nplugin name must be an active authentication plugin as per SHOW PLUGINS. If it\ndoesn\'t show up in that output, then you will need to install it with INSTALL\nPLUGIN or INSTALL SONAME.\n\nFor example, this could be used with the PAM authentication plugin:\n\nALTER USER foo2@test IDENTIFIED VIA pam;\n\nSome authentication plugins allow additional arguments to be specified after a\nUSING or AS keyword. For example, the PAM authentication plugin accepts a\nservice name:\n\nALTER USER foo2@test IDENTIFIED VIA pam USING \'mariadb\';\n\nThe exact meaning of the additional argument would depend on the specific\nauthentication plugin.\n\nIn MariaDB 10.4 and later, the USING or AS keyword can also be used to provide\na plain-text password to a plugin if it\'s provided as an argument to the\nPASSWORD() function. This is only valid for authentication plugins that have\nimplemented a hook for the PASSWORD() function. For example, the ed25519\nauthentication plugin supports this:\n\nALTER USER safe@\'%\' IDENTIFIED VIA ed25519 USING PASSWORD(\'secret\');\n\nTLS Options\n-----------\n\nBy default, MariaDB transmits data between the server and clients without\nencrypting it. This is generally acceptable when the server and client run on\nthe same host or in networks where security is guaranteed through other means.\nHowever, in cases where the server and client exist on separate networks or\nthey are in a high-risk network, the lack of encryption does introduce\nsecurity concerns as a malicious actor could potentially eavesdrop on the\ntraffic as it is sent over the network between them.\n\nTo mitigate this concern, MariaDB allows you to encrypt data in transit\nbetween the server and clients using the Transport Layer Security (TLS)\nprotocol. TLS was formerly known as Secure Socket Layer (SSL), but strictly\nspeaking the SSL protocol is a predecessor to TLS and, that version of the\nprotocol is now considered insecure. The documentation still uses the term SSL\noften and for compatibility reasons TLS-related server system and status\nvariables still use the prefix ssl_, but internally, MariaDB only supports its\nsecure successors.\n\nSee Secure Connections Overview for more information about how to determine\nwhether your MariaDB server has TLS support.\n\nYou can set certain TLS-related restrictions for specific user accounts. For\ninstance, you might use this with user accounts that require access to\nsensitive data while sending it across networks that you do not control. These\nrestrictions can be enabled for a user account with the CREATE USER, ALTER\nUSER, or GRANT statements. The following options are available:\n\n+---------------------------+-------------------------------------------------+\n| Option | Description |\n+---------------------------+-------------------------------------------------+\n| REQUIRE NONE | TLS is not required for this account, but can |\n| | still be used. |\n+---------------------------+-------------------------------------------------+\n| REQUIRE SSL | The account must use TLS, but no valid X509 |\n| | certificate is required. This option cannot be |\n| | combined with other TLS options. |\n+---------------------------+-------------------------------------------------+\n| REQUIRE X509 | The account must use TLS and must have a valid |\n| | X509 certificate. This option implies REQUIRE |\n| | SSL. This option cannot be combined with other |\n| | TLS options. |\n+---------------------------+-------------------------------------------------+\n| REQUIRE ISSUER \'issuer\' | The account must use TLS and must have a valid |\n| | X509 certificate. Also, the Certificate |\n| | Authority must be the one specified via the |\n| | string issuer. This option implies REQUIRE |\n| | X509. This option can be combined with the |\n| | SUBJECT, and CIPHER options in any order. |\n+---------------------------+-------------------------------------------------+\n| REQUIRE SUBJECT \'subject\' | The account must use TLS and must have a valid |\n| | X509 certificate. Also, the certificate\'s |\n| | Subject must be the one specified via the |\n| | string subject. This option implies REQUIRE |\n| | X509. This option can be combined with the |\n| | ISSUER, and CIPHER options in any order. |\n+---------------------------+-------------------------------------------------+\n| REQUIRE CIPHER \'cipher\' | The account must use TLS, but no valid X509 |\n| | certificate is required. Also, the encryption |\n| | used for the connection must use a specific |\n| | cipher method specified in the string cipher. |\n| | This option implies REQUIRE SSL. This option |\n| | can be combined with the ISSUER, and SUBJECT |\n| | options in any order. |\n+---------------------------+-------------------------------------------------+\n\nThe REQUIRE keyword must be used only once for all specified options, and the\nAND keyword can be used to separate individual options, but it is not required.\n\nFor example, you can alter a user account to require these TLS options with\nthe following:\n\nALTER USER \'alice\'@\'%\'\n REQUIRE SUBJECT \'/CN=alice/O=My Dom, Inc./C=US/ST=Oregon/L=Portland\' AND\n ISSUER \'/C=FI/ST=Somewhere/L=City/ O=Some Company/CN=Peter\nParker/emailAddress=p.parker@marvel.com\'\n AND CIPHER \'SHA-DES-CBC3-EDH-RSA\';\n\nIf any of these options are set for a specific user account, then any client\nwho tries to connect with that user account will have to be configured to\nconnect with TLS.\n\nSee Securing Connections for Client and Server for information on how to\nenable TLS on the client and server.\n\nResource Limit Options\n----------------------\n\nMariaDB starting with 10.2.0\n----------------------------\nMariaDB 10.2.0 introduced a number of resource limit options.\n\nIt is possible to set per-account limits for certain server resources. The\nfollowing table shows the values that can be set per account:\n\n+------------------------------------+----------------------------------------+\n| Limit Type | Description |\n+------------------------------------+----------------------------------------+\n| MAX_QUERIES_PER_HOUR | Number of statements that the account |\n| | can issue per hour (including updates) |\n+------------------------------------+----------------------------------------+\n| MAX_UPDATES_PER_HOUR | Number of updates (not queries) that |\n| | the account can issue per hour |\n+------------------------------------+----------------------------------------+\n| MAX_CONNECTIONS_PER_HOUR | Number of connections that the |\n| | account can start per hour |\n+------------------------------------+----------------------------------------+\n| MAX_USER_CONNECTIONS | Number of simultaneous connections |\n| | that can be accepted from the same |\n| | account; if it is 0, max_connections |\n| | will be used instead; if |\n| | max_connections is 0, there is no |\n| | limit for this account\'s simultaneous |\n| | connections. |\n+------------------------------------+----------------------------------------+\n| MAX_STATEMENT_TIME | Timeout, in seconds, for statements |\n| | executed by the user. See also |\n| | Aborting Statements that Exceed a |\n| | Certain Time to Execute. |\n+------------------------------------+----------------------------------------+\n\nIf any of these limits are set to 0, then there is no limit for that resource\nfor that user.\n\nHere is an example showing how to set an account\'s resource limits:\n\nALTER USER \'someone\'@\'localhost\' WITH\n MAX_USER_CONNECTIONS 10\n MAX_QUERIES_PER_HOUR 200;\n\nThe resources are tracked per account, which means \'user\'@\'server\'; not per\nuser name or per connection.\n\nThe count can be reset for all users using FLUSH USER_RESOURCES, FLUSH\nPRIVILEGES or mysqladmin reload.\n\nPer account resource limits are stored in the user table, in the mysql\ndatabase. Columns used for resources limits are named max_questions,\nmax_updates, max_connections (for MAX_CONNECTIONS_PER_HOUR), and\nmax_user_connections (for MAX_USER_CONNECTIONS).\n\nPassword Expiry\n---------------\n\nMariaDB starting with 10.4.3\n----------------------------\nBesides automatic password expiry, as determined by default_password_lifetime,\npassword expiry times can be set on an individual user basis, overriding the\nglobal setting, for example:\n\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE NEVER;\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n\nSee User Password Expiry for more details.\n\nAccount Locking\n---------------\n\nMariaDB starting with 10.4.2\n----------------------------\nAccount locking permits privileged administrators to lock/unlock user\naccounts. No new client connections will be permitted if an account is locked\n(existing connections are not affected). For example:\n\nALTER USER \'marijn\'@\'localhost\' ACCOUNT LOCK;\n\nSee Account Locking for more details.\n\nFrom MariaDB 10.4.7 and MariaDB 10.5.8, the lock_option and password_option\nclauses can occur in either order.\n\n\n\nURL: mariadb.com/kb/en/alter-user/','','https://mariadb.com/kb/en/alter-user/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (120,10,'DROP USER','Syntax\n------\n\nDROP USER [IF EXISTS] user_name [, user_name] ...\n\nDescription\n-----------\n\nThe DROP USER statement removes one or more MariaDB accounts. It removes\nprivilege rows for the account from all grant tables. To use this statement,\nyou must have the global CREATE USER privilege or the DELETE privilege for the\nmysql database. Each account is named using the same format as for the CREATE\nUSER statement; for example, \'jeffrey\'@\'localhost\'. If you specify only the\nuser name part of the account name, a host name part of \'%\' is used. For\nadditional information about specifying account names, see CREATE USER.\n\nNote that, if you specify an account that is currently connected, it will not\nbe deleted until the connection is closed. The connection will not be\nautomatically closed.\n\nIf any of the specified user accounts do not exist, ERROR 1396 (HY000)\nresults. If an error occurs, DROP USER will still drop the accounts that do\nnot result in an error. Only one error is produced for all users which have\nnot been dropped:\n\nERROR 1396 (HY000): Operation DROP USER failed for \'u1\'@\'%\',\'u2\'@\'%\'\n\nFailed CREATE or DROP operations, for both users and roles, produce the same\nerror code.\n\nIF EXISTS\n---------\n\nIf the IF EXISTS clause is used, MariaDB will return a note instead of an\nerror if the user does not exist.\n\nExamples\n--------\n\nDROP USER bob;\n\nIF EXISTS:\n\nDROP USER bob;\nERROR 1396 (HY000): Operation DROP USER failed for \'bob\'@\'%\'\n\nDROP USER IF EXISTS bob;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+---------------------------------------------+\n| Level | Code | Message |\n+-------+------+---------------------------------------------+\n| Note | 1974 | Can\'t drop user \'bob\'@\'%\'; it doesn\'t exist |\n+-------+------+---------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/drop-user/','','https://mariadb.com/kb/en/drop-user/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (121,10,'GRANT','Syntax\n------\n\nGRANT\n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n TO user_specification [ user_options ...]\n\nuser_specification:\n username [authentication_option]\n\nauthentication_option:\n IDENTIFIED BY \'password\'\n | IDENTIFIED BY PASSWORD \'password_hash\'\n | IDENTIFIED {VIA|WITH} authentication_rule [OR authentication_rule ...]\n\nauthentication_rule:\n authentication_plugin\n | authentication_plugin {USING|AS} \'authentication_string\'\n | authentication_plugin {USING|AS} PASSWORD(\'password\')\n\nGRANT PROXY ON username\n TO user_specification [, user_specification ...]\n [WITH GRANT OPTION]\n\nGRANT rolename TO grantee [, grantee ...]\n [WITH ADMIN OPTION]\n\ngrantee:\n rolename\n username [authentication_option]\n\nuser_options:\n [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]\n [WITH with_option [with_option] ...]\n\nobject_type:\n TABLE\n | FUNCTION\n | PROCEDURE\n | PACKAGE\n\npriv_level:\n *\n | *.*\n | db_name.*\n | db_name.tbl_name\n | tbl_name\n | db_name.routine_name\n\nwith_option:\n GRANT OPTION\n | resource_option\n\nresource_option:\n MAX_QUERIES_PER_HOUR count\n | MAX_UPDATES_PER_HOUR count\n | MAX_CONNECTIONS_PER_HOUR count\n | MAX_USER_CONNECTIONS count\n | MAX_STATEMENT_TIME time\n\ntls_option:\n SSL\n | X509\n | CIPHER \'cipher\'\n | ISSUER \'issuer\'\n | SUBJECT \'subject\'\n\nDescription\n-----------\n\nThe GRANT statement allows you to grant privileges or roles to accounts. To\nuse GRANT, you must have the GRANT OPTION privilege, and you must have the\nprivileges that you are granting.\n\nUse the REVOKE statement to revoke privileges granted with the GRANT statement.\n\nUse the SHOW GRANTS statement to determine what privileges an account has.\n\nAccount Names\n-------------\n\nFor GRANT statements, account names are specified as the username argument in\nthe same way as they are for CREATE USER statements. See account names from\nthe CREATE USER page for details on how account names are specified.\n\nImplicit Account Creation\n-------------------------\n\nThe GRANT statement also allows you to implicitly create accounts in some\ncases.\n\nIf the account does not yet exist, then GRANT can implicitly create it. To\nimplicitly create an account with GRANT, a user is required to have the same\nprivileges that would be required to explicitly create the account with the\nCREATE USER statement.\n\nIf the NO_AUTO_CREATE_USER SQL_MODE is set, then accounts can only be created\nif authentication information is specified, or with a CREATE USER statement.\nIf no authentication information is provided, GRANT will produce an error when\nthe specified account does not exist, for example:\n\nshow variables like \'%sql_mode%\' ;\n+---------------+--------------------------------------------+\n| Variable_name | Value |\n+---------------+--------------------------------------------+\n| sql_mode | NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |\n+---------------+--------------------------------------------+\n\nGRANT USAGE ON *.* TO \'user123\'@\'%\' IDENTIFIED BY \'\';\nERROR 1133 (28000): Can\'t find any matching row in the user table\n\nGRANT USAGE ON *.* TO \'user123\'@\'%\' \n IDENTIFIED VIA PAM using \'mariadb\' require ssl ;\nQuery OK, 0 rows affected (0.00 sec)\n\nselect host, user from mysql.user where user=\'user123\' ;\n\n+------+----------+\n| host | user |\n+------+----------+\n| % | user123 |\n+------+----------+\n\nPrivilege Levels\n----------------\n\nPrivileges can be set globally, for an entire database, for a table or\nroutine, or for individual columns in a table. Certain privileges can only be\nset at certain levels.\n\n* Global privileges priv_type are granted using *.* for\npriv_level. Global privileges include privileges to administer the database\nand manage user accounts, as well as privileges for all tables, functions, and\nprocedures. Global privileges are stored in the mysql.user table prior to\nMariaDB 10.4, and in mysql.global_priv table afterwards.\n* Database privileges priv_type are granted using db_name.*\nfor priv_level, or using just * to use default database. Database\nprivileges include privileges to create tables and functions, as well as\nprivileges for all tables, functions, and procedures in the database. Database\nprivileges are stored in the mysql.db table.\n* Table privileges priv_type are granted using db_name.tbl_name\nfor priv_level, or using just tbl_name to specify a table in the default\ndatabase. The TABLE keyword is optional. Table privileges include the\nability to select and change data in the table. Certain table privileges can\nbe granted for individual columns.\n* Column privileges priv_type are granted by specifying a table for\npriv_level and providing a column list after the privilege type. They allow\nyou to control exactly which columns in a table users can select and change.\n* Function privileges priv_type are granted using FUNCTION db_name.routine_name\nfor priv_level, or using just FUNCTION routine_name to specify a function\nin the default database.\n* Procedure privileges priv_type are granted using PROCEDURE\ndb_name.routine_name\nfor priv_level, or using just PROCEDURE routine_name to specify a procedure\nin the default database.\n\nThe USAGE Privilege\n-------------------\n\nThe USAGE privilege grants no real privileges. The SHOW GRANTS statement will\nshow a global USAGE privilege for a newly-created user. You can use USAGE with\nthe GRANT statement to change options like GRANT OPTION and\nMAX_USER_CONNECTIONS without changing any account privileges.\n\nThe ALL PRIVILEGES Privilege\n----------------------------\n\nThe ALL PRIVILEGES privilege grants all available privileges. Granting all\nprivileges only affects the given privilege level. For example, granting all\nprivileges on a table does not grant any privileges on the database or\nglobally.\n\nUsing ALL PRIVILEGES does not grant the special GRANT OPTION privilege.\n\nYou can use ALL instead of ALL PRIVILEGES.\n\nThe GRANT OPTION Privilege\n--------------------------\n\nUse the WITH GRANT OPTION clause to give users the ability to grant privileges\nto other users at the given privilege level. Users with the GRANT OPTION\nprivilege can only grant privileges they have. They cannot grant privileges at\na higher privilege level than they have the GRANT OPTION privilege.\n\nThe GRANT OPTION privilege cannot be set for individual columns. If you use\nWITH GRANT OPTION when specifying column privileges, the GRANT OPTION\nprivilege will be granted for the entire table.\n\nUsing the WITH GRANT OPTION clause is equivalent to listing GRANT OPTION as a\nprivilege.\n\nGlobal Privileges\n-----------------\n\nThe following table lists the privileges that can be granted globally. You can\nalso grant all database, table, and function privileges globally. When granted\nglobally, these privileges apply to all databases, tables, or functions,\nincluding those created later.\n\nTo set a global privilege, use *.* for priv_level.\n\nBINLOG ADMIN\n------------\n\nEnables administration of the binary log, including the PURGE BINARY LOGS\nstatement and setting the system variables:\n\n* binlog_annotate_row_events\n* binlog_cache_size\n* binlog_commit_wait_count\n* binlog_commit_wait_usec\n* binlog_direct_non_transactional_updates\n* binlog_expire_logs_seconds\n* binlog_file_cache_size\n* binlog_format\n* binlog_row_image\n* binlog_row_metadata\n* binlog_stmt_cache_size\n* expire_logs_days\n* log_bin_compress\n* log_bin_compress_min_len\n* log_bin_trust_function_creators\n* max_binlog_cache_size\n* max_binlog_size\n* max_binlog_stmt_cache_size\n* sql_log_bin and\n* sync_binlog.\n\nAdded in MariaDB 10.5.2.\n\nBINLOG MONITOR\n--------------\n\nNew name for REPLICATION CLIENT from MariaDB 10.5.2, (REPLICATION CLIENT still\nsupported as an alias for compatibility purposes). Permits running SHOW\ncommands related to the binary log, in particular the SHOW BINLOG STATUS and\nSHOW BINARY LOGS statements. Unlike REPLICATION CLIENT prior to MariaDB 10.5,\nSHOW REPLICA STATUS isn\'t included in this privilege, and REPLICA MONITOR is\nrequired.\n\nBINLOG REPLAY\n-------------\n\nEnables replaying the binary log with the BINLOG statement (generated by\nmariadb-binlog), executing SET timestamp when secure_timestamp is set to\nreplication, and setting the session values of system variables usually\nincluded in BINLOG output, in particular:\n\n* gtid_domain_id\n* gtid_seq_no\n* pseudo_thread_id\n* server_id.\n\nAdded in MariaDB 10.5.2\n\nCONNECTION ADMIN\n----------------\n\nEnables administering connection resource limit options. This includes\nignoring the limits specified by:\n\n* max_connections\n* max_user_connections and\n* max_password_errors.\n\nThe statements specified in init_connect are not executed, killing connections\nand queries owned by other users is permitted. The following\nconnection-related system variables can be changed:\n\n* connect_timeout\n* disconnect_on_expired_password\n* extra_max_connections\n* init_connect\n* max_connections\n* max_connect_errors\n* max_password_errors\n* proxy_protocol_networks\n* secure_auth\n* slow_launch_time\n* thread_pool_exact_stats\n* thread_pool_dedicated_listener\n* thread_pool_idle_timeout\n* thread_pool_max_threads\n* thread_pool_min_threads\n* thread_pool_oversubscribe\n* thread_pool_prio_kickup_timer\n* thread_pool_priority\n* thread_pool_size, and\n* thread_pool_stall_limit.\n\nAdded in MariaDB 10.5.2.\n\nCREATE USER\n-----------\n\nCreate a user using the CREATE USER statement, or implicitly create a user\nwith the GRANT statement.\n\nFEDERATED ADMIN\n---------------\n\nExecute CREATE SERVER, ALTER SERVER, and DROP SERVER statements. Added in\nMariaDB 10.5.2.\n\nFILE\n----\n\nRead and write files on the server, using statements like LOAD DATA INFILE or\nfunctions like LOAD_FILE(). Also needed to create CONNECT outward tables.\nMariaDB server must have the permissions to access those files.\n\nGRANT OPTION\n------------\n\nGrant global privileges. You can only grant privileges that you have.\n\nPROCESS\n-------\n\nShow information about the active processes, for example via SHOW PROCESSLIST\nor mysqladmin processlist. If you have the PROCESS privilege, you can see all\nthreads. Otherwise, you can see only your own threads (that is, threads\nassociated with the MariaDB account that you are using).\n\nREAD_ONLY ADMIN\n---------------\n\nUser can set the read_only system variable and allows the user to perform\nwrite operations, even when the read_only option is active. Added in MariaDB\n10.5.2.\n\nRELOAD\n------\n\nExecute FLUSH statements or equivalent mariadb-admin/mysqladmin commands.\n\nREPLICATION CLIENT\n------------------\n\nExecute SHOW MASTER STATUS and SHOW BINARY LOGS informative statements.\nRenamed to BINLOG MONITOR in MariaDB 10.5.2 (but still supported as an alias\nfor compatibility reasons). SHOW SLAVE STATUS was part of REPLICATION CLIENT\nprior to MariaDB 10.5.\n\nREPLICATION MASTER ADMIN\n------------------------\n\nPermits administration of primary servers, including the SHOW REPLICA HOSTS\nstatement, and setting the gtid_binlog_state, gtid_domain_id,\nmaster_verify_checksum and server_id system variables. Added in MariaDB 10.5.2.\n\nREPLICA MONITOR\n---------------\n\nPermit SHOW REPLICA STATUS and SHOW RELAYLOG EVENTS. From MariaDB 10.5.9.\n\nWhen a user would upgrade from an older major release to a MariaDB 10.5 minor\nrelease prior to MariaDB 10.5.9, certain user accounts would lose\ncapabilities. For example, a user account that had the REPLICATION CLIENT\nprivilege in older major releases could run SHOW REPLICA STATUS, but after\nupgrading to a MariaDB 10.5 minor release prior to MariaDB 10.5.9, they could\nno longer run SHOW REPLICA STATUS, because that statement was changed to\nrequire the REPLICATION REPLICA ADMIN privilege.\n\nThis issue is fixed in MariaDB 10.5.9 with this new privilege, which now\ngrants the user the ability to execute SHOW [ALL] (SLAVE | REPLICA) STATUS.\n\nWhen a database is upgraded from an older major release to MariaDB Server\n10.5.9 or later, any user accounts with the REPLICATION CLIENT or REPLICATION\nSLAVE privileges will automatically be granted the new REPLICA MONITOR\nprivilege. The privilege fix occurs when the server is started up, not when\nmariadb-upgrade is performed.\n\nHowever, when a database is upgraded from an early 10.5 minor release to\n10.5.9 and later, the user will have to fix any user account privileges\nmanually.\n\nREPLICATION REPLICA\n-------------------\n\nSynonym for REPLICATION SLAVE. From MariaDB 10.5.1.\n\nREPLICATION SLAVE\n-----------------\n\nAccounts used by replica servers on the primary need this privilege. This is\nneeded to get the updates made on the master. From MariaDB 10.5.1, REPLICATION\nREPLICA is an alias for REPLICATION SLAVE.\n\nREPLICATION SLAVE ADMIN\n-----------------------\n\nPermits administering replica servers, including START REPLICA/SLAVE, STOP\nREPLICA/SLAVE, CHANGE MASTER, SHOW REPLICA/SLAVE STATUS, SHOW RELAYLOG EVENTS\nstatements, replaying the binary log with the BINLOG statement (generated by\nmariadb-binlog), and setting the system variables:\n\n* gtid_cleanup_batch_size\n* gtid_ignore_duplicates\n* gtid_pos_auto_engines\n* gtid_slave_pos\n* gtid_strict_mode\n* init_slave\n* read_binlog_speed_limit\n* relay_log_purge\n* relay_log_recovery\n* replicate_do_db\n* replicate_do_table\n* replicate_events_marked_for_skip\n* replicate_ignore_db\n* replicate_ignore_table\n* replicate_wild_do_table\n* replicate_wild_ignore_table\n* slave_compressed_protocol\n* slave_ddl_exec_mode\n* slave_domain_parallel_threads\n* slave_exec_mode\n* slave_max_allowed_packet\n* slave_net_timeout\n* slave_parallel_max_queued\n* slave_parallel_mode\n* slave_parallel_threads\n* slave_parallel_workers\n* slave_run_triggers_for_rbr\n* slave_sql_verify_checksum\n* slave_transaction_retry_interval\n* slave_type_conversions\n* sync_master_info\n* sync_relay_log, and\n* sync_relay_log_info.\n\nAdded in MariaDB 10.5.2.\n\nSET USER\n--------\n\nEnables setting the DEFINER when creating triggers, views, stored functions\nand stored procedures. Added in MariaDB 10.5.2.\n\nSHOW DATABASES\n--------------\n\nList all databases using the SHOW DATABASES statement. Without the SHOW\nDATABASES privilege, you can still issue the SHOW DATABASES statement, but it\nwill only list databases containing tables on which you have privileges.\n\nSHUTDOWN\n--------\n\nShut down the server using SHUTDOWN or the mysqladmin shutdown command.\n\nSUPER\n-----\n\nExecute superuser statements: CHANGE MASTER TO, KILL (users who do not have\nthis privilege can only KILL their own threads), PURGE LOGS, SET global system\nvariables, or the mysqladmin debug command. Also, this permission allows the\nuser to write data even if the read_only startup option is set, enable or\ndisable logging, enable or disable replication on replica, specify a DEFINER\nfor statements that support that clause, connect once reaching the\nMAX_CONNECTIONS. If a statement has been specified for the init-connect mysqld\noption, that command will not be executed when a user with SUPER privileges\nconnects to the server.\n\nThe SUPER privilege has been split into multiple smaller privileges from\nMariaDB 10.5.2 to allow for more fine-grained privileges, although it remains\nan alias for these smaller privileges.\n\nDatabase Privileges\n-------------------\n\nThe following table lists the privileges that can be granted at the database\nlevel. You can also grant all table and function privileges at the database\nlevel. Table and function privileges on a database apply to all tables or\nfunctions in that database, including those created later.\n\nTo set a privilege for a database, specify the database using db_name.* for\npriv_level, or just use * to specify the default database.\n\n+----------------------------------+------------------------------------------+\n| Privilege | Description |\n+----------------------------------+------------------------------------------+\n| CREATE | Create a database using the CREATE |\n| | DATABASE statement, when the privilege |\n| | is granted for a database. You can |\n| | grant the CREATE privilege on databases |\n| | that do not yet exist. This also grants |\n| | the CREATE privilege on all tables in |\n| | the database. |\n+----------------------------------+------------------------------------------+\n| CREATE ROUTINE | Create Stored Programs using the CREATE |\n| | PROCEDURE and CREATE FUNCTION |\n| | statements. |\n+----------------------------------+------------------------------------------+\n| CREATE TEMPORARY TABLES | Create temporary tables with the CREATE |\n| | TEMPORARY TABLE statement. This |\n| | privilege enable writing and dropping |\n| | those temporary tables |\n+----------------------------------+------------------------------------------+\n| DROP | Drop a database using the DROP DATABASE |\n| | statement, when the privilege is |\n| | granted for a database. This also |\n| | grants the DROP privilege on all tables |\n| | in the database. |\n+----------------------------------+------------------------------------------+\n| EVENT | Create, drop and alter EVENTs. |\n+----------------------------------+------------------------------------------+\n| GRANT OPTION | Grant database privileges. You can only |\n| | grant privileges that you have. |\n+----------------------------------+------------------------------------------+\n| LOCK TABLES | Acquire explicit locks using the LOCK |\n| | TABLES statement; you also need to have |\n| | the SELECT privilege on a table, in |\n| | order to lock it. |\n+----------------------------------+------------------------------------------+\n\nTable Privileges\n----------------\n\n+----------------------------------+------------------------------------------+\n| Privilege | Description |\n+----------------------------------+------------------------------------------+\n| ALTER | Change the structure of an existing |\n| | table using the ALTER TABLE statement. |\n+----------------------------------+------------------------------------------+\n| CREATE | Create a table using the CREATE TABLE |\n| | statement. You can grant the CREATE |\n| | privilege on tables that do not yet |\n| | exist. |\n+----------------------------------+------------------------------------------+\n| CREATE VIEW | Create a view using the CREATE_VIEW |\n| | statement. |\n+----------------------------------+------------------------------------------+\n| DELETE | Remove rows from a table using the |\n| | DELETE statement. |\n+----------------------------------+------------------------------------------+\n| DELETE HISTORY | Remove historical rows from a table |\n| | using the DELETE HISTORY statement. |\n| | Displays as DELETE VERSIONING ROWS when |\n| | running SHOW GRANTS until MariaDB |\n| | 10.3.15 and until MariaDB 10.4.5 |\n| | (MDEV-17655), or when running SHOW |\n| | PRIVILEGES until MariaDB 10.5.2, |\n| | MariaDB 10.4.13 and MariaDB 10.3.23 |\n| | (MDEV-20382). From MariaDB 10.3.4. From |\n| | MariaDB 10.3.5, if a user has the SUPER |\n| | privilege but not this privilege, |\n| | running mysql_upgrade will grant this |\n| | privilege as well. |\n+----------------------------------+------------------------------------------+\n| DROP | Drop a table using the DROP TABLE |\n| | statement or a view using the DROP VIEW |\n| | statement. Also required to execute the |\n| | TRUNCATE TABLE statement. |\n+----------------------------------+------------------------------------------+\n| GRANT OPTION | Grant table privileges. You can only |\n| | grant privileges that you have. |\n+----------------------------------+------------------------------------------+\n| INDEX | Create an index on a table using the |\n| | CREATE INDEX statement. Without the |\n| | INDEX privilege, you can still create |\n| | indexes when creating a table using the |\n| | CREATE TABLE statement if the you have |\n| | the CREATE privilege, and you can |\n| | create indexes using the ALTER TABLE |\n| | statement if you have the ALTER |\n| | privilege. |\n+----------------------------------+------------------------------------------+\n| INSERT | Add rows to a table using the INSERT |\n| | statement. The INSERT privilege can |\n| | also be set on individual columns; see |\n| | Column Privileges below for details. |\n+----------------------------------+------------------------------------------+\n| REFERENCES | Unused. |\n+----------------------------------+------------------------------------------+\n| SELECT | Read data from a table using the SELECT |\n| | statement. The SELECT privilege can |\n| | also be set on individual columns; see |\n| | Column Privileges below for details. |\n+----------------------------------+------------------------------------------+\n| SHOW VIEW | Show the CREATE VIEW statement to |\n| | create a view using the SHOW CREATE |\n| | VIEW statement. |\n+----------------------------------+------------------------------------------+\n| TRIGGER | Execute triggers associated to tables |\n| | you update, execute the CREATE TRIGGER |\n| | and DROP TRIGGER statements. You will |\n| | still be able to see triggers. |\n+----------------------------------+------------------------------------------+\n| UPDATE | Update existing rows in a table using |\n| | the UPDATE statement. UPDATE statements |\n| | usually include a WHERE clause to |\n| | update only certain rows. You must have |\n| | SELECT privileges on the table or the |\n| | appropriate columns for the WHERE |\n| | clause. The UPDATE privilege can also |\n| | be set on individual columns; see |\n| | Column Privileges below for details. |\n+----------------------------------+------------------------------------------+\n\nColumn Privileges\n-----------------\n\nSome table privileges can be set for individual columns of a table. To use\ncolumn privileges, specify the table explicitly and provide a list of column\nnames after the privilege type. For example, the following statement would\nallow the user to read the names and positions of employees, but not other\ninformation from the same table, such as salaries.\n\nGRANT SELECT (name, position) on Employee to \'jeffrey\'@\'localhost\';\n\n+----------------------------------+------------------------------------------+\n| Privilege | Description |\n+----------------------------------+------------------------------------------+\n| INSERT (column_list) | Add rows specifying values in columns |\n| | using the INSERT statement. If you only |\n| | have column-level INSERT privileges, |\n| | you must specify the columns you are |\n| | setting in the INSERT statement. All |\n| | other columns will be set to their |\n| | default values, or NULL. |\n+----------------------------------+------------------------------------------+\n| REFERENCES (column_list) | Unused. |\n+----------------------------------+------------------------------------------+\n| SELECT (column_list) | Read values in columns using the SELECT |\n| | statement. You cannot access or query |\n| | any columns for which you do not have |\n| | SELECT privileges, including in WHERE, |\n| | ON, GROUP BY, and ORDER BY clauses. |\n+----------------------------------+------------------------------------------+\n| UPDATE (column_list) | Update values in columns of existing |\n| | rows using the UPDATE statement. UPDATE |\n| | statements usually include a WHERE |\n| | clause to update only certain rows. You |\n| | must have SELECT privileges on the |\n| | table or the appropriate columns for |\n| | the WHERE clause. |\n+----------------------------------+------------------------------------------+\n\nFunction Privileges\n-------------------\n\n+----------------------------------+------------------------------------------+\n| Privilege | Description |\n+----------------------------------+------------------------------------------+\n| ALTER ROUTINE | Change the characteristics of a stored |\n| | function using the ALTER FUNCTION |\n| | statement. |\n+----------------------------------+------------------------------------------+\n| EXECUTE | Use a stored function. You need SELECT |\n| | privileges for any tables or columns |\n| | accessed by the function. |\n+----------------------------------+------------------------------------------+\n| GRANT OPTION | Grant function privileges. You can only |\n| | grant privileges that you have. |\n+----------------------------------+------------------------------------------+\n\nProcedure Privileges\n--------------------\n\n+----------------------------------+------------------------------------------+\n| Privilege | Description |\n+----------------------------------+------------------------------------------+\n| ALTER ROUTINE | Change the characteristics of a stored |\n| | procedure using the ALTER PROCEDURE |\n| | statement. |\n+----------------------------------+------------------------------------------+\n| EXECUTE | Execute a stored procedure using the |\n| | CALL statement. The privilege to call a |\n| | procedure may allow you to perform |\n| | actions you wouldn\'t otherwise be able |\n| | to do, such as insert rows into a table. |\n+----------------------------------+------------------------------------------+\n| GRANT OPTION | Grant procedure privileges. You can |\n| | only grant privileges that you have. |\n+----------------------------------+------------------------------------------+\n\nGRANT EXECUTE ON PROCEDURE mysql.create_db TO maintainer;\n\nProxy Privileges\n----------------\n\n+----------------------------------+------------------------------------------+\n| Privilege | Description |\n+----------------------------------+------------------------------------------+\n| PROXY | Permits one user to be a proxy for |\n| | another. |\n+----------------------------------+------------------------------------------+\n\nThe PROXY privilege allows one user to proxy as another user, which means\ntheir privileges change to that of the proxy user, and the CURRENT_USER()\nfunction returns the user name of the proxy user.\n\nThe PROXY privilege only works with authentication plugins that support it.\nThe default mysql_native_password authentication plugin does not support proxy\nusers.\n\nThe pam authentication plugin is the only plugin included with MariaDB that\ncurrently supports proxy users. The PROXY privilege is commonly used with the\npam authentication plugin to enable user and group mapping with PAM.\n\nFor example, to grant the PROXY privilege to an anonymous account that\nauthenticates with the pam authentication plugin, you could execute the\nfollowing:\n\nCREATE USER \'dba\'@\'%\' IDENTIFIED BY \'strongpassword\';\nGRANT ALL PRIVILEGES ON *.* TO \'dba\'@\'%\' ;\n\nCREATE USER \'\'@\'%\' IDENTIFIED VIA pam USING \'mariadb\';\nGRANT PROXY ON \'dba\'@\'%\' TO \'\'@\'%\';\n\nA user account can only grant the PROXY privilege for a specific user account\nif the granter also has the PROXY privilege for that specific user account,\nand if that privilege is defined WITH GRANT OPTION. For example, the following\nexample fails because the granter does not have the PROXY privilege for that\nspecific user account at all:\n\nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER() | CURRENT_USER() |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n\nSHOW GRANTS;\n+------------------------------------------------------------------------------\n----------------------------------------+\n| Grants for alice@localhost \n |\n+------------------------------------------------------------------------------\n----------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\' IDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' |\n+------------------------------------------------------------------------------\n----------------------------------------+\n\nGRANT PROXY ON \'dba\'@\'localhost\' TO \'bob\'@\'localhost\';\nERROR 1698 (28000): Access denied for user \'alice\'@\'localhost\'\n\nAnd the following example fails because the granter does have the PROXY\nprivilege for that specific user account, but it is not defined WITH GRANT\nOPTION:\n\nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER() | CURRENT_USER() |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n\nSHOW GRANTS;\n+------------------------------------------------------------------------------\n----------------------------------------+\n| Grants for alice@localhost \n |\n+------------------------------------------------------------------------------\n----------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\' IDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' |\n| GRANT PROXY ON \'dba\'@\'localhost\' TO \'alice\'@\'localhost\' \n |\n+------------------------------------------------------------------------------\n----------------------------------------+\n\nGRANT PROXY ON \'dba\'@\'localhost\' TO \'bob\'@\'localhost\';\nERROR 1698 (28000): Access denied for user \'alice\'@\'localhost\'\n\nBut the following example succeeds because the granter does have the PROXY\nprivilege for that specific user account, and it is defined WITH GRANT OPTION:\n\nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER() | CURRENT_USER() |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n\nSHOW GRANTS;\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n| Grants for alice@localhost \n |\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\' IDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' WITH GRANT OPTION |\n| GRANT PROXY ON \'dba\'@\'localhost\' TO \'alice\'@\'localhost\' WITH GRANT OPTION \n |\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n\nGRANT PROXY ON \'dba\'@\'localhost\' TO \'bob\'@\'localhost\';\n\nA user account can grant the PROXY privilege for any other user account if the\ngranter has the PROXY privilege for the \'\'@\'%\' anonymous user account, like\nthis:\n\nGRANT PROXY ON \'\'@\'%\' TO \'dba\'@\'localhost\' WITH GRANT OPTION;\n\nFor example, the following example succeeds because the user can grant the\nPROXY privilege for any other user account:\n\nSELECT USER(), CURRENT_USER();\n+-----------------+-----------------+\n| USER() | CURRENT_USER() |\n+-----------------+-----------------+\n| alice@localhost | alice@localhost |\n+-----------------+-----------------+\n\nSHOW GRANTS;\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n| Grants for alice@localhost \n |\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'alice\'@\'localhost\' IDENTIFIED BY PASSWORD\n\'*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19\' WITH GRANT OPTION |\n| GRANT PROXY ON \'\'@\'%\' TO \'alice\'@\'localhost\' WITH GRANT OPTION \n |\n+------------------------------------------------------------------------------\n----------------------------------------------------------+\n\nGRANT PROXY ON \'app1_dba\'@\'localhost\' TO \'bob\'@\'localhost\';\nQuery OK, 0 rows affected (0.004 sec)\n\nGRANT PROXY ON \'app2_dba\'@\'localhost\' TO \'carol\'@\'localhost\';\nQuery OK, 0 rows affected (0.004 sec)\n\nThe default root user accounts created by mysql_install_db have this\nprivilege. For example:\n\nGRANT ALL PRIVILEGES ON *.* TO \'root\'@\'localhost\' WITH GRANT OPTION;\nGRANT PROXY ON \'\'@\'%\' TO \'root\'@\'localhost\' WITH GRANT OPTION;\n\nThis allows the default root user accounts to grant the PROXY privilege for\nany other user account, and it also allows the default root user accounts to\ngrant others the privilege to do the same.\n\nAuthentication Options\n----------------------\n\nThe authentication options for the GRANT statement are the same as those for\nthe CREATE USER statement.\n\nIDENTIFIED BY \'password\'\n------------------------\n\nThe optional IDENTIFIED BY clause can be used to provide an account with a\npassword. The password should be specified in plain text. It will be hashed by\nthe PASSWORD function prior to being stored.\n\nFor example, if our password is mariadb, then we can create the user with:\n\nGRANT USAGE ON *.* TO foo2@test IDENTIFIED BY \'mariadb\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nIf the user account already exists and if you provide the IDENTIFIED BY\nclause, then the user\'s password will be changed. You must have the privileges\nneeded for the SET PASSWORD statement to change a user\'s password with GRANT.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED BY PASSWORD \'password_hash\'\n--------------------------------------\n\nThe optional IDENTIFIED BY PASSWORD clause can be used to provide an account\nwith a password that has already been hashed. The password should be specified\nas a hash that was provided by the PASSWORD function. It will be stored as-is.\n\nFor example, if our password is mariadb, then we can find the hash with:\n\nSELECT PASSWORD(\'mariadb\');\n+-------------------------------------------+\n| PASSWORD(\'mariadb\') |\n+-------------------------------------------+\n| *54958E764CE10E50764C2EECBB71D01F08549980 |\n+-------------------------------------------+\n1 row in set (0.00 sec)\n\nAnd then we can create a user with the hash:\n\nGRANT USAGE ON *.* TO foo2@test IDENTIFIED BY \n PASSWORD \'*54958E764CE10E50764C2EECBB71D01F08549980\';\n\nIf you do not specify a password with the IDENTIFIED BY clause, the user will\nbe able to connect without a password. A blank password is not a wildcard to\nmatch any password. The user must connect without providing a password if no\npassword is set.\n\nIf the user account already exists and if you provide the IDENTIFIED BY\nclause, then the user\'s password will be changed. You must have the privileges\nneeded for the SET PASSWORD statement to change a user\'s password with GRANT.\n\nThe only authentication plugins that this clause supports are\nmysql_native_password and mysql_old_password.\n\nIDENTIFIED {VIA|WITH} authentication_plugin\n-------------------------------------------\n\nThe optional IDENTIFIED VIA authentication_plugin allows you to specify that\nthe account should be authenticated by a specific authentication plugin. The\nplugin name must be an active authentication plugin as per SHOW PLUGINS. If it\ndoesn\'t show up in that output, then you will need to install it with INSTALL\nPLUGIN or INSTALL SONAME.\n\nFor example, this could be used with the PAM authentication plugin:\n\nGRANT USAGE ON *.* TO foo2@test IDENTIFIED VIA pam;\n\nSome authentication plugins allow additional arguments to be specified after a\nUSING or AS keyword. For example, the PAM authentication plugin accepts a\nservice name:\n\nGRANT USAGE ON *.* TO foo2@test IDENTIFIED VIA pam USING \'mariadb\';\n\nThe exact meaning of the additional argument would depend on the specific\nauthentication plugin.\n\nMariaDB starting with 10.4.0\n----------------------------\nThe USING or AS keyword can also be used to provide a plain-text password to a\nplugin if it\'s provided as an argument to the PASSWORD() function. This is\nonly valid for authentication plugins that have implemented a hook for the\nPASSWORD() function. For example, the ed25519 authentication plugin supports\nthis:\n\nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 \n USING PASSWORD(\'secret\');\n\nMariaDB starting with 10.4.3\n----------------------------\nOne can specify many authentication plugins, they all work as alternatives\nways of authenticating a user:\n\nCREATE USER safe@\'%\' IDENTIFIED VIA ed25519 \n USING PASSWORD(\'secret\') OR unix_socket;\n\nBy default, when you create a user without specifying an authentication\nplugin, MariaDB uses the mysql_native_password plugin.\n\nResource Limit Options\n----------------------\n\nMariaDB starting with 10.2.0\n----------------------------\nMariaDB 10.2.0 introduced a number of resource limit options.\n\nIt is possible to set per-account limits for certain server resources. The\nfollowing table shows the values that can be set per account:\n\n+--------------------------------------+--------------------------------------+\n| Limit Type | Decription |\n+--------------------------------------+--------------------------------------+\n| MAX_QUERIES_PER_HOUR | Number of statements that the |\n| | account can issue per hour |\n| | (including updates) |\n+--------------------------------------+--------------------------------------+\n| MAX_UPDATES_PER_HOUR | Number of updates (not queries) |\n| | that the account can issue per hour |\n+--------------------------------------+--------------------------------------+\n| MAX_CONNECTIONS_PER_HOUR | Number of connections that the |\n| | account can start per hour |\n+--------------------------------------+--------------------------------------+\n| MAX_USER_CONNECTIONS | Number of simultaneous connections |\n| | that can be accepted from the same |\n| | account; if it is 0, |\n| | max_connections will be used |\n| | instead; if max_connections is 0, |\n| | there is no limit for this |\n| | account\'s simultaneous connections. |\n+--------------------------------------+--------------------------------------+\n| MAX_STATEMENT_TIME | Timeout, in seconds, for statements |\n| | executed by the user. See also |\n| | Aborting Statements that Exceed a |\n| | Certain Time to Execute. |\n+--------------------------------------+--------------------------------------+\n\nIf any of these limits are set to 0, then there is no limit for that resource\nfor that user.\n\nTo set resource limits for an account, if you do not want to change that\naccount\'s privileges, you can issue a GRANT statement with the USAGE\nprivilege, which has no meaning. The statement can name some or all limit\ntypes, in any order.\n\nHere is an example showing how to set resource limits:\n\nGRANT USAGE ON *.* TO \'someone\'@\'localhost\' WITH\n MAX_USER_CONNECTIONS 0\n MAX_QUERIES_PER_HOUR 200;\n\nThe resources are tracked per account, which means \'user\'@\'server\'; not per\nuser name or per connection.\n\nThe count can be reset for all users using FLUSH USER_RESOURCES, FLUSH\nPRIVILEGES or mysqladmin reload.\n\nUsers with the CONNECTION ADMIN privilege (in MariaDB 10.5.2 and later) or the\nSUPER privilege are not restricted by max_user_connections, max_connections,\nor max_password_errors.\n\nPer account resource limits are stored in the user table, in the mysql\ndatabase. Columns used for resources limits are named max_questions,\nmax_updates, max_connections (for MAX_CONNECTIONS_PER_HOUR), and\nmax_user_connections (for MAX_USER_CONNECTIONS).\n\nTLS Options\n-----------\n\nBy default, MariaDB transmits data between the server and clients without\nencrypting it. This is generally acceptable when the server and client run on\nthe same host or in networks where security is guaranteed through other means.\nHowever, in cases where the server and client exist on separate networks or\nthey are in a high-risk network, the lack of encryption does introduce\nsecurity concerns as a malicious actor could potentially eavesdrop on the\ntraffic as it is sent over the network between them.\n\nTo mitigate this concern, MariaDB allows you to encrypt data in transit\nbetween the server and clients using the Transport Layer Security (TLS)\nprotocol. TLS was formerly known as Secure Socket Layer (SSL), but strictly\nspeaking the SSL protocol is a predecessor to TLS and, that version of the\nprotocol is now considered insecure. The documentation still uses the term SSL\noften and for compatibility reasons TLS-related server system and status\nvariables still use the prefix ssl_, but internally, MariaDB only supports its\nsecure successors.\n\nSee Secure Connections Overview for more information about how to determine\nwhether your MariaDB server has TLS support.\n\nYou can set certain TLS-related restrictions for specific user accounts. For\ninstance, you might use this with user accounts that require access to\nsensitive data while sending it across networks that you do not control. These\nrestrictions can be enabled for a user account with the CREATE USER, ALTER\nUSER, or GRANT statements. The following options are available:\n\n+---------------------------+-------------------------------------------------+\n| Option | Description |\n+---------------------------+-------------------------------------------------+\n| REQUIRE NONE | TLS is not required for this account, but can |\n| | still be used. |\n+---------------------------+-------------------------------------------------+\n| REQUIRE SSL | The account must use TLS, but no valid X509 |\n| | certificate is required. This option cannot be |\n| | combined with other TLS options. |\n+---------------------------+-------------------------------------------------+\n| REQUIRE X509 | The account must use TLS and must have a valid |\n| | X509 certificate. This option implies REQUIRE |\n| | SSL. This option cannot be combined with other |\n| | TLS options. |\n+---------------------------+-------------------------------------------------+\n| REQUIRE ISSUER \'issuer\' | The account must use TLS and must have a valid |\n| | X509 certificate. Also, the Certificate |\n| | Authority must be the one specified via the |\n| | string issuer. This option implies REQUIRE |\n| | X509. This option can be combined with the |\n| | SUBJECT, and CIPHER options in any order. |\n+---------------------------+-------------------------------------------------+\n| REQUIRE SUBJECT \'subject\' | The account must use TLS and must have a valid |\n| | X509 certificate. Also, the certificate\'s |\n| | Subject must be the one specified via the |\n| | string subject. This option implies REQUIRE |\n| | X509. This option can be combined with the |\n| | ISSUER, and CIPHER options in any order. |\n+---------------------------+-------------------------------------------------+\n| REQUIRE CIPHER \'cipher\' | The account must use TLS, but no valid X509 |\n| | certificate is required. Also, the encryption |\n| | used for the connection must use a specific |\n| | cipher method specified in the string cipher. |\n| | This option implies REQUIRE SSL. This option |\n| | can be combined with the ISSUER, and SUBJECT |\n| | options in any order. |\n+---------------------------+-------------------------------------------------+\n\nThe REQUIRE keyword must be used only once for all specified options, and the\nAND keyword can be used to separate individual options, but it is not required.\n\nFor example, you can create a user account that requires these TLS options\nwith the following:\n\nGRANT USAGE ON *.* TO \'alice\'@\'%\'\n REQUIRE SUBJECT \'/CN=alice/O=My Dom, Inc./C=US/ST=Oregon/L=Portland\'\n AND ISSUER \'/C=FI/ST=Somewhere/L=City/ O=Some Company/CN=Peter\nParker/emailAddress=p.parker@marvel.com\'\n AND CIPHER \'SHA-DES-CBC3-EDH-RSA\';\n\nIf any of these options are set for a specific user account, then any client\nwho tries to connect with that user account will have to be configured to\nconnect with TLS.\n\nSee Securing Connections for Client and Server for information on how to\nenable TLS on the client and server.\n\nRoles\n-----\n\nSyntax\n------\n\nGRANT role TO grantee [, grantee ... ]\n[ WITH ADMIN OPTION ]\n\ngrantee:\n rolename\n username [authentication_option]\n\nThe GRANT statement is also used to grant the use a role to one or more users\nor other roles. In order to be able to grant a role, the grantor doing so must\nhave permission to do so (see WITH ADMIN in the CREATE ROLE article).\n\nSpecifying the WITH ADMIN OPTION permits the grantee to in turn grant the role\nto another.\n\nFor example, the following commands show how to grant the same role to a\ncouple different users.\n\nGRANT journalist TO hulda;\n\nGRANT journalist TO berengar WITH ADMIN OPTION;\n\nIf a user has been granted a role, they do not automatically obtain all\npermissions associated with that role. These permissions are only in use when\nthe user activates the role with the SET ROLE statement.\n\nGrant Examples\n--------------\n\nGranting Root-like Privileges\n-----------------------------\n\nYou can create a user that has privileges similar to the default root accounts\nby executing the following:\n\nCREATE USER \'alexander\'@\'localhost\';\nGRANT ALL PRIVILEGES ON *.* to \'alexander\'@\'localhost\' WITH GRANT OPTION;\n\n\n\nURL: mariadb.com/kb/en/grant/','','https://mariadb.com/kb/en/grant/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (122,10,'User Password Expiry','MariaDB starting with 10.4.3\n----------------------------\nUser password expiry was introduced in MariaDB 10.4.3.\n\nPassword expiry permits administrators to expire user passwords, either\nmanually or automatically.\n\nSystem Variables\n----------------\n\nThere are two system variables which affect password expiry:\ndefault_password_lifetime, which determines the amount of time between\nrequiring the user to change their password. 0, the default, means automatic\npassword expiry is not active.\n\nThe second variable, disconnect_on_expired_password determines whether a\nclient is permitted to connect if their password has expired, or whether they\nare permitted to connect in sandbox mode, able to perform a limited subset of\nqueries related to resetting the password, in particular SET PASSWORD and SET.\n\nSetting a Password Expiry Limit for a User\n------------------------------------------\n\nBesides automatic password expiry, as determined by default_password_lifetime,\npassword expiry times can be set on an individual user basis, overriding the\nglobal using the CREATE USER or ALTER USER statements, for example:\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\n\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\n\nLimits can be disabled by use of the NEVER keyword, for example:\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE NEVER;\n\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE NEVER;\n\nA manually set limit can be restored the system default by use of DEFAULT, for\nexample:\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n\nALTER USER \'monty\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n\nSHOW CREATE USER\n----------------\n\nThe SHOW CREATE USER statement will display information about the password\nexpiry status of the user. Unlike MySQL, it will not display if the user is\nunlocked, or if the password expiry is set to default.\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\nCREATE USER \'konstantin\'@\'localhost\' PASSWORD EXPIRE NEVER;\nCREATE USER \'amse\'@\'localhost\' PASSWORD EXPIRE DEFAULT;\n\nSHOW CREATE USER \'monty\'@\'localhost\';\n+------------------------------------------------------------------+\n| CREATE USER for monty@localhost |\n+------------------------------------------------------------------+\n| CREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY |\n+------------------------------------------------------------------+\n\nSHOW CREATE USER \'konstantin\'@\'localhost\';\n+------------------------------------------------------------+\n| CREATE USER for konstantin@localhost |\n+------------------------------------------------------------+\n| CREATE USER \'konstantin\'@\'localhost\' PASSWORD EXPIRE NEVER |\n+------------------------------------------------------------+\n\nSHOW CREATE USER \'amse\'@\'localhost\';\n+--------------------------------+\n| CREATE USER for amse@localhost |\n+--------------------------------+\n| CREATE USER \'amse\'@\'localhost\' |\n+--------------------------------+\n\nChecking When Passwords Expire\n------------------------------\n\nThe following query can be used to check when the current passwords expire for\nall users:\n\nWITH password_expiration_info AS (\n SELECT User, Host,\n IF(\n IFNULL(JSON_EXTRACT(Priv, \'$.password_lifetime\'), -1) = -1,\n @@global.default_password_lifetime,\n JSON_EXTRACT(Priv, \'$.password_lifetime\')\n ) AS password_lifetime,\n JSON_EXTRACT(Priv, \'$.password_last_changed\') AS password_last_changed\n FROM mysql.global_priv\n)\nSELECT pei.User, pei.Host,\n pei.password_lifetime,\n FROM_UNIXTIME(pei.password_last_changed) AS password_last_changed_datetime,\n FROM_UNIXTIME(\n pei.password_last_changed +\n (pei.password_lifetime * 60 * 60 * 24)\n ) AS password_expiration_datetime\n FROM password_expiration_info pei\n WHERE pei.password_lifetime != 0\n AND pei.password_last_changed IS NOT NULL\nUNION\nSELECT pei.User, pei.Host,\n pei.password_lifetime,\n FROM_UNIXTIME(pei.password_last_changed) AS password_last_changed_datetime,\n 0 AS password_expiration_datetime\n FROM password_expiration_info pei\n WHERE pei.password_lifetime = 0\n OR pei.password_last_changed IS NULL;\n\n--connect-expired-password Client Option\n----------------------------------------\n\nThe mysql client --connect-expired-password option notifies the server that\nthe client is prepared to handle expired password sandbox mode (even if the\n--batch option was specified).\n\n\n\nURL: mariadb.com/kb/en/user-password-expiry/','','https://mariadb.com/kb/en/user-password-expiry/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (123,10,'RENAME USER','Syntax\n------\n\nRENAME USER old_user TO new_user\n [, old_user TO new_user] ...\n\nDescription\n-----------\n\nThe RENAME USER statement renames existing MariaDB accounts. To use it, you\nmust have the global CREATE USER privilege or the UPDATE privilege for the\nmysql database. Each account is named using the same format as for the CREATE\nUSER statement; for example, \'jeffrey\'@\'localhost\'. If you specify only the\nuser name part of the account name, a host name part of \'%\' is used.\n\nIf any of the old user accounts do not exist or any of the new user accounts\nalready exist, ERROR 1396 (HY000) results. If an error occurs, RENAME USER\nwill still rename the accounts that do not result in an error.\n\nExamples\n--------\n\nCREATE USER \'donald\', \'mickey\';\nRENAME USER \'donald\' TO \'duck\'@\'localhost\', \'mickey\' TO \'mouse\'@\'localhost\';\n\n\n\nURL: mariadb.com/kb/en/rename-user/','','https://mariadb.com/kb/en/rename-user/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (124,10,'REVOKE','Privileges\n----------\n\nSyntax\n------\n\nREVOKE \n priv_type [(column_list)]\n [, priv_type [(column_list)]] ...\n ON [object_type] priv_level\n FROM user [, user] ...\n\nREVOKE ALL PRIVILEGES, GRANT OPTION\n FROM user [, user] ...\n\nDescription\n-----------\n\nThe REVOKE statement enables system administrators to revoke privileges (or\nroles - see section below) from MariaDB accounts. Each account is named using\nthe same format as for the GRANT statement; for example,\n\'jeffrey\'@\'localhost\'. If you specify only the user name part of the account\nname, a host name part of \'%\' is used. For details on the levels at which\nprivileges exist, the allowable priv_type and priv_level values, and the\nsyntax for specifying users and passwords, see GRANT.\n\nTo use the first REVOKE syntax, you must have the GRANT OPTION privilege, and\nyou must have the privileges that you are revoking.\n\nTo revoke all privileges, use the second syntax, which drops all global,\ndatabase, table, column, and routine privileges for the named user or users:\n\nREVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...\n\nTo use this REVOKE syntax, you must have the global CREATE USER privilege or\nthe UPDATE privilege for the mysql database. See GRANT.\n\nExamples\n--------\n\nREVOKE SUPER ON *.* FROM \'alexander\'@\'localhost\';\n\nRoles\n-----\n\nSyntax\n------\n\nREVOKE role [, role ...]\n FROM grantee [, grantee2 ... ]\n\nREVOKE ADMIN OPTION FOR role FROM grantee [, grantee2]\n\nDescription\n-----------\n\nREVOKE is also used to remove a role from a user or another role that it\'s\npreviously been assigned to. If a role has previously been set as a default\nrole, REVOKE does not remove the record of the default role from the\nmysql.user table. If the role is subsequently granted again, it will again be\nthe user\'s default. Use SET DEFAULT ROLE NONE to explicitly remove this.\n\nBefore MariaDB 10.1.13, the REVOKE role statement was not permitted in\nprepared statements.\n\nExample\n-------\n\nREVOKE journalist FROM hulda\n\n\n\nURL: mariadb.com/kb/en/revoke/','','https://mariadb.com/kb/en/revoke/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (125,10,'SET PASSWORD','Syntax\n------\n\nSET PASSWORD [FOR user] =\n {\n PASSWORD(\'some password\')\n | OLD_PASSWORD(\'some password\')\n | \'encrypted password\'\n }\n\nDescription\n-----------\n\nThe SET PASSWORD statement assigns a password to an existing MariaDB user\naccount.\n\nIf the password is specified using the PASSWORD() or OLD_PASSWORD() function,\nthe literal text of the password should be given. If the password is specified\nwithout using either function, the password should be the already-encrypted\npassword value as returned by PASSWORD().\n\nOLD_PASSWORD() should only be used if your MariaDB/MySQL clients are very old\n(< 4.0.0).\n\nWith no FOR clause, this statement sets the password for the current user. Any\nclient that has connected to the server using a non-anonymous account can\nchange the password for that account.\n\nWith a FOR clause, this statement sets the password for a specific account on\nthe current server host. Only clients that have the UPDATE privilege for the\nmysql database can do this. The user value should be given in\nuser_name@host_name format, where user_name and host_name are exactly as they\nare listed in the User and Host columns of the mysql.user table (or view in\nMariaDB-10.4 onwards) entry.\n\nThe argument to PASSWORD() and the password given to MariaDB clients can be of\narbitrary length.\n\nAuthentication Plugin Support\n-----------------------------\n\nMariaDB starting with 10.4\n--------------------------\nIn MariaDB 10.4 and later, SET PASSWORD (with or without PASSWORD()) works for\naccounts authenticated via any authentication plugin that supports passwords\nstored in the mysql.global_priv table.\n\nThe ed25519, mysql_native_password, and mysql_old_password authentication\nplugins store passwords in the mysql.global_priv table.\n\nIf you run SET PASSWORD on an account that authenticates with one of these\nauthentication plugins that stores passwords in the mysql.global_priv table,\nthen the PASSWORD() function is evaluated by the specific authentication\nplugin used by the account. The authentication plugin hashes the password with\na method that is compatible with that specific authentication plugin.\n\nThe unix_socket, named_pipe, gssapi, and pam authentication plugins do not\nstore passwords in the mysql.global_priv table. These authentication plugins\nrely on other methods to authenticate the user.\n\nIf you attempt to run SET PASSWORD on an account that authenticates with one\nof these authentication plugins that doesn\'t store a password in the\nmysql.global_priv table, then MariaDB Server will raise a warning like the\nfollowing:\n\nSET PASSWORD is ignored for users authenticating via unix_socket plugin\n\nSee Authentication from MariaDB 10.4 for an overview of authentication changes\nin MariaDB 10.4.\n\nMariaDB until 10.3\n------------------\nIn MariaDB 10.3 and before, SET PASSWORD (with or without PASSWORD()) only\nworks for accounts authenticated via mysql_native_password or\nmysql_old_password authentication plugins\n\nPasswordless User Accounts\n--------------------------\n\nUser accounts do not always require passwords to login.\n\nThe unix_socket , named_pipe and gssapi authentication plugins do not require\na password to authenticate the user.\n\nThe pam authentication plugin may or may not require a password to\nauthenticate the user, depending on the specific configuration.\n\nThe mysql_native_password and mysql_old_password authentication plugins\nrequire passwords for authentication, but the password can be blank. In that\ncase, no password is required.\n\nIf you provide a password while attempting to log into the server as an\naccount that doesn\'t require a password, then MariaDB server will simply\nignore the password.\n\nMariaDB starting with 10.4\n--------------------------\nIn MariaDB 10.4 and later, a user account can be defined to use multiple\nauthentication plugins in a specific order of preference. This specific\nscenario may be more noticeable in these versions, since an account could be\nassociated with some authentication plugins that require a password, and some\nthat do not.\n\nExample\n-------\n\nFor example, if you had an entry with User and Host column values of \'bob\' and\n\'%.loc.gov\', you would write the statement like this:\n\nSET PASSWORD FOR \'bob\'@\'%.loc.gov\' = PASSWORD(\'newpass\');\n\nIf you want to delete a password for a user, you would do:\n\nSET PASSWORD FOR \'bob\'@localhost = PASSWORD("");\n\n\n\nURL: mariadb.com/kb/en/set-password/','','https://mariadb.com/kb/en/set-password/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (126,10,'Roles Overview','Description\n-----------\n\nA role bundles a number of privileges together. It assists larger\norganizations where, typically, a number of users would have the same\nprivileges, and, previously, the only way to change the privileges for a group\nof users was by changing each user\'s privileges individually.\n\nAlternatively, multiple external users could have been assigned the same user,\nand there would have been no way to see which actual user was responsible for\nwhich action.\n\nWith roles, managing this is easy. For example, there could be a number of\nusers assigned to a journalist role, with identical privileges. Changing the\nprivileges for all the journalists is a matter of simply changing the role\'s\nprivileges, while the individual user is still linked with any changes that\ntake place.\n\nRoles are created with the CREATE ROLE statement, and dropped with the DROP\nROLE statement. Roles are then assigned to a user with an extension to the\nGRANT statement, while privileges are assigned to a role in the regular way\nwith GRANT. Similarly, the REVOKE statement can be used to both revoke a role\nfrom a user, or revoke a privilege from a role.\n\nOnce a user has connected, he can obtain all privileges associated with a role\nby setting a role with the SET ROLE statement. The CURRENT_ROLE function\nreturns the currently set role for the session, if any.\n\nOnly roles granted directly to a user can be set, roles granted to other roles\ncannot. Instead the privileges granted to a role, which is, in turn, granted\nto another role (grantee), will be immediately available to any user who sets\nthis second grantee role.\n\nThe SET DEFAULT ROLE statement allows one to set a default role for a user. A\ndefault role is automatically enabled when a user connects (an implicit SET\nROLE statement is executed immediately after a connection is established).\n\nRoles were implemented as a GSoC 2013 project by Vicentiu Ciorbaru.\n\nSystem Tables\n-------------\n\nInformation about roles and who they\'ve been granted to can be found in the\nInformation Schema APPLICABLE_ROLES table as well as the mysql.ROLES_MAPPING\ntable.\n\nThe Information Schema ENABLED_ROLES table shows the enabled roles for the\ncurrent session.\n\nExamples\n--------\n\nCreating a role and granting a privilege:\n\nCREATE ROLE journalist;\n\nGRANT SHOW DATABASES ON *.* TO journalist;\n\nGRANT journalist to hulda;\n\nNote, that hulda has no SHOW DATABASES privilege, even though she was granted\nthe journalist role. She needs to set the role first:\n\nSHOW DATABASES;\n+--------------------+\n| Database |\n+--------------------+\n| information_schema |\n+--------------------+\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL |\n+--------------+\n\nSET ROLE journalist;\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| journalist |\n+--------------+\n\nSHOW DATABASES;\n+--------------------+\n| Database |\n+--------------------+\n| ... |\n| information_schema |\n| mysql |\n| performance_schema |\n| test |\n| ... |\n+--------------------+\n\nSET ROLE NONE;\n\nRoles can be granted to roles:\n\nCREATE ROLE writer;\n\nGRANT SELECT ON data.* TO writer;\n\nGRANT writer TO journalist;\n\nBut one does not need to set a role granted to a role. For example, hulda will\nautomatically get all writer privileges when she sets the journalist role:\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL |\n+--------------+\n\nSHOW TABLES FROM data;\nEmpty set (0.01 sec)\n\nSET ROLE journalist;\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| journalist |\n+--------------+\n\nSHOW TABLES FROM data;\n+------------------------------+\n| Tables_in_data |\n+------------------------------+\n| set1 |\n| ... |\n+------------------------------+\n\nRoles and Views (and Stored Routines)\n-------------------------------------\n\nWhen a user sets a role, he, in a sense, has two identities with two\nassociated sets of privileges. But a view (or a stored routine) can have only\none definer. So, when a view (or a stored routine) is created with the SQL\nSECURITY DEFINER, one can specify whether the definer should be CURRENT_USER\n(and the view will have none of the privileges of the user\'s role) or\nCURRENT_ROLE (in this case, the view will use role\'s privileges, but none of\nthe user\'s privileges). As a result, sometimes one can create a view that is\nimpossible to use.\n\nCREATE ROLE r1;\n\nGRANT ALL ON db1.* TO r1;\n\nGRANT r1 TO foo@localhost;\n\nGRANT ALL ON db.* TO foo@localhost;\n\nSELECT CURRENT_USER\n+---------------+\n| current_user |\n+---------------+\n| foo@localhost |\n+---------------+\n\nSET ROLE r1;\n\nCREATE TABLE db1.t1 (i int);\n\nCREATE VIEW db.v1 AS SELECT * FROM db1.t1;\n\nSHOW CREATE VIEW db.v1;\n+------+-----------------------------------------------------------------------\n------------------------------------------------------------------+------------\n---------+----------------------+\n| View | Create View \n |\ncharacter_set_client | collation_connection |\n+------+-----------------------------------------------------------------------\n------------------------------------------------------------------+------------\n---------+----------------------+\n| v1 | CREATE ALGORITHM=UNDEFINED DEFINER=`foo`@`localhost` SQL SECURITY\nDEFINER VIEW `db`.`v1` AS SELECT `db1`.`t1`.`i` AS `i` from `db1`.`t1` | utf8 \n | utf8_general_ci |\n+------+-----------------------------------------------------------------------\n------------------------------------------------------------------+------------\n---------+----------------------+\n\nCREATE DEFINER=CURRENT_ROLE VIEW db.v2 AS SELECT * FROM db1.t1;\n\nSHOW CREATE VIEW db.b2;\n+------+-----------------------------------------------------------------------\n-----------------------------------------------------+----------------------+--\n-------------------+\n| View | Create View \n | character_set_client |\ncollation_connection |\n+------+-----------------------------------------------------------------------\n-----------------------------------------------------+----------------------+--\n-------------------+\n| v2 | CREATE ALGORITHM=UNDEFINED DEFINER=`r1` SQL SECURITY DEFINER VIEW\n`db`.`v2` AS select `db1`.`t1`.`a` AS `a` from `db1`.`t1` | utf8 \n | utf8_general_ci |\n+------+-----------------------------------------------------------------------\n-----------------------------------------------------+----------------------+--\n-------------------+\n\nOther Resources\n---------------\n\n* Roles Review by Peter Gulutzan\n\n\n\nURL: mariadb.com/kb/en/roles_overview/','','https://mariadb.com/kb/en/roles_overview/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (127,10,'CREATE ROLE','Syntax\n------\n\nCREATE [OR REPLACE] ROLE [IF NOT EXISTS] role \n [WITH ADMIN\n {CURRENT_USER | CURRENT_ROLE | user | role}]\n\nDescription\n-----------\n\nThe CREATE ROLE statement creates one or more MariaDB roles. To use it, you\nmust have the global CREATE USER privilege or the INSERT privilege for the\nmysql database. For each account, CREATE ROLE creates a new row in the\nmysql.user table that has no privileges, and with the corresponding is_role\nfield set to Y. It also creates a record in the mysql.roles_mapping table.\n\nIf any of the specified roles already exist, ERROR 1396 (HY000) results. If an\nerror occurs, CREATE ROLE will still create the roles that do not result in an\nerror. The maximum length for a role is 128 characters. Role names can be\nquoted, as explained in the Identifier names page. Only one error is produced\nfor all roles which have not been created:\n\nERROR 1396 (HY000): Operation CREATE ROLE failed for \'a\',\'b\',\'c\'\n\nFailed CREATE or DROP operations, for both users and roles, produce the same\nerror code.\n\nPUBLIC and NONE are reserved, and cannot be used as role names. NONE is used\nto unset a role and PUBLIC has a special use in other systems, such as Oracle,\nso is reserved for compatibility purposes.\n\nFor valid identifiers to use as role names, see Identifier Names.\n\nWITH ADMIN\n----------\n\nThe optional WITH ADMIN clause determines whether the current user, the\ncurrent role or another user or role has use of the newly created role. If the\nclause is omitted, WITH ADMIN CURRENT_USER is treated as the default, which\nmeans that the current user will be able to GRANT this role to users.\n\nOR REPLACE\n----------\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP ROLE IF EXISTS name;\nCREATE ROLE name ...;\n\nIF NOT EXISTS\n-------------\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead\nof an error if the specified role already exists. Cannot be used together with\nthe OR REPLACE clause.\n\nExamples\n--------\n\nCREATE ROLE journalist;\n\nCREATE ROLE developer WITH ADMIN lorinda@localhost;\n\nGranting the role to another user. Only user lorinda@localhost has permission\nto grant the developer role:\n\nSELECT USER();\n+-------------------+\n| USER() |\n+-------------------+\n| henning@localhost |\n+-------------------+\n...\nGRANT developer TO ian@localhost;\nAccess denied for user \'henning\'@\'localhost\'\n\nSELECT USER();\n+-------------------+\n| USER() |\n+-------------------+\n| lorinda@localhost |\n+-------------------+\n\nGRANT m_role TO ian@localhost;\n\nThe OR REPLACE and IF NOT EXISTS clauses. The journalist role already exists:\n\nCREATE ROLE journalist;\nERROR 1396 (HY000): Operation CREATE ROLE failed for \'journalist\'\n\nCREATE OR REPLACE ROLE journalist;\nQuery OK, 0 rows affected (0.00 sec)\n\nCREATE ROLE IF NOT EXISTS journalist;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+---------------------------------------------------+\n| Level | Code | Message |\n+-------+------+---------------------------------------------------+\n| Note | 1975 | Can\'t create role \'journalist\'; it already exists |\n+-------+------+---------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/create-role/','','https://mariadb.com/kb/en/create-role/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (128,10,'DROP ROLE','Syntax\n------\n\nDROP ROLE [IF EXISTS] role_name [,role_name ...]\n\nDescription\n-----------\n\nThe DROP ROLE statement removes one or more MariaDB roles. To use this\nstatement, you must have the global CREATE USER privilege or the DELETE\nprivilege for the mysql database.\n\nDROP ROLE does not disable roles for connections which selected them with SET\nROLE. If a role has previously been set as a default role, DROP ROLE does not\nremove the record of the default role from the mysql.user table. If the role\nis subsequently recreated and granted, it will again be the user\'s default.\nUse SET DEFAULT ROLE NONE to explicitly remove this.\n\nIf any of the specified user accounts do not exist, ERROR 1396 (HY000)\nresults. If an error occurs, DROP ROLE will still drop the roles that do not\nresult in an error. Only one error is produced for all roles which have not\nbeen dropped:\n\nERROR 1396 (HY000): Operation DROP ROLE failed for \'a\',\'b\',\'c\'\n\nFailed CREATE or DROP operations, for both users and roles, produce the same\nerror code.\n\nIF EXISTS\n---------\n\nIf the IF EXISTS clause is used, MariaDB will return a warning instead of an\nerror if the role does not exist.\n\nExamples\n--------\n\nDROP ROLE journalist;\n\nThe same thing using the optional IF EXISTS clause:\n\nDROP ROLE journalist;\nERROR 1396 (HY000): Operation DROP ROLE failed for \'journalist\'\n\nDROP ROLE IF EXISTS journalist;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nNote (Code 1975): Can\'t drop role \'journalist\'; it doesn\'t exist\n\n\n\nURL: mariadb.com/kb/en/drop-role/','','https://mariadb.com/kb/en/drop-role/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (129,10,'SET ROLE','Syntax\n------\n\nSET ROLE { role | NONE }\n\nDescription\n-----------\n\nThe SET ROLE statement enables a role, along with all of its associated\npermissions, for the current session. To unset a role, use NONE .\n\nIf a role that doesn\'t exist, or to which the user has not been assigned, is\nspecified, an ERROR 1959 (OP000): Invalid role specification error occurs.\n\nAn automatic SET ROLE is implicitly performed when a user connects if that\nuser has been assigned a default role. See SET DEFAULT ROLE.\n\nExample\n-------\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL |\n+--------------+\n\nSET ROLE staff;\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| staff |\n+--------------+\n\nSET ROLE NONE;\n\nSELECT CURRENT_ROLE();\n+----------------+\n| CURRENT_ROLE() |\n+----------------+\n| NULL |\n+----------------+\n\n\n\nURL: mariadb.com/kb/en/set-role/','','https://mariadb.com/kb/en/set-role/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (130,10,'SET DEFAULT ROLE','Syntax\n------\n\nSET DEFAULT ROLE { role | NONE } [ FOR user@host ]\n\nDescription\n-----------\n\nThe SET DEFAULT ROLE statement sets a default role for a specified (or\ncurrent) user. A default role is automatically enabled when a user connects\n(an implicit SET ROLE statement is executed immediately after a connection is\nestablished).\n\nTo be able to set a role as a default, the role must already have been granted\nto that user, and one needs the privileges to enable this role (if you cannot\ndo SET ROLE X, you won\'t be able to do SET DEFAULT ROLE X). To set a default\nrole for another user one needs to have write access to the mysql database.\n\nTo remove a user\'s default role, use SET DEFAULT ROLE NONE [ FOR user@host ].\nThe record of the default role is not removed if the role is dropped or\nrevoked, so if the role is subsequently re-created or granted, it will again\nbe the user\'s default role.\n\nThe default role is stored in the default_role column in the mysql.user\ntable/view, as well as in the Information Schema APPLICABLE_ROLES table, so\nthese can be viewed to see which role has been assigned to a user as the\ndefault.\n\nExamples\n--------\n\nSetting a default role for the current user:\n\nSET DEFAULT ROLE journalist;\n\nRemoving a default role from the current user:\n\nSET DEFAULT ROLE NONE;\n\nSetting a default role for another user. The role has to have been granted to\nthe user before it can be set as default:\n\nCREATE ROLE journalist;\nCREATE USER taniel;\n\nSET DEFAULT ROLE journalist FOR taniel;\nERROR 1959 (OP000): Invalid role specification `journalist`\n\nGRANT journalist TO taniel;\nSET DEFAULT ROLE journalist FOR taniel;\n\nViewing mysql.user:\n\nselect * from mysql.user where user=\'taniel\'\G\n*************************** 1. row ***************************\n Host: %\n User: taniel\n...\n is_role: N\n default_role: journalist\n...\n\nRemoving a default role for another user\n\nSET DEFAULT ROLE NONE FOR taniel;\n\n\n\nURL: mariadb.com/kb/en/set-default-role/','','https://mariadb.com/kb/en/set-default-role/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (131,11,'ST_X','Syntax\n------\n\nST_X(p)\nX(p)\n\nDescription\n-----------\n\nReturns the X-coordinate value for the point p as a double-precision number.\n\nST_X() and X() are synonyms.\n\nExamples\n--------\n\nSET @pt = \'Point(56.7 53.34)\';\n\nSELECT X(GeomFromText(@pt));\n+----------------------+\n| X(GeomFromText(@pt)) |\n+----------------------+\n| 56.7 |\n+----------------------+\n\n\n\nURL: mariadb.com/kb/en/st_x/','','https://mariadb.com/kb/en/st_x/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (132,11,'ST_Y','Syntax\n------\n\nST_Y(p)\nY(p)\n\nDescription\n-----------\n\nReturns the Y-coordinate value for the point p as a double-precision number.\n\nST_Y() and Y() are synonyms.\n\nExamples\n--------\n\nSET @pt = \'Point(56.7 53.34)\';\n\nSELECT Y(GeomFromText(@pt));\n+----------------------+\n| Y(GeomFromText(@pt)) |\n+----------------------+\n| 53.34 |\n+----------------------+\n\n\n\nURL: mariadb.com/kb/en/st_y/','','https://mariadb.com/kb/en/st_y/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (133,11,'X','A synonym for ST_X.\n\n\n\nURL: mariadb.com/kb/en/point-properties-x/','','https://mariadb.com/kb/en/point-properties-x/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (134,11,'Y','A synonym for ST_Y.\n\n\n\nURL: mariadb.com/kb/en/point-properties-y/','','https://mariadb.com/kb/en/point-properties-y/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (135,12,'AES_DECRYPT','Syntax\n------\n\nAES_DECRYPT(crypt_str,key_str)\n\nDescription\n-----------\n\nThis function allows decryption of data using the official AES (Advanced\nEncryption Standard) algorithm. For more information, see the description of\nAES_ENCRYPT().\n\n\n\nURL: mariadb.com/kb/en/aes_decrypt/','','https://mariadb.com/kb/en/aes_decrypt/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (136,12,'AES_ENCRYPT','Syntax\n------\n\nAES_ENCRYPT(str,key_str)\n\nDescription\n-----------\n\nAES_ENCRYPT() and AES_DECRYPT() allow encryption and decryption of data using\nthe official AES (Advanced Encryption Standard) algorithm, previously known as\n"Rijndael." Encoding with a 128-bit key length is used, but you can extend it\nup to 256 bits by modifying the source. We chose 128 bits because it is much\nfaster and it is secure enough for most purposes.\n\nAES_ENCRYPT() encrypts a string str using the key key_str, and returns a\nbinary string.\n\nAES_DECRYPT() decrypts the encrypted string and returns the original string.\n\nThe input arguments may be any length. If either argument is NULL, the result\nof this function is also NULL.\n\nBecause AES is a block-level algorithm, padding is used to encode uneven\nlength strings and so the result string length may be calculated using this\nformula:\n\n16 x (trunc(string_length / 16) + 1)\n\nIf AES_DECRYPT() detects invalid data or incorrect padding, it returns NULL.\nHowever, it is possible for AES_DECRYPT() to return a non-NULL value (possibly\ngarbage) if the input data or the key is invalid.\n\nExamples\n--------\n\nINSERT INTO t VALUES (AES_ENCRYPT(\'text\',SHA2(\'password\',512)));\n\n\n\nURL: mariadb.com/kb/en/aes_encrypt/','','https://mariadb.com/kb/en/aes_encrypt/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (137,12,'COMPRESS','Syntax\n------\n\nCOMPRESS(string_to_compress)\n\nDescription\n-----------\n\nCompresses a string and returns the result as a binary string. This function\nrequires MariaDB to have been compiled with a compression library such as\nzlib. Otherwise, the return value is always NULL. The compressed string can be\nuncompressed with UNCOMPRESS().\n\nThe have_compress server system variable indicates whether a compression\nlibrary is present.\n\nExamples\n--------\n\nSELECT LENGTH(COMPRESS(REPEAT(\'a\',1000)));\n+------------------------------------+\n| LENGTH(COMPRESS(REPEAT(\'a\',1000))) |\n+------------------------------------+\n| 21 |\n+------------------------------------+\n\nSELECT LENGTH(COMPRESS(\'\'));\n+----------------------+\n| LENGTH(COMPRESS(\'\')) |\n+----------------------+\n| 0 |\n+----------------------+\n\nSELECT LENGTH(COMPRESS(\'a\'));\n+-----------------------+\n| LENGTH(COMPRESS(\'a\')) |\n+-----------------------+\n| 13 |\n+-----------------------+\n\nSELECT LENGTH(COMPRESS(REPEAT(\'a\',16)));\n+----------------------------------+\n| LENGTH(COMPRESS(REPEAT(\'a\',16))) |\n+----------------------------------+\n| 15 |\n+----------------------------------+\n\n\n\nURL: mariadb.com/kb/en/compress/','','https://mariadb.com/kb/en/compress/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (138,12,'DECODE','Syntax\n------\n\nDECODE(crypt_str,pass_str)\n\nIn Oracle mode from MariaDB 10.3.2:\n\nDECODE(expr, search_expr, result_expr [, search_expr2, result_expr2 ...]\n[default_expr])\n\nIn all modes from MariaDB 10.3.2:\n\nDECODE_ORACLE(expr, search_expr, result_expr [, search_expr2, result_expr2\n...] [default_expr])\n\nDescription\n-----------\n\nIn the default mode, DECODE decrypts the encrypted string crypt_str using\npass_str as the password. crypt_str should be a string returned from ENCODE().\nThe resulting string will be the original string only if pass_str is the same.\n\nIn Oracle mode from MariaDB 10.3.2, DECODE compares expr to the search\nexpressions, in order. If it finds a match, the corresponding result\nexpression is returned. If no matches are found, the default expression is\nreturned, or NULL if no default is provided.\n\nNULLs are treated as equivalent.\n\nDECODE_ORACLE is a synonym for the Oracle-mode version of the function, and is\navailable in all modes.\n\nExamples\n--------\n\nFrom MariaDB 10.3.2:\n\nSELECT DECODE_ORACLE(2+1,3*1,\'found1\',3*2,\'found2\',\'default\');\n+--------------------------------------------------------+\n| DECODE_ORACLE(2+1,3*1,\'found1\',3*2,\'found2\',\'default\') |\n+--------------------------------------------------------+\n| found1 |\n+--------------------------------------------------------+\n\nSELECT DECODE_ORACLE(2+4,3*1,\'found1\',3*2,\'found2\',\'default\');\n+--------------------------------------------------------+\n| DECODE_ORACLE(2+4,3*1,\'found1\',3*2,\'found2\',\'default\') |\n+--------------------------------------------------------+\n| found2 |\n+--------------------------------------------------------+\n\nSELECT DECODE_ORACLE(2+2,3*1,\'found1\',3*2,\'found2\',\'default\');\n+--------------------------------------------------------+\n| DECODE_ORACLE(2+2,3*1,\'found1\',3*2,\'found2\',\'default\') |\n+--------------------------------------------------------+\n| default |\n+--------------------------------------------------------+\n\nNulls are treated as equivalent:\n\nSELECT DECODE_ORACLE(NULL,NULL,\'Nulls are equivalent\',\'Nulls are not\nequivalent\');\n+----------------------------------------------------------------------------+\n| DECODE_ORACLE(NULL,NULL,\'Nulls are equivalent\',\'Nulls are not equivalent\') |\n+----------------------------------------------------------------------------+\n| Nulls are equivalent |\n+----------------------------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/decode/','','https://mariadb.com/kb/en/decode/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (139,12,'DES_DECRYPT','DES_DECRYPT has been deprecated from MariaDB 10.10.0, and will be\nremoved in a future release.\n\nSyntax\n------\n\nDES_DECRYPT(crypt_str[,key_str])\n\nDescription\n-----------\n\nDecrypts a string encrypted with DES_ENCRYPT(). If an error occurs, this\nfunction returns NULL.\n\nThis function works only if MariaDB has been configured with TLS support.\n\nIf no key_str argument is given, DES_DECRYPT() examines the first byte of the\nencrypted string to determine the DES key number that was used to encrypt the\noriginal string, and then reads the key from the DES key file to decrypt the\nmessage. For this to work, the user must have the SUPER privilege. The key\nfile can be specified with the --des-key-file server option.\n\nIf you pass this function a key_str argument, that string is used as the key\nfor decrypting the message.\n\nIf the crypt_str argument does not appear to be an encrypted string, MariaDB\nreturns the given crypt_str.\n\n\n\nURL: mariadb.com/kb/en/des_decrypt/','','https://mariadb.com/kb/en/des_decrypt/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (140,12,'DES_ENCRYPT','DES_ENCRYPT has been deprecated from MariaDB 10.10.0, and will be\nremoved in a future release.\n\nSyntax\n------\n\nDES_ENCRYPT(str[,{key_num|key_str}])\n\nDescription\n-----------\n\nEncrypts the string with the given key using the Triple-DES algorithm.\n\nThis function works only if MariaDB has been configured with TLS support.\n\nThe encryption key to use is chosen based on the second argument to\nDES_ENCRYPT(), if one was given. With no argument, the first key from the DES\nkey file is used. With a key_num argument, the given key number (0-9) from the\nDES key file is used. With a key_str argument, the given key string is used to\nencrypt str.\n\nThe key file can be specified with the --des-key-file server option.\n\nThe return string is a binary string where the first character is CHAR(128 |\nkey_num). If an error occurs, DES_ENCRYPT() returns NULL.\n\nThe 128 is added to make it easier to recognize an encrypted key. If you use a\nstring key, key_num is 127.\n\nThe string length for the result is given by this formula:\n\nnew_len = orig_len + (8 - (orig_len % 8)) + 1\n\nEach line in the DES key file has the following format:\n\nkey_num des_key_str\n\nEach key_num value must be a number in the range from 0 to 9. Lines in the\nfile may be in any order. des_key_str is the string that is used to encrypt\nthe message. There should be at least one space between the number and the\nkey. The first key is the default key that is used if you do not specify any\nkey argument to DES_ENCRYPT().\n\nYou can tell MariaDB to read new key values from the key file with the FLUSH\nDES_KEY_FILE statement. This requires the RELOAD privilege.\n\nOne benefit of having a set of default keys is that it gives applications a\nway to check for the existence of encrypted column values, without giving the\nend user the right to decrypt those values.\n\nExamples\n--------\n\nSELECT customer_address FROM customer_table \n WHERE crypted_credit_card = DES_ENCRYPT(\'credit_card_number\');\n\n\n\nURL: mariadb.com/kb/en/des_encrypt/','','https://mariadb.com/kb/en/des_encrypt/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (141,12,'ENCODE','Syntax\n------\n\nENCODE(str,pass_str)\n\nDescription\n-----------\n\nENCODE is not considered cryptographically secure, and should not be used for\npassword encryption.\n\nEncrypt str using pass_str as the password. To decrypt the result, use\nDECODE().\n\nThe result is a binary string of the same length as str.\n\nThe strength of the encryption is based on how good the random generator is.\n\nIt is not recommended to rely on the encryption performed by the ENCODE\nfunction. Using a salt value (changed when a password is updated) will improve\nmatters somewhat, but for storing passwords, consider a more cryptographically\nsecure function, such as SHA2().\n\nExamples\n--------\n\nENCODE(\'not so secret text\', CONCAT(\'random_salt\',\'password\'))\n\n\n\nURL: mariadb.com/kb/en/encode/','','https://mariadb.com/kb/en/encode/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (142,12,'ENCRYPT','Syntax\n------\n\nENCRYPT(str[,salt])\n\nDescription\n-----------\n\nEncrypts a string using the Unix crypt() system call, returning an encrypted\nbinary string. The salt argument should be a string with at least two\ncharacters or the returned result will be NULL. If no salt argument is given,\na random value of sufficient length is used.\n\nIt is not recommended to use ENCRYPT() with utf16, utf32 or ucs2 multi-byte\ncharacter sets because the crypt() system call expects a string terminated\nwith a zero byte.\n\nNote that the underlying crypt() system call may have some limitations, such\nas ignoring all but the first eight characters.\n\nIf the have_crypt system variable is set to NO (because the crypt() system\ncall is not available), the ENCRYPT function will always return NULL.\n\nExamples\n--------\n\nSELECT ENCRYPT(\'encrypt me\');\n+-----------------------+\n| ENCRYPT(\'encrypt me\') |\n+-----------------------+\n| 4I5BsEx0lqTDk |\n+-----------------------+\n\n\n\nURL: mariadb.com/kb/en/encrypt/','','https://mariadb.com/kb/en/encrypt/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (143,12,'MD5','Syntax\n------\n\nMD5(str)\n\nDescription\n-----------\n\nCalculates an MD5 128-bit checksum for the string.\n\nThe return value is a 32-hex digit string, and as of MariaDB 5.5, is a\nnonbinary string in the connection character set and collation, determined by\nthe values of the character_set_connection and collation_connection system\nvariables. Before 5.5, the return value was a binary string.\n\nNULL is returned if the argument was NULL.\n\nExamples\n--------\n\nSELECT MD5(\'testing\');\n+----------------------------------+\n| MD5(\'testing\') |\n+----------------------------------+\n| ae2b1fca515949e5d54fb22b8ed95575 |\n+----------------------------------+\n\n\n\nURL: mariadb.com/kb/en/md5/','','https://mariadb.com/kb/en/md5/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (144,12,'OLD_PASSWORD','Syntax\n------\n\nOLD_PASSWORD(str)\n\nDescription\n-----------\n\nOLD_PASSWORD() was added to MySQL when the implementation of PASSWORD() was\nchanged to improve security. OLD_PASSWORD() returns the value of the old\n(pre-MySQL 4.1) implementation of PASSWORD() as a string, and is intended to\npermit you to reset passwords for any pre-4.1 clients that need to connect to\na more recent MySQL server version, or any version of MariaDB, without locking\nthem out.\n\nAs of MariaDB 5.5, the return value is a nonbinary string in the connection\ncharacter set and collation, determined by the values of the\ncharacter_set_connection and collation_connection system variables. Before\n5.5, the return value was a binary string.\n\nThe return value is 16 bytes in length, or NULL if the argument was NULL.\n\n\n\nURL: mariadb.com/kb/en/old_password/','','https://mariadb.com/kb/en/old_password/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (145,12,'PASSWORD','Syntax\n------\n\nPASSWORD(str)\n\nDescription\n-----------\n\nThe PASSWORD() function is used for hashing passwords for use in\nauthentication by the MariaDB server. It is not intended for use in other\napplications.\n\nCalculates and returns a hashed password string from the plaintext password\nstr. Returns an empty string (>= MariaDB 10.0.4) if the argument was NULL.\n\nThe return value is a nonbinary string in the connection character set and\ncollation, determined by the values of the character_set_connection and\ncollation_connection system variables.\n\nThis is the function that is used for hashing MariaDB passwords for storage in\nthe Password column of the user table (see privileges), usually used with the\nSET PASSWORD statement. It is not intended for use in other applications.\n\nUntil MariaDB 10.3, the return value is 41-bytes in length, and the first\ncharacter is always \'*\'. From MariaDB 10.4, the function takes into account\nthe authentication plugin where applicable (A CREATE USER or SET PASSWORD\nstatement). For example, when used in conjunction with a user authenticated by\nthe ed25519 plugin, the statement will create a longer hash:\n\nCREATE USER edtest@localhost IDENTIFIED VIA ed25519 USING PASSWORD(\'secret\');\n\nCREATE USER edtest2@localhost IDENTIFIED BY \'secret\';\n\nSELECT CONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv)) FROM\nmysql.global_priv\n WHERE user LIKE \'edtest%\'\G\n*************************** 1. row ***************************\nCONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv)): edtest@localhost => {\n...\n "plugin": "ed25519",\n "authentication_string": "ZIgUREUg5PVgQ6LskhXmO+eZLS0nC8be6HPjYWR4YJY",\n...\n}\n*************************** 2. row ***************************\nCONCAT(user, \'@\', host, \' => \', JSON_DETAILED(priv)): edtest2@localhost => {\n...\n "plugin": "mysql_native_password",\n "authentication_string": "*14E65567ABDB5135D0CFD9A70B3032C179A49EE7",\n...\n}\n\nThe behavior of this function is affected by the value of the old_passwords\nsystem variable. If this is set to 1 (0 is default), MariaDB reverts to using\nthe mysql_old_password authentication plugin by default for newly created\nusers and passwords.\n\nExamples\n--------\n\nSELECT PASSWORD(\'notagoodpwd\');\n+-------------------------------------------+\n| PASSWORD(\'notagoodpwd\') |\n+-------------------------------------------+\n| *3A70EE9FC6594F88CE9E959CD51C5A1C002DC937 |\n+-------------------------------------------+\n\nSET PASSWORD FOR \'bob\'@\'%.loc.gov\' = PASSWORD(\'newpass\');\n\n\n\nURL: mariadb.com/kb/en/password/','','https://mariadb.com/kb/en/password/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (146,12,'SHA1','Syntax\n------\n\nSHA1(str), SHA(str)\n\nDescription\n-----------\n\nCalculates an SHA-1 160-bit checksum for the string str, as described in RFC\n3174 (Secure Hash Algorithm).\n\nThe value is returned as a string of 40 hex digits, or NULL if the argument\nwas NULL. As of MariaDB 5.5, the return value is a nonbinary string in the\nconnection character set and collation, determined by the values of the\ncharacter_set_connection and collation_connection system variables. Before\n5.5, the return value was a binary string.\n\nExamples\n--------\n\nSELECT SHA1(\'some boring text\');\n+------------------------------------------+\n| SHA1(\'some boring text\') |\n+------------------------------------------+\n| af969fc2085b1bb6d31e517d5c456def5cdd7093 |\n+------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/sha1/','','https://mariadb.com/kb/en/sha1/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (147,12,'SHA2','Syntax\n------\n\nSHA2(str,hash_len)\n\nDescription\n-----------\n\nGiven a string str, calculates an SHA-2 checksum, which is considered more\ncryptographically secure than its SHA-1 equivalent. The SHA-2 family includes\nSHA-224, SHA-256, SHA-384, and SHA-512, and the hash_len must correspond to\none of these, i.e. 224, 256, 384 or 512. 0 is equivalent to 256.\n\nThe return value is a nonbinary string in the connection character set and\ncollation, determined by the values of the character_set_connection and\ncollation_connection system variables.\n\nNULL is returned if the hash length is not valid, or the string str is NULL.\n\nSHA2 will only work if MariaDB was has been configured with TLS support.\n\nExamples\n--------\n\nSELECT SHA2(\'Maria\',224);\n+----------------------------------------------------------+\n| SHA2(\'Maria\',224) |\n+----------------------------------------------------------+\n| 6cc67add32286412efcab9d0e1675a43a5c2ef3cec8879f81516ff83 |\n+----------------------------------------------------------+\n\nSELECT SHA2(\'Maria\',256);\n+------------------------------------------------------------------+\n| SHA2(\'Maria\',256) |\n+------------------------------------------------------------------+\n| 9ff18ebe7449349f358e3af0b57cf7a032c1c6b2272cb2656ff85eb112232f16 |\n+------------------------------------------------------------------+\n\nSELECT SHA2(\'Maria\',0);\n+------------------------------------------------------------------+\n| SHA2(\'Maria\',0) |\n+------------------------------------------------------------------+\n| 9ff18ebe7449349f358e3af0b57cf7a032c1c6b2272cb2656ff85eb112232f16 |\n+------------------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/sha2/','','https://mariadb.com/kb/en/sha2/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (148,12,'UNCOMPRESS','Syntax\n------\n\nUNCOMPRESS(string_to_uncompress)\n\nDescription\n-----------\n\nUncompresses a string compressed by the COMPRESS() function. If the argument\nis not a compressed value, the result is NULL. This function requires MariaDB\nto have been compiled with a compression library such as zlib. Otherwise, the\nreturn value is always NULL. The have_compress server system variable\nindicates whether a compression library is present.\n\nExamples\n--------\n\nSELECT UNCOMPRESS(COMPRESS(\'a string\'));\n+----------------------------------+\n| UNCOMPRESS(COMPRESS(\'a string\')) |\n+----------------------------------+\n| a string |\n+----------------------------------+\n\nSELECT UNCOMPRESS(\'a string\');\n+------------------------+\n| UNCOMPRESS(\'a string\') |\n+------------------------+\n| NULL |\n+------------------------+\n\n\n\nURL: mariadb.com/kb/en/uncompress/','','https://mariadb.com/kb/en/uncompress/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (149,12,'UNCOMPRESSED_LENGTH','Syntax\n------\n\nUNCOMPRESSED_LENGTH(compressed_string)\n\nDescription\n-----------\n\nReturns the length that the compressed string had before being compressed with\nCOMPRESS().\n\nUNCOMPRESSED_LENGTH() returns NULL or an incorrect result if the string is not\ncompressed.\n\nUntil MariaDB 10.3.1, returns MYSQL_TYPE_LONGLONG, or bigint(10), in all\ncases. From MariaDB 10.3.1, returns MYSQL_TYPE_LONG, or int(10), when the\nresult would fit within 32-bits.\n\nExamples\n--------\n\nSELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT(\'a\',30)));\n+-----------------------------------------------+\n| UNCOMPRESSED_LENGTH(COMPRESS(REPEAT(\'a\',30))) |\n+-----------------------------------------------+\n| 30 |\n+-----------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/uncompressed_length/','','https://mariadb.com/kb/en/uncompressed_length/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (150,13,'ENDPOINT','A synonym for ST_ENDPOINT.\n\n\n\nURL: mariadb.com/kb/en/linestring-properties-endpoint/','','https://mariadb.com/kb/en/linestring-properties-endpoint/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (151,13,'GLENGTH','Syntax\n------\n\nGLength(ls)\n\nDescription\n-----------\n\nReturns as a double-precision number the length of the LineString value ls in\nits associated spatial reference.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT GLength(GeomFromText(@ls));\n+----------------------------+\n| GLength(GeomFromText(@ls)) |\n+----------------------------+\n| 2.82842712474619 |\n+----------------------------+\n\n\n\nURL: mariadb.com/kb/en/glength/','','https://mariadb.com/kb/en/glength/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (152,13,'NumPoints','A synonym for ST_NumPoints.\n\n\n\nURL: mariadb.com/kb/en/linestring-properties-numpoints/','','https://mariadb.com/kb/en/linestring-properties-numpoints/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (153,13,'PointN','A synonym for ST_PointN.\n\n\n\nURL: mariadb.com/kb/en/linestring-properties-pointn/','','https://mariadb.com/kb/en/linestring-properties-pointn/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (154,13,'STARTPOINT','A synonym for ST_STARTPOINT.\n\n\n\nURL: mariadb.com/kb/en/linestring-properties-startpoint/','','https://mariadb.com/kb/en/linestring-properties-startpoint/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (155,13,'ST_ENDPOINT','Syntax\n------\n\nST_EndPoint(ls)\nEndPoint(ls)\n\nDescription\n-----------\n\nReturns the Point that is the endpoint of the LineString value ls.\n\nST_EndPoint() and EndPoint() are synonyms.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT AsText(EndPoint(GeomFromText(@ls)));\n+-------------------------------------+\n| AsText(EndPoint(GeomFromText(@ls))) |\n+-------------------------------------+\n| POINT(3 3) |\n+-------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_endpoint/','','https://mariadb.com/kb/en/st_endpoint/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (156,13,'ST_NUMPOINTS','Syntax\n------\n\nST_NumPoints(ls)\nNumPoints(ls)\n\nDescription\n-----------\n\nReturns the number of Point objects in the LineString value ls.\n\nST_NumPoints() and NumPoints() are synonyms.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT NumPoints(GeomFromText(@ls));\n+------------------------------+\n| NumPoints(GeomFromText(@ls)) |\n+------------------------------+\n| 3 |\n+------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_numpoints/','','https://mariadb.com/kb/en/st_numpoints/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (157,13,'ST_POINTN','Syntax\n------\n\nST_PointN(ls,N)\nPointN(ls,N)\n\nDescription\n-----------\n\nReturns the N-th Point in the LineString value ls. Points are numbered\nbeginning with 1.\n\nST_PointN() and PointN() are synonyms.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT AsText(PointN(GeomFromText(@ls),2));\n+-------------------------------------+\n| AsText(PointN(GeomFromText(@ls),2)) |\n+-------------------------------------+\n| POINT(2 2) |\n+-------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_pointn/','','https://mariadb.com/kb/en/st_pointn/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (158,14,'GET_LOCK','Syntax\n------\n\nGET_LOCK(str,timeout)\n\nDescription\n-----------\n\nTries to obtain a lock with a name given by the string str, using a timeout of\ntimeout seconds. Returns 1 if the lock was obtained successfully, 0 if the\nattempt timed out (for example, because another client has previously locked\nthe name), or NULL if an error occurred (such as running out of memory or the\nthread was killed with mysqladmin kill).\n\nA lock is released with RELEASE_LOCK(), when the connection terminates (either\nnormally or abnormally). A connection can hold multiple locks at the same\ntime, so a lock that is no longer needed needs to be explicitly released.\n\nThe IS_FREE_LOCK function returns whether a specified lock a free or not, and\nthe IS_USED_LOCK whether the function is in use or not.\n\nLocks obtained with GET_LOCK() do not interact with transactions. That is,\ncommitting a transaction does not release any such locks obtained during the\ntransaction.\n\nIt is also possible to recursively set the same lock. If a lock with the same\nname is set n times, it needs to be released n times as well.\n\nstr is case insensitive for GET_LOCK() and related functions. If str is an\nempty string or NULL, GET_LOCK() returns NULL and does nothing. From MariaDB\n10.2.2, timeout supports microseconds. Before then, it was rounded to the\nclosest integer.\n\nIf the metadata_lock_info plugin is installed, locks acquired with this\nfunction are visible in the Information Schema METADATA_LOCK_INFO table.\n\nThis function can be used to implement application locks or to simulate record\nlocks. Names are locked on a server-wide basis. If a name has been locked by\none client, GET_LOCK() blocks any request by another client for a lock with\nthe same name. This allows clients that agree on a given lock name to use the\nname to perform cooperative advisory locking. But be aware that it also allows\na client that is not among the set of cooperating clients to lock a name,\neither inadvertently or deliberately, and thus prevent any of the cooperating\nclients from locking that name. One way to reduce the likelihood of this is to\nuse lock names that are database-specific or application-specific. For\nexample, use lock names of the form db_name.str or app_name.str.\n\nStatements using the GET_LOCK function are not safe for statement-based\nreplication.\n\nThe patch to permit multiple locks was contributed by Konstantin "Kostja"\nOsipov (MDEV-3917).\n\nExamples\n--------\n\nSELECT GET_LOCK(\'lock1\',10);\n+----------------------+\n| GET_LOCK(\'lock1\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n\nSELECT IS_FREE_LOCK(\'lock1\'), IS_USED_LOCK(\'lock1\');\n+-----------------------+-----------------------+\n| IS_FREE_LOCK(\'lock1\') | IS_USED_LOCK(\'lock1\') |\n+-----------------------+-----------------------+\n| 0 | 46 |\n+-----------------------+-----------------------+\n\nSELECT IS_FREE_LOCK(\'lock2\'), IS_USED_LOCK(\'lock2\');\n+-----------------------+-----------------------+\n| IS_FREE_LOCK(\'lock2\') | IS_USED_LOCK(\'lock2\') |\n+-----------------------+-----------------------+\n| 1 | NULL |\n+-----------------------+-----------------------+\n\nMultiple locks can be held:\n\nSELECT GET_LOCK(\'lock2\',10);\n+----------------------+\n| GET_LOCK(\'lock2\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n\nSELECT IS_FREE_LOCK(\'lock1\'), IS_FREE_LOCK(\'lock2\');\n+-----------------------+-----------------------+\n| IS_FREE_LOCK(\'lock1\') | IS_FREE_LOCK(\'lock2\') |\n+-----------------------+-----------------------+\n| 0 | 0 |\n+-----------------------+-----------------------+\n\nSELECT RELEASE_LOCK(\'lock1\'), RELEASE_LOCK(\'lock2\');\n+-----------------------+-----------------------+\n| RELEASE_LOCK(\'lock1\') | RELEASE_LOCK(\'lock2\') |\n+-----------------------+-----------------------+\n| 1 | 1 |\n+-----------------------+-----------------------+\n\nIt is possible to hold the same lock recursively. This example is viewed using\nthe metadata_lock_info plugin:\n\nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n\nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| THREAD_ID | LOCK_MODE | LOCK_DURATION | LOCK_TYPE | TABLE_SCHEMA |\nTABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| 46 | MDL_SHARED_NO_WRITE | NULL | User lock | lock3 |\n |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n\nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n| 1 |\n+-----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| THREAD_ID | LOCK_MODE | LOCK_DURATION | LOCK_TYPE | TABLE_SCHEMA |\nTABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| 46 | MDL_SHARED_NO_WRITE | NULL | User lock | lock3 |\n |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n\nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n| 1 |\n+-----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\nEmpty set (0.000 sec)\n\nTimeout example: Connection 1:\n\nSELECT GET_LOCK(\'lock4\',10);\n+----------------------+\n| GET_LOCK(\'lock4\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n\nConnection 2:\n\nSELECT GET_LOCK(\'lock4\',10);\n\nAfter 10 seconds...\n\n+----------------------+\n| GET_LOCK(\'lock4\',10) |\n+----------------------+\n| 0 |\n+----------------------+\n\nDeadlocks are automatically detected and resolved. Connection 1:\n\nSELECT GET_LOCK(\'lock5\',10); \n+----------------------+\n| GET_LOCK(\'lock5\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n\nConnection 2:\n\nSELECT GET_LOCK(\'lock6\',10);\n+----------------------+\n| GET_LOCK(\'lock6\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n\nConnection 1:\n\nSELECT GET_LOCK(\'lock6\',10); \n+----------------------+\n| GET_LOCK(\'lock6\',10) |\n+----------------------+\n| 0 |\n+----------------------+\n\nConnection 2:\n\nSELECT GET_LOCK(\'lock5\',10);\nERROR 1213 (40001): Deadlock found when trying to get lock; try restarting\ntransaction\n\n\n\nURL: mariadb.com/kb/en/get_lock/','','https://mariadb.com/kb/en/get_lock/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (159,14,'INET6_ATON','Syntax\n------\n\nINET6_ATON(expr)\n\nDescription\n-----------\n\nGiven an IPv6 or IPv4 network address as a string, returns a binary string\nthat represents the numeric value of the address.\n\nNo trailing zone ID\'s or traling network masks are permitted. For IPv4\naddresses, or IPv6 addresses with IPv4 address parts, no classful addresses or\ntrailing port numbers are permitted and octal numbers are not supported.\n\nThe returned binary string will be VARBINARY(16) or VARBINARY(4) for IPv6 and\nIPv4 addresses respectively.\n\nReturns NULL if the argument is not understood.\n\nMariaDB starting with 10.5.0\n----------------------------\nFrom MariaDB 10.5.0, INET6_ATON can take INET6 as an argument.\n\nExamples\n--------\n\nSELECT HEX(INET6_ATON(\'10.0.1.1\'));\n+-----------------------------+\n| HEX(INET6_ATON(\'10.0.1.1\')) |\n+-----------------------------+\n| 0A000101 |\n+-----------------------------+\n\nSELECT HEX(INET6_ATON(\'48f3::d432:1431:ba23:846f\'));\n+----------------------------------------------+\n| HEX(INET6_ATON(\'48f3::d432:1431:ba23:846f\')) |\n+----------------------------------------------+\n| 48F3000000000000D4321431BA23846F |\n+----------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/inet6_aton/','','https://mariadb.com/kb/en/inet6_aton/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (160,14,'INET6_NTOA','Syntax\n------\n\nINET6_NTOA(expr)\n\nDescription\n-----------\n\nGiven an IPv6 or IPv4 network address as a numeric binary string, returns the\naddress as a nonbinary string in the connection character set.\n\nThe return string is lowercase, and is platform independent, since it does not\nuse functions specific to the operating system. It has a maximum length of 39\ncharacters.\n\nReturns NULL if the argument is not understood.\n\nExamples\n--------\n\nSELECT INET6_NTOA(UNHEX(\'0A000101\'));\n+-------------------------------+\n| INET6_NTOA(UNHEX(\'0A000101\')) |\n+-------------------------------+\n| 10.0.1.1 |\n+-------------------------------+\n\nSELECT INET6_NTOA(UNHEX(\'48F3000000000000D4321431BA23846F\'));\n+-------------------------------------------------------+\n| INET6_NTOA(UNHEX(\'48F3000000000000D4321431BA23846F\')) |\n+-------------------------------------------------------+\n| 48f3::d432:1431:ba23:846f |\n+-------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/inet6_ntoa/','','https://mariadb.com/kb/en/inet6_ntoa/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (161,14,'INET_ATON','Syntax\n------\n\nINET_ATON(expr)\n\nDescription\n-----------\n\nGiven the dotted-quad representation of an IPv4 network address as a string,\nreturns an integer that represents the numeric value of the address. Addresses\nmay be 4- or 8-byte addresses.\n\nReturns NULL if the argument is not understood.\n\nExamples\n--------\n\nSELECT INET_ATON(\'192.168.1.1\');\n+--------------------------+\n| INET_ATON(\'192.168.1.1\') |\n+--------------------------+\n| 3232235777 |\n+--------------------------+\n\nThis is calculated as follows: 192 x 2563 + 168 x 256 2 + 1 x 256 + 1\n\n\n\nURL: mariadb.com/kb/en/inet_aton/','','https://mariadb.com/kb/en/inet_aton/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (162,14,'INET_NTOA','Syntax\n------\n\nINET_NTOA(expr)\n\nDescription\n-----------\n\nGiven a numeric IPv4 network address in network byte order (4 or 8 byte),\nreturns the dotted-quad representation of the address as a string.\n\nExamples\n--------\n\nSELECT INET_NTOA(3232235777);\n+-----------------------+\n| INET_NTOA(3232235777) |\n+-----------------------+\n| 192.168.1.1 |\n+-----------------------+\n\n192.168.1.1 corresponds to 3232235777 since 192 x 2563 + 168 x 256 2 + 1 x 256\n+ 1 = 3232235777\n\n\n\nURL: mariadb.com/kb/en/inet_ntoa/','','https://mariadb.com/kb/en/inet_ntoa/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (163,14,'IS_FREE_LOCK','Syntax\n------\n\nIS_FREE_LOCK(str)\n\nDescription\n-----------\n\nChecks whether the lock named str is free to use (that is, not locked).\nReturns 1 if the lock is free (no one is using the lock), 0 if the lock is in\nuse, and NULL if an error occurs (such as an incorrect argument, like an empty\nstring or NULL). str is case insensitive.\n\nIf the metadata_lock_info plugin is installed, the Information Schema\nmetadata_lock_info table contains information about locks of this kind (as\nwell as metadata locks).\n\nStatements using the IS_FREE_LOCK function are not safe for statement-based\nreplication.\n\n\n\nURL: mariadb.com/kb/en/is_free_lock/','','https://mariadb.com/kb/en/is_free_lock/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (164,14,'IS_IPV4','Syntax\n------\n\nIS_IPV4(expr)\n\nDescription\n-----------\n\nIf the expression is a valid IPv4 address, returns 1, otherwise returns 0.\n\nIS_IPV4() is stricter than INET_ATON(), but as strict as INET6_ATON(), in\ndetermining the validity of an IPv4 address. This implies that if IS_IPV4\nreturns 1, the same expression will always return a non-NULL result when\npassed to INET_ATON(), but that the reverse may not apply.\n\nExamples\n--------\n\nSELECT IS_IPV4(\'1110.0.1.1\');\n+-----------------------+\n| IS_IPV4(\'1110.0.1.1\') |\n+-----------------------+\n| 0 |\n+-----------------------+\n\nSELECT IS_IPV4(\'48f3::d432:1431:ba23:846f\');\n+--------------------------------------+\n| IS_IPV4(\'48f3::d432:1431:ba23:846f\') |\n+--------------------------------------+\n| 0 |\n+--------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/is_ipv4/','','https://mariadb.com/kb/en/is_ipv4/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (165,14,'IS_IPV4_COMPAT','Syntax\n------\n\nIS_IPV4_COMPAT(expr)\n\nDescription\n-----------\n\nReturns 1 if a given numeric binary string IPv6 address, such as returned by\nINET6_ATON(), is IPv4-compatible, otherwise returns 0.\n\nMariaDB starting with 10.5.0\n----------------------------\nFrom MariaDB 10.5.0, when the argument is not INET6, automatic implicit CAST\nto INET6 is applied. As a consequence, IS_IPV4_COMPAT now understands\narguments in both text representation and binary(16) representation. Before\nMariaDB 10.5.0, the function understood only binary(16) representation.\n\nExamples\n--------\n\nSELECT IS_IPV4_COMPAT(INET6_ATON(\'::10.0.1.1\'));\n+------------------------------------------+\n| IS_IPV4_COMPAT(INET6_ATON(\'::10.0.1.1\')) |\n+------------------------------------------+\n| 1 |\n+------------------------------------------+\n\nSELECT IS_IPV4_COMPAT(INET6_ATON(\'::48f3::d432:1431:ba23:846f\'));\n+-----------------------------------------------------------+\n| IS_IPV4_COMPAT(INET6_ATON(\'::48f3::d432:1431:ba23:846f\')) |\n+-----------------------------------------------------------+\n| 0 |\n+-----------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/is_ipv4_compat/','','https://mariadb.com/kb/en/is_ipv4_compat/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (166,14,'IS_IPV4_MAPPED','Syntax\n------\n\nIS_IPV4_MAPPED(expr)\n\nDescription\n-----------\n\nReturns 1 if a given a numeric binary string IPv6 address, such as returned by\nINET6_ATON(), is a valid IPv4-mapped address, otherwise returns 0.\n\nMariaDB starting with 10.5.0\n----------------------------\nFrom MariaDB 10.5.0, when the argument is not INET6, automatic implicit CAST\nto INET6 is applied. As a consequence, IS_IPV4_MAPPED now understands\narguments in both text representation and binary(16) representation. Before\nMariaDB 10.5.0, the function understood only binary(16) representation.\n\nExamples\n--------\n\nSELECT IS_IPV4_MAPPED(INET6_ATON(\'::10.0.1.1\'));\n+------------------------------------------+\n| IS_IPV4_MAPPED(INET6_ATON(\'::10.0.1.1\')) |\n+------------------------------------------+\n| 0 |\n+------------------------------------------+\n\nSELECT IS_IPV4_MAPPED(INET6_ATON(\'::ffff:10.0.1.1\'));\n+-----------------------------------------------+\n| IS_IPV4_MAPPED(INET6_ATON(\'::ffff:10.0.1.1\')) |\n+-----------------------------------------------+\n| 1 |\n+-----------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/is_ipv4_mapped/','','https://mariadb.com/kb/en/is_ipv4_mapped/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (167,14,'IS_IPV6','Syntax\n------\n\nIS_IPV6(expr)\n\nDescription\n-----------\n\nReturns 1 if the expression is a valid IPv6 address specified as a string,\notherwise returns 0. Does not consider IPv4 addresses to be valid IPv6\naddresses.\n\nExamples\n--------\n\nSELECT IS_IPV6(\'48f3::d432:1431:ba23:846f\');\n+--------------------------------------+\n| IS_IPV6(\'48f3::d432:1431:ba23:846f\') |\n+--------------------------------------+\n| 1 |\n+--------------------------------------+\n1 row in set (0.02 sec)\n\nSELECT IS_IPV6(\'10.0.1.1\');\n+---------------------+\n| IS_IPV6(\'10.0.1.1\') |\n+---------------------+\n| 0 |\n+---------------------+\n\n\n\nURL: mariadb.com/kb/en/is_ipv6/','','https://mariadb.com/kb/en/is_ipv6/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (168,14,'IS_USED_LOCK','Syntax\n------\n\nIS_USED_LOCK(str)\n\nDescription\n-----------\n\nChecks whether the lock named str is in use (that is, locked). If so, it\nreturns the connection identifier of the client that holds the lock.\nOtherwise, it returns NULL. str is case insensitive.\n\nIf the metadata_lock_info plugin is installed, the Information Schema\nmetadata_lock_info table contains information about locks of this kind (as\nwell as metadata locks).\n\nStatements using the IS_USED_LOCK function are not safe for statement-based\nreplication.\n\n\n\nURL: mariadb.com/kb/en/is_used_lock/','','https://mariadb.com/kb/en/is_used_lock/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (169,14,'MASTER_GTID_WAIT','Syntax\n------\n\nMASTER_GTID_WAIT(gtid-list[, timeout)\n\nDescription\n-----------\n\nThis function takes a string containing a comma-separated list of global\ntransaction id\'s (similar to the value of, for example, gtid_binlog_pos). It\nwaits until the value of gtid_slave_pos has the same or higher seq_no within\nall replication domains specified in the gtid-list; in other words, it waits\nuntil the slave has reached the specified GTID position.\n\nAn optional second argument gives a timeout in seconds. If the timeout expires\nbefore the specified GTID position is reached, then the function returns -1.\nPassing NULL or a negative number for the timeout means no timeout, and the\nfunction will wait indefinitely.\n\nIf the wait completes without a timeout, 0 is returned. Passing NULL for the\ngtid-list makes the function return NULL immediately, without waiting.\n\nThe gtid-list may be the empty string, in which case MASTER_GTID_WAIT()\nreturns immediately. If the gtid-list contains fewer domains than\ngtid_slave_pos, then only those domains are waited upon. If gtid-list contains\na domain that is not present in @@gtid_slave_pos, then MASTER_GTID_WAIT() will\nwait until an event containing such domain_id arrives on the slave (or until\ntimed out or killed).\n\nMASTER_GTID_WAIT() can be useful to ensure that a slave has caught up to a\nmaster. Simply take the value of gtid_binlog_pos on the master, and use it in\na MASTER_GTID_WAIT() call on the slave; when the call completes, the slave\nwill have caught up with that master position.\n\nMASTER_GTID_WAIT() can also be used in client applications together with the\nlast_gtid session variable. This is useful in a read-scaleout replication\nsetup, where the application writes to a single master but divides the reads\nout to a number of slaves to distribute the load. In such a setup, there is a\nrisk that an application could first do an update on the master, and then a\nbit later do a read on a slave, and if the slave is not fast enough, the data\nread from the slave might not include the update just made, possibly confusing\nthe application and/or the end-user. One way to avoid this is to request the\nvalue of last_gtid on the master just after the update. Then before doing the\nread on the slave, do a MASTER_GTID_WAIT() on the value obtained from the\nmaster; this will ensure that the read is not performed until the slave has\nreplicated sufficiently far for the update to have become visible.\n\nNote that MASTER_GTID_WAIT() can be used even if the slave is configured not\nto use GTID for connections (CHANGE MASTER TO master_use_gtid=no). This is\nbecause from MariaDB 10, GTIDs are always logged on the master server, and\nalways recorded on the slave servers.\n\nDifferences to MASTER_POS_WAIT()\n--------------------------------\n\n* MASTER_GTID_WAIT() is global; it waits for any master connection to reach\n the specified GTID position. MASTER_POS_WAIT() works only against a\n specific connection. This also means that while MASTER_POS_WAIT() aborts if\n its master connection is terminated with STOP SLAVE or due to an error,\n MASTER_GTID_WAIT() continues to wait while slaves are stopped.\n\n* MASTER_GTID_WAIT() can take its timeout as a floating-point value, so a\n timeout in fractional seconds is supported, eg. MASTER_GTID_WAIT("0-1-100",\n 0.5). (The minimum wait is one microsecond, 0.000001 seconds).\n\n* MASTER_GTID_WAIT() allows one to specify a timeout of zero in order to do a\n non-blocking check to see if the slaves have progressed to a specific GTID\nposition\n (MASTER_POS_WAIT() takes a zero timeout as meaning an infinite wait). To do\n an infinite MASTER_GTID_WAIT(), specify a negative timeout, or omit the\n timeout argument.\n\n* MASTER_GTID_WAIT() does not return the number of events executed since the\n wait started, nor does it return NULL if a slave thread is stopped. It\n always returns either 0 for successful wait completed, or -1 for timeout\n reached (or NULL if the specified gtid-pos is NULL).\n\nSince MASTER_GTID_WAIT() looks only at the seq_no part of the GTIDs, not the\nserver_id, care is needed if a slave becomes diverged from another server so\nthat two different GTIDs with the same seq_no (in the same domain) arrive at\nthe same server. This situation is in any case best avoided; setting\ngtid_strict_mode is recommended, as this will prevent any such out-of-order\nsequence numbers from ever being replicated on a slave.\n\n\n\nURL: mariadb.com/kb/en/master_gtid_wait/','','https://mariadb.com/kb/en/master_gtid_wait/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (170,14,'MASTER_POS_WAIT','Syntax\n------\n\nMASTER_POS_WAIT(log_name,log_pos[,timeout,["connection_name"]])\n\nDescription\n-----------\n\nThis function is useful in replication for controlling primary/replica\nsynchronization. It blocks until the replica has read and applied all updates\nup to the specified position (log_name,log_pos) in the primary log. The return\nvalue is the number of log events the replica had to wait for to advance to\nthe specified position. The function returns NULL if the replica SQL thread is\nnot started, the replica\'s primary information is not initialized, the\narguments are incorrect, or an error occurs. It returns -1 if the timeout has\nbeen exceeded. If the replica SQL thread stops while MASTER_POS_WAIT() is\nwaiting, the function returns NULL. If the replica is past the specified\nposition, the function returns immediately.\n\nIf a timeout value is specified, MASTER_POS_WAIT() stops waiting when timeout\nseconds have elapsed. timeout must be greater than 0; a zero or negative\ntimeout means no timeout.\n\nThe connection_name is used when you are using multi-source-replication. If\nyou don\'t specify it, it\'s set to the value of the default_master_connection\nsystem variable.\n\nStatements using the MASTER_POS_WAIT() function are not safe for replication.\n\n\n\nURL: mariadb.com/kb/en/master_pos_wait/','','https://mariadb.com/kb/en/master_pos_wait/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (171,14,'NAME_CONST','Syntax\n------\n\nNAME_CONST(name,value)\n\nDescription\n-----------\n\nReturns the given value. When used to produce a result set column,\nNAME_CONST() causes the column to have the given name. The arguments should be\nconstants.\n\nThis function is used internally when replicating stored procedures. It makes\nlittle sense to use it explicitly in SQL statements, and it was not supposed\nto be used like that.\n\nSELECT NAME_CONST(\'myname\', 14);\n+--------+\n| myname |\n+--------+\n| 14 |\n+--------+\n\n\n\nURL: mariadb.com/kb/en/name_const/','','https://mariadb.com/kb/en/name_const/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (172,14,'RELEASE_LOCK','Syntax\n------\n\nRELEASE_LOCK(str)\n\nDescription\n-----------\n\nReleases the lock named by the string str that was obtained with GET_LOCK().\nReturns 1 if the lock was released, 0 if the lock was not established by this\nthread (in which case the lock is not released), and NULL if the named lock\ndid not exist. The lock does not exist if it was never obtained by a call to\nGET_LOCK() or if it has previously been released.\n\nstr is case insensitive. If str is an empty string or NULL, RELEASE_LOCK()\nreturns NULL and does nothing.\n\nStatements using the RELEASE_LOCK() function are not safe for replication.\n\nThe DO statement is convenient to use with RELEASE_LOCK().\n\nExamples\n--------\n\nConnection1:\n\nSELECT GET_LOCK(\'lock1\',10);\n+----------------------+\n| GET_LOCK(\'lock1\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n\nConnection 2:\n\nSELECT GET_LOCK(\'lock2\',10);\n+----------------------+\n| GET_LOCK(\'lock2\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n\nConnection 1:\n\nSELECT RELEASE_LOCK(\'lock1\'), RELEASE_LOCK(\'lock2\'), RELEASE_LOCK(\'lock3\');\n+-----------------------+-----------------------+-----------------------+\n| RELEASE_LOCK(\'lock1\') | RELEASE_LOCK(\'lock2\') | RELEASE_LOCK(\'lock3\') |\n+-----------------------+-----------------------+-----------------------+\n| 1 | 0 | NULL |\n+-----------------------+-----------------------+-----------------------+\n\nFrom MariaDB 10.0.2, it is possible to hold the same lock recursively. This\nexample is viewed using the metadata_lock_info plugin:\n\nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n\nSELECT GET_LOCK(\'lock3\',10);\n+----------------------+\n| GET_LOCK(\'lock3\',10) |\n+----------------------+\n| 1 |\n+----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| THREAD_ID | LOCK_MODE | LOCK_DURATION | LOCK_TYPE | TABLE_SCHEMA |\nTABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| 46 | MDL_SHARED_NO_WRITE | NULL | User lock | lock3 |\n |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n\nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n| 1 |\n+-----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| THREAD_ID | LOCK_MODE | LOCK_DURATION | LOCK_TYPE | TABLE_SCHEMA |\nTABLE_NAME |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n| 46 | MDL_SHARED_NO_WRITE | NULL | User lock | lock3 |\n |\n+-----------+---------------------+---------------+-----------+--------------+-\n----------+\n\nSELECT RELEASE_LOCK(\'lock3\');\n+-----------------------+\n| RELEASE_LOCK(\'lock3\') |\n+-----------------------+\n| 1 |\n+-----------------------+\n\nSELECT * FROM INFORMATION_SCHEMA.METADATA_LOCK_INFO;\nEmpty set (0.000 sec)\n\n\n\nURL: mariadb.com/kb/en/release_lock/','','https://mariadb.com/kb/en/release_lock/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (173,14,'SLEEP','Syntax\n------\n\nSLEEP(duration)\n\nDescription\n-----------\n\nSleeps (pauses) for the number of seconds given by the duration argument, then\nreturns 0. If SLEEP() is interrupted, it returns 1. The duration may have a\nfractional part given in microseconds.\n\nStatements using the SLEEP() function are not safe for replication.\n\nExample\n-------\n\nSELECT SLEEP(5.5);\n+------------+\n| SLEEP(5.5) |\n+------------+\n| 0 |\n+------------+\n1 row in set (5.50 sec)\n\n\n\nURL: mariadb.com/kb/en/sleep/','','https://mariadb.com/kb/en/sleep/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (174,14,'UUID','Syntax\n------\n\nUUID()\n\nDescription\n-----------\n\nReturns a Universally Unique Identifier (UUID).\n\nA UUID is designed as a number that is globally unique in space and time. Two\ncalls to UUID() are expected to generate two different values, even if these\ncalls are performed on two separate computers that are not connected to each\nother.\n\nUUID() results are intended to be unique, but cannot always be relied upon to\nunpredictable and unguessable, so should not be relied upon for these purposes.\n\nA UUID is a 128-bit number represented by a utf8 string of five hexadecimal\nnumbers in aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee format:\n\n* The first three numbers are generated from a timestamp.\n* The fourth number preserves temporal uniqueness in case the timestamp value\n loses monotonicity (for example, due to daylight saving time).\n* The fifth number is an IEEE 802 node number that provides spatial uniqueness.\n A random number is substituted if the latter is not available (for example,\n because the host computer has no Ethernet card, or we do not know how to find\n the hardware address of an interface on your operating system). In this case,\n spatial uniqueness cannot be guaranteed. Nevertheless, a collision should\n have very low probability.\n\nCurrently, the MAC address of an interface is taken into account only on\nFreeBSD and Linux. On other operating systems, MariaDB uses a randomly\ngenerated 48-bit number.\n\nStatements using the UUID() function are not safe for replication.\n\nThe results are generated according to the "DCE 1.1:Remote Procedure Call"\n(Appendix A) CAE (Common Applications Environment) Specifications published by\nThe Open Group in October 1997 (Document Number C706).\n\nExamples\n--------\n\nSELECT UUID();\n+--------------------------------------+\n| UUID() |\n+--------------------------------------+\n| cd41294a-afb0-11df-bc9b-00241dd75637 |\n+--------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/uuid/','','https://mariadb.com/kb/en/uuid/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (175,14,'UUID_SHORT','Syntax\n------\n\nUUID_SHORT()\n\nDescription\n-----------\n\nReturns a "short" universally unique identifier as a 64-bit unsigned integer\n(rather than a string-form 128-bit identifier as returned by the UUID()\nfunction).\n\nThe value of UUID_SHORT() is guaranteed to be unique if the following\nconditions hold:\n\n* The server_id of the current host is unique among your set of master and\n slave servers\n* server_id is between 0 and 255\n* You don\'t set back your system time for your server between mysqld restarts\n* You do not invoke UUID_SHORT() on average more than 16\n million times per second between mysqld restarts\n\nThe UUID_SHORT() return value is constructed this way:\n\n(server_id & 255) << 56\n+ (server_startup_time_in_seconds << 24)\n+ incremented_variable++;\n\nStatements using the UUID_SHORT() function are not safe for statement-based\nreplication.\n\nExamples\n--------\n\nSELECT UUID_SHORT();\n+-------------------+\n| UUID_SHORT() |\n+-------------------+\n| 21517162376069120 |\n+-------------------+\n\ncreate table t1 (a bigint unsigned default(uuid_short()) primary key);\ninsert into t1 values(),();\nselect * from t1;\n+-------------------+\n| a |\n+-------------------+\n| 98113699159474176 |\n| 98113699159474177 |\n+-------------------+\n\n\n\nURL: mariadb.com/kb/en/uuid_short/','','https://mariadb.com/kb/en/uuid_short/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (176,14,'VALUES / VALUE','Syntax\n------\n\nMariaDB starting with 10.3.3\n----------------------------\n\nVALUE(col_name)\n\nMariaDB until 10.3.2\n--------------------\n\nVALUES(col_name)\n\nDescription\n-----------\n\nIn an INSERT ... ON DUPLICATE KEY UPDATE statement, you can use the\nVALUES(col_name) function in the UPDATE clause to refer to column values from\nthe INSERT portion of the statement. In other words, VALUES(col_name) in the\nUPDATE clause refers to the value of col_name that would be inserted, had no\nduplicate-key conflict occurred. This function is especially useful in\nmultiple-row inserts.\n\nThe VALUES() function is meaningful only in INSERT ... ON DUPLICATE KEY UPDATE\nstatements and returns NULL otherwise.\n\nIn MariaDB 10.3.3 this function was renamed to VALUE(), because it\'s\nincompatible with the standard Table Value Constructors syntax, implemented in\nMariaDB 10.3.3.\n\nThe VALUES() function can still be used even from MariaDB 10.3.3, but only in\nINSERT ... ON DUPLICATE KEY UPDATE statements; it\'s a syntax error otherwise.\n\nExamples\n--------\n\nMariaDB starting with 10.3.3\n----------------------------\n\nINSERT INTO t (a,b,c) VALUES (1,2,3),(4,5,6)\n ON DUPLICATE KEY UPDATE c=VALUE(a)+VALUE(b);\n\nMariaDB until 10.3.2\n--------------------\n\nINSERT INTO t (a,b,c) VALUES (1,2,3),(4,5,6)\n ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);\n\n\n\nURL: mariadb.com/kb/en/values-value/','','https://mariadb.com/kb/en/values-value/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (177,15,'!','Syntax\n------\n\nNOT, !\n\nDescription\n-----------\n\nLogical NOT. Evaluates to 1 if the operand is 0, to 0 if the operand is\nnon-zero, and NOT NULL returns NULL.\n\nBy default, the ! operator has a higher precedence. If the HIGH_NOT_PRECEDENCE\nSQL_MODE flag is set, NOT and ! have the same precedence.\n\nExamples\n--------\n\nSELECT NOT 10;\n+--------+\n| NOT 10 |\n+--------+\n| 0 |\n+--------+\n\nSELECT NOT 0;\n+-------+\n| NOT 0 |\n+-------+\n| 1 |\n+-------+\n\nSELECT NOT NULL;\n+----------+\n| NOT NULL |\n+----------+\n| NULL |\n+----------+\n\nSELECT ! (1+1);\n+---------+\n| ! (1+1) |\n+---------+\n| 0 |\n+---------+\n\nSELECT ! 1+1;\n+-------+\n| ! 1+1 |\n+-------+\n| 1 |\n+-------+\n\n\n\nURL: mariadb.com/kb/en/not/','','https://mariadb.com/kb/en/not/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (178,15,'&amp;&amp;','Syntax\n------\n\nAND, &&\n\nDescription\n-----------\n\nLogical AND. Evaluates to 1 if all operands are non-zero and not NULL, to 0 if\none or more operands are 0, otherwise NULL is returned.\n\nFor this operator, short-circuit evaluation can be used.\n\nExamples\n--------\n\nSELECT 1 && 1;\n+--------+\n| 1 && 1 |\n+--------+\n| 1 |\n+--------+\n\nSELECT 1 && 0;\n+--------+\n| 1 && 0 |\n+--------+\n| 0 |\n+--------+\n\nSELECT 1 && NULL;\n+-----------+\n| 1 && NULL |\n+-----------+\n| NULL |\n+-----------+\n\nSELECT 0 && NULL;\n+-----------+\n| 0 && NULL |\n+-----------+\n| 0 |\n+-----------+\n\nSELECT NULL && 0;\n+-----------+\n| NULL && 0 |\n+-----------+\n| 0 |\n+-----------+\n\n\n\nURL: mariadb.com/kb/en/and/','','https://mariadb.com/kb/en/and/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (179,15,'||','Syntax\n------\n\nOR, ||\n\nDescription\n-----------\n\nLogical OR. When both operands are non-NULL, the result is 1 if any operand is\nnon-zero, and 0 otherwise. With a NULL operand, the result is 1 if the other\noperand is non-zero, and NULL otherwise. If both operands are NULL, the result\nis NULL.\n\nFor this operator, short-circuit evaluation can be used.\n\nNote that, if the PIPES_AS_CONCAT SQL_MODE is set, || is used as a string\nconcatenation operator. This means that a || b is the same as CONCAT(a,b). See\nCONCAT() for details.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, || ignores NULL.\n\nExamples\n--------\n\nSELECT 1 || 1;\n+--------+\n| 1 || 1 |\n+--------+\n| 1 |\n+--------+\n\nSELECT 1 || 0;\n+--------+\n| 1 || 0 |\n+--------+\n| 1 |\n+--------+\n\nSELECT 0 || 0;\n+--------+\n| 0 || 0 |\n+--------+\n| 0 |\n+--------+\n\nSELECT 0 || NULL;\n+-----------+\n| 0 || NULL |\n+-----------+\n| NULL |\n+-----------+\n\nSELECT 1 || NULL;\n+-----------+\n| 1 || NULL |\n+-----------+\n| 1 |\n+-----------+\n\nIn Oracle mode, from MariaDB 10.3:\n\nSELECT 0 || NULL;\n+-----------+\n| 0 || NULL |\n+-----------+\n| 0 |\n+-----------+\n\n\n\nURL: mariadb.com/kb/en/or/','','https://mariadb.com/kb/en/or/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (180,15,'XOR','Syntax\n------\n\nXOR\n\nDescription\n-----------\n\nXOR stands for eXclusive OR. Returns NULL if either operand is NULL. For\nnon-NULL operands, evaluates to 1 if an odd number of operands is non-zero,\notherwise 0 is returned.\n\nExamples\n--------\n\nSELECT 1 XOR 1;\n+---------+\n| 1 XOR 1 |\n+---------+\n| 0 |\n+---------+\n\nSELECT 1 XOR 0;\n+---------+\n| 1 XOR 0 |\n+---------+\n| 1 |\n+---------+\n\nSELECT 1 XOR NULL;\n+------------+\n| 1 XOR NULL |\n+------------+\n| NULL |\n+------------+\n\nIn the following example, the right 1 XOR 1 is evaluated first, and returns 0.\nThen, 1 XOR 0 is evaluated, and 1 is returned.\n\nSELECT 1 XOR 1 XOR 1;\n+---------------+\n| 1 XOR 1 XOR 1 |\n+---------------+\n| 1 |\n+---------------+\n\n\n\nURL: mariadb.com/kb/en/xor/','','https://mariadb.com/kb/en/xor/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (181,15,'Assignment Operator (=)','Syntax\n------\n\nidentifier = expr\n\nDescription\n-----------\n\nThe equal sign is used as both an assignment operator in certain contexts, and\nas a comparison operator. When used as assignment operator, the value on the\nright is assigned to the variable (or column, in some contexts) on the left.\n\nSince its use can be ambiguous, unlike the := assignment operator, the =\nassignment operator cannot be used in all contexts, and is only valid as part\nof a SET statement, or the SET clause of an UPDATE statement\n\nThis operator works with both user-defined variables and local variables.\n\nExamples\n--------\n\nUPDATE table_name SET x = 2 WHERE x > 100;\n\nSET @x = 1, @y := 2;\n\n\n\nURL: mariadb.com/kb/en/assignment-operators-assignment-operator/','','https://mariadb.com/kb/en/assignment-operators-assignment-operator/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (182,15,'Assignment Operator (:=)','Syntax\n------\n\nvar_name := expr\n\nDescription\n-----------\n\nAssignment operator for assigning a value. The value on the right is assigned\nto the variable on left.\n\nUnlike the = operator, := can always be used to assign a value to a variable.\n\nThis operator works with both user-defined variables and local variables.\n\nWhen assigning the same value to several variables, LAST_VALUE() can be useful.\n\nExamples\n--------\n\nSELECT @x := 10;\n+----------+\n| @x := 10 |\n+----------+\n| 10 |\n+----------+\n\nSELECT @x, @y := @x;\n+------+----------+\n| @x | @y := @x |\n+------+----------+\n| 10 | 10 |\n+------+----------+\n\n\n\nURL: mariadb.com/kb/en/assignment-operator/','','https://mariadb.com/kb/en/assignment-operator/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (183,16,'Stored Aggregate Functions','MariaDB starting with 10.3.3\n----------------------------\nThe ability to create stored aggregate functions was added in MariaDB 10.3.3.\n\nAggregate functions are functions that are computed over a sequence of rows\nand return one result for the sequence of rows.\n\nCreating a custom aggregate function is done using the CREATE FUNCTION\nstatement with two main differences:\n\n* The addition of the AGGREGATE keyword, so CREATE AGGREGATE FUNCTION\n* The FETCH GROUP NEXT ROW instruction inside the loop\n* Oracle PL/SQL compatibility using SQL/PL is provided\n\nStandard Syntax\n---------------\n\nCREATE AGGREGATE FUNCTION function_name (parameters) RETURNS return_type\nBEGIN\n All types of declarations\n DECLARE CONTINUE HANDLER FOR NOT FOUND RETURN return_val;\n LOOP\n FETCH GROUP NEXT ROW; // fetches next row from table\n other instructions\n END LOOP;\nEND\n\nStored aggregate functions were a 2016 Google Summer of Code project by Varun\nGupta.\n\nUsing SQL/PL\n------------\n\nSET sql_mode=Oracle;\nDELIMITER //\n\nCREATE AGGREGATE FUNCTION function_name (parameters) RETURN return_type\n declarations\nBEGIN\n LOOP\n FETCH GROUP NEXT ROW; -- fetches next row from table\n -- other instructions\n\nEND LOOP;\nEXCEPTION\n WHEN NO_DATA_FOUND THEN\n RETURN return_val;\nEND //\n\nDELIMITER ;\n\nExamples\n--------\n\nFirst a simplified example:\n\nCREATE TABLE marks(stud_id INT, grade_count INT);\n\nINSERT INTO marks VALUES (1,6), (2,4), (3,7), (4,5), (5,8);\n\nSELECT * FROM marks;\n+---------+-------------+\n| stud_id | grade_count |\n+---------+-------------+\n| 1 | 6 |\n| 2 | 4 |\n| 3 | 7 |\n| 4 | 5 |\n| 5 | 8 |\n+---------+-------------+\n\nDELIMITER //\nCREATE AGGREGATE FUNCTION IF NOT EXISTS aggregate_count(x INT) RETURNS INT\nBEGIN\n DECLARE count_students INT DEFAULT 0;\n DECLARE CONTINUE HANDLER FOR NOT FOUND\n RETURN count_students;\n LOOP\n FETCH GROUP NEXT ROW;\n IF x THEN\n SET count_students = count_students+1;\n END IF;\n END LOOP;\nEND //\nDELIMITER ;\n\nA non-trivial example that cannot easily be rewritten using existing functions:\n\nDELIMITER //\nCREATE AGGREGATE FUNCTION medi_int(x INT) RETURNS DOUBLE\nBEGIN\n DECLARE CONTINUE HANDLER FOR NOT FOUND\n BEGIN\n DECLARE res DOUBLE;\n DECLARE cnt INT DEFAULT (SELECT COUNT(*) FROM tt);\n DECLARE lim INT DEFAULT (cnt-1) DIV 2;\n IF cnt % 2 = 0 THEN\n SET res = (SELECT AVG(a) FROM (SELECT a FROM tt ORDER BY a LIMIT\nlim,2) ttt);\n ELSE\n SET res = (SELECT a FROM tt ORDER BY a LIMIT lim,1);\n END IF;\n DROP TEMPORARY TABLE tt;\n RETURN res;\n END;\n CREATE TEMPORARY TABLE tt (a INT);\n LOOP\n FETCH GROUP NEXT ROW;\n INSERT INTO tt VALUES (x);\n END LOOP;\nEND //\nDELIMITER ;\n\nSQL/PL Example\n--------------\n\nThis uses the same marks table as created above.\n\nSET sql_mode=Oracle;\nDELIMITER //\n\nCREATE AGGREGATE FUNCTION aggregate_count(x INT) RETURN INT AS count_students\nINT DEFAULT 0;\nBEGIN\n LOOP\n FETCH GROUP NEXT ROW;\n IF x THEN\n SET count_students := count_students+1;\n END IF;\n END LOOP;\nEXCEPTION\n WHEN NO_DATA_FOUND THEN\n RETURN count_students;\nEND aggregate_count //\nDELIMITER ;\n\nSELECT aggregate_count(stud_id) FROM marks;\n\n\n\nURL: mariadb.com/kb/en/stored-aggregate-functions/','','https://mariadb.com/kb/en/stored-aggregate-functions/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (184,16,'AVG','Syntax\n------\n\nAVG([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the average value of expr. The DISTINCT option can be used to return\nthe average of the distinct values of expr. NULL values are ignored. It is an\naggregate function, and so can be used with the GROUP BY clause.\n\nAVG() returns NULL if there were no matching rows.\n\nFrom MariaDB 10.2.0, AVG() can be used as a window function.\n\nExamples\n--------\n\nCREATE TABLE sales (sales_value INT);\n\nINSERT INTO sales VALUES(10),(20),(20),(40);\n\nSELECT AVG(sales_value) FROM sales;\n+------------------+\n| AVG(sales_value) |\n+------------------+\n| 22.5000 |\n+------------------+\n\nSELECT AVG(DISTINCT(sales_value)) FROM sales;\n+----------------------------+\n| AVG(DISTINCT(sales_value)) |\n+----------------------------+\n| 23.3333 |\n+----------------------------+\n\nCommonly, AVG() is used with a GROUP BY clause:\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT name, AVG(score) FROM student GROUP BY name;\n+---------+------------+\n| name | AVG(score) |\n+---------+------------+\n| Chun | 74.0000 |\n| Esben | 37.0000 |\n| Kaolin | 72.0000 |\n| Tatiana | 85.0000 |\n+---------+------------+\n\nBe careful to avoid this common mistake, not grouping correctly and returning\nmismatched data:\n\nSELECT name,test,AVG(score) FROM student;\n+------+------+------------+\n| name | test | MIN(score) |\n+------+------+------------+\n| Chun | SQL | 31 |\n+------+------+------------+\n\nAs a window function:\n\nCREATE TABLE student_test (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT name, test, score, AVG(score) OVER (PARTITION BY test) \n AS average_by_test FROM student_test;\n+---------+--------+-------+-----------------+\n| name | test | score | average_by_test |\n+---------+--------+-------+-----------------+\n| Chun | SQL | 75 | 65.2500 |\n| Chun | Tuning | 73 | 68.7500 |\n| Esben | SQL | 43 | 65.2500 |\n| Esben | Tuning | 31 | 68.7500 |\n| Kaolin | SQL | 56 | 65.2500 |\n| Kaolin | Tuning | 88 | 68.7500 |\n| Tatiana | SQL | 87 | 65.2500 |\n| Tatiana | Tuning | 83 | 68.7500 |\n+---------+--------+-------+-----------------+\n\n\n\nURL: mariadb.com/kb/en/avg/','','https://mariadb.com/kb/en/avg/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (185,16,'BIT_AND','Syntax\n------\n\nBIT_AND(expr) [over_clause]\n\nDescription\n-----------\n\nReturns the bitwise AND of all bits in expr. The calculation is performed with\n64-bit (BIGINT) precision. It is an aggregate function, and so can be used\nwith the GROUP BY clause.\n\nIf no rows match, BIT_AND will return a value with all bits set to 1. NULL\nvalues have no effect on the result unless all results are NULL, which is\ntreated as no match.\n\nFrom MariaDB 10.2.0, BIT_AND can be used as a window function with the\naddition of the over_clause.\n\nExamples\n--------\n\nCREATE TABLE vals (x INT);\n\nINSERT INTO vals VALUES(111),(110),(100);\n\nSELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals;\n+------------+-----------+------------+\n| BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+------------+-----------+------------+\n| 100 | 111 | 101 |\n+------------+-----------+------------+\n\nAs an aggregate function:\n\nCREATE TABLE vals2 (category VARCHAR(1), x INT);\n\nINSERT INTO vals2 VALUES\n (\'a\',111),(\'a\',110),(\'a\',100),\n (\'b\',\'000\'),(\'b\',001),(\'b\',011);\n\nSELECT category, BIT_AND(x), BIT_OR(x), BIT_XOR(x) \n FROM vals GROUP BY category;\n+----------+------------+-----------+------------+\n| category | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+----------+------------+-----------+------------+\n| a | 100 | 111 | 101 |\n| b | 0 | 11 | 10 |\n+----------+------------+-----------+------------+\n\nNo match:\n\nSELECT BIT_AND(NULL);\n+----------------------+\n| BIT_AND(NULL) |\n+----------------------+\n| 18446744073709551615 |\n+----------------------+\n\n\n\nURL: mariadb.com/kb/en/bit_and/','','https://mariadb.com/kb/en/bit_and/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (186,16,'BIT_OR','Syntax\n------\n\nBIT_OR(expr) [over_clause]\n\nDescription\n-----------\n\nReturns the bitwise OR of all bits in expr. The calculation is performed with\n64-bit (BIGINT) precision. It is an aggregate function, and so can be used\nwith the GROUP BY clause.\n\nIf no rows match, BIT_OR will return a value with all bits set to 0. NULL\nvalues have no effect on the result unless all results are NULL, which is\ntreated as no match.\n\nFrom MariaDB 10.2.0, BIT_OR can be used as a window function with the addition\nof the over_clause.\n\nExamples\n--------\n\nCREATE TABLE vals (x INT);\n\nINSERT INTO vals VALUES(111),(110),(100);\n\nSELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals;\n+------------+-----------+------------+\n| BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+------------+-----------+------------+\n| 100 | 111 | 101 |\n+------------+-----------+------------+\n\nAs an aggregate function:\n\nCREATE TABLE vals2 (category VARCHAR(1), x INT);\n\nINSERT INTO vals2 VALUES\n (\'a\',111),(\'a\',110),(\'a\',100),\n (\'b\',\'000\'),(\'b\',001),(\'b\',011);\n\nSELECT category, BIT_AND(x), BIT_OR(x), BIT_XOR(x) \n FROM vals GROUP BY category;\n+----------+------------+-----------+------------+\n| category | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+----------+------------+-----------+------------+\n| a | 100 | 111 | 101 |\n| b | 0 | 11 | 10 |\n+----------+------------+-----------+------------+\n\nNo match:\n\nSELECT BIT_OR(NULL);\n+--------------+\n| BIT_OR(NULL) |\n+--------------+\n| 0 |\n+--------------+\n\n\n\nURL: mariadb.com/kb/en/bit_or/','','https://mariadb.com/kb/en/bit_or/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (187,16,'BIT_XOR','Syntax\n------\n\nBIT_XOR(expr) [over_clause]\n\nDescription\n-----------\n\nReturns the bitwise XOR of all bits in expr. The calculation is performed with\n64-bit (BIGINT) precision. It is an aggregate function, and so can be used\nwith the GROUP BY clause.\n\nIf no rows match, BIT_XOR will return a value with all bits set to 0. NULL\nvalues have no effect on the result unless all results are NULL, which is\ntreated as no match.\n\nFrom MariaDB 10.2.0, BIT_XOR can be used as a window function with the\naddition of the over_clause.\n\nExamples\n--------\n\nCREATE TABLE vals (x INT);\n\nINSERT INTO vals VALUES(111),(110),(100);\n\nSELECT BIT_AND(x), BIT_OR(x), BIT_XOR(x) FROM vals;\n+------------+-----------+------------+\n| BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+------------+-----------+------------+\n| 100 | 111 | 101 |\n+------------+-----------+------------+\n\nAs an aggregate function:\n\nCREATE TABLE vals2 (category VARCHAR(1), x INT);\n\nINSERT INTO vals2 VALUES\n (\'a\',111),(\'a\',110),(\'a\',100),\n (\'b\',\'000\'),(\'b\',001),(\'b\',011);\n\nSELECT category, BIT_AND(x), BIT_OR(x), BIT_XOR(x) \n FROM vals GROUP BY category;\n+----------+------------+-----------+------------+\n| category | BIT_AND(x) | BIT_OR(x) | BIT_XOR(x) |\n+----------+------------+-----------+------------+\n| a | 100 | 111 | 101 |\n| b | 0 | 11 | 10 |\n+----------+------------+-----------+------------+\n\nNo match:\n\nSELECT BIT_XOR(NULL);\n+---------------+\n| BIT_XOR(NULL) |\n+---------------+\n| 0 |\n+---------------+\n\n\n\nURL: mariadb.com/kb/en/bit_xor/','','https://mariadb.com/kb/en/bit_xor/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (188,16,'COUNT','Syntax\n------\n\nCOUNT(expr)\n\nDescription\n-----------\n\nReturns a count of the number of non-NULL values of expr in the rows retrieved\nby a SELECT statement. The result is a BIGINT value. It is an aggregate\nfunction, and so can be used with the GROUP BY clause.\n\nCOUNT(*) counts the total number of rows in a table.\n\nCOUNT() returns 0 if there were no matching rows.\n\nFrom MariaDB 10.2.0, COUNT() can be used as a window function.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT COUNT(*) FROM student;\n+----------+\n| COUNT(*) |\n+----------+\n| 8 |\n+----------+\n\nCOUNT(DISTINCT) example:\n\nSELECT COUNT(DISTINCT (name)) FROM student;\n+------------------------+\n| COUNT(DISTINCT (name)) |\n+------------------------+\n| 4 |\n+------------------------+\n\nAs a window function\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, COUNT(score) OVER (PARTITION BY name) \n AS tests_written FROM student_test;\n+---------+--------+-------+---------------+\n| name | test | score | tests_written |\n+---------+--------+-------+---------------+\n| Chun | SQL | 75 | 2 |\n| Chun | Tuning | 73 | 2 |\n| Esben | SQL | 43 | 2 |\n| Esben | Tuning | 31 | 2 |\n| Kaolin | SQL | 56 | 2 |\n| Kaolin | Tuning | 88 | 2 |\n| Tatiana | SQL | 87 | 1 |\n+---------+--------+-------+---------------+\n\n\n\nURL: mariadb.com/kb/en/count/','','https://mariadb.com/kb/en/count/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (189,16,'GROUP_CONCAT','Syntax\n------\n\nGROUP_CONCAT(expr)\n\nDescription\n-----------\n\nThis function returns a string result with the concatenated non-NULL values\nfrom a group. It returns NULL if there are no non-NULL values.\n\nThe maximum returned length in bytes is determined by the group_concat_max_len\nserver system variable, which defaults to 1M (>= MariaDB 10.2.4) or 1K (<=\nMariaDB 10.2.3).\n\nIf group_concat_max_len <= 512, the return type is VARBINARY or VARCHAR;\notherwise, the return type is BLOB or TEXT. The choice between binary or\nnon-binary types depends from the input.\n\nThe full syntax is as follows:\n\nGROUP_CONCAT([DISTINCT] expr [,expr ...]\n [ORDER BY {unsigned_integer | col_name | expr}\n [ASC | DESC] [,col_name ...]]\n [SEPARATOR str_val]\n [LIMIT {[offset,] row_count | row_count OFFSET offset}])\n\nDISTINCT eliminates duplicate values from the output string.\n\nORDER BY determines the order of returned values.\n\nSEPARATOR specifies a separator between the values. The default separator is a\ncomma (,). It is possible to avoid using a separator by specifying an empty\nstring.\n\nLIMIT\n-----\n\nMariaDB starting with 10.3.3\n----------------------------\nUntil MariaDB 10.3.2, it was not possible to use the LIMIT clause with\nGROUP_CONCAT. This restriction was lifted in MariaDB 10.3.3.\n\nExamples\n--------\n\nSELECT student_name,\n GROUP_CONCAT(test_score)\n FROM student\n GROUP BY student_name;\n\nGet a readable list of MariaDB users from the mysql.user table:\n\nSELECT GROUP_CONCAT(DISTINCT User ORDER BY User SEPARATOR \'\n\')\n FROM mysql.user;\n\nIn the former example, DISTINCT is used because the same user may occur more\nthan once. The new line (\n) used as a SEPARATOR makes the results easier to\nread.\n\nGet a readable list of hosts from which each user can connect:\n\nSELECT User, GROUP_CONCAT(Host ORDER BY Host SEPARATOR \', \') \n FROM mysql.user GROUP BY User ORDER BY User;\n\nThe former example shows the difference between the GROUP_CONCAT\'s ORDER BY\n(which sorts the concatenated hosts), and the SELECT\'s ORDER BY (which sorts\nthe rows).\n\nFrom MariaDB 10.3.3, LIMIT can be used with GROUP_CONCAT, so, for example,\ngiven the following table:\n\nCREATE TABLE d (dd DATE, cc INT);\n\nINSERT INTO d VALUES (\'2017-01-01\',1);\nINSERT INTO d VALUES (\'2017-01-02\',2);\nINSERT INTO d VALUES (\'2017-01-04\',3);\n\nthe following query:\n\nSELECT SUBSTRING_INDEX(GROUP_CONCAT(CONCAT_WS(":",dd,cc) ORDER BY cc\nDESC),",",1) FROM d;\n+----------------------------------------------------------------------------+\n| SUBSTRING_INDEX(GROUP_CONCAT(CONCAT_WS(":",dd,cc) ORDER BY cc DESC),",",1) |\n+----------------------------------------------------------------------------+\n| 2017-01-04:3 |\n+----------------------------------------------------------------------------+\n\ncan be more simply rewritten as:\n\nSELECT GROUP_CONCAT(CONCAT_WS(":",dd,cc) ORDER BY cc DESC LIMIT 1) FROM d;\n+-------------------------------------------------------------+\n| GROUP_CONCAT(CONCAT_WS(":",dd,cc) ORDER BY cc DESC LIMIT 1) |\n+-------------------------------------------------------------+\n| 2017-01-04:3 |\n+-------------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/group_concat/','','https://mariadb.com/kb/en/group_concat/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (190,16,'MAX','Syntax\n------\n\nMAX([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the largest, or maximum, value of expr. MAX() can also take a string\nargument in which case it returns the maximum string value. The DISTINCT\nkeyword can be used to find the maximum of the distinct values of expr,\nhowever, this produces the same result as omitting DISTINCT.\n\nNote that SET and ENUM fields are currently compared by their string value\nrather than their relative position in the set, so MAX() may produce a\ndifferent highest result than ORDER BY DESC.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nFrom MariaDB 10.2.2, MAX() can be used as a window function.\n\nMAX() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT name, MAX(score) FROM student GROUP BY name;\n+---------+------------+\n| name | MAX(score) |\n+---------+------------+\n| Chun | 75 |\n| Esben | 43 |\n| Kaolin | 88 |\n| Tatiana | 87 |\n+---------+------------+\n\nMAX string:\n\nSELECT MAX(name) FROM student;\n+-----------+\n| MAX(name) |\n+-----------+\n| Tatiana |\n+-----------+\n\nBe careful to avoid this common mistake, not grouping correctly and returning\nmismatched data:\n\nSELECT name,test,MAX(SCORE) FROM student;\n+------+------+------------+\n| name | test | MAX(SCORE) |\n+------+------+------------+\n| Chun | SQL | 88 |\n+------+------+------------+\n\nDifference between ORDER BY DESC and MAX():\n\nCREATE TABLE student2(name CHAR(10),grade ENUM(\'b\',\'c\',\'a\'));\n\nINSERT INTO student2 VALUES(\'Chun\',\'b\'),(\'Esben\',\'c\'),(\'Kaolin\',\'a\');\n\nSELECT MAX(grade) FROM student2;\n+------------+\n| MAX(grade) |\n+------------+\n| c |\n+------------+\n\nSELECT grade FROM student2 ORDER BY grade DESC LIMIT 1;\n+-------+\n| grade |\n+-------+\n| a |\n+-------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, MAX(score) \n OVER (PARTITION BY name) AS highest_score FROM student_test;\n+---------+--------+-------+---------------+\n| name | test | score | highest_score |\n+---------+--------+-------+---------------+\n| Chun | SQL | 75 | 75 |\n| Chun | Tuning | 73 | 75 |\n| Esben | SQL | 43 | 43 |\n| Esben | Tuning | 31 | 43 |\n| Kaolin | SQL | 56 | 88 |\n| Kaolin | Tuning | 88 | 88 |\n| Tatiana | SQL | 87 | 87 |\n+---------+--------+-------+---------------+\n\n\n\nURL: mariadb.com/kb/en/max/','','https://mariadb.com/kb/en/max/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (191,16,'MIN','Syntax\n------\n\nMIN([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the minimum value of expr. MIN() may take a string argument, in which\ncase it returns the minimum string value. The DISTINCT keyword can be used to\nfind the minimum of the distinct values of expr, however, this produces the\nsame result as omitting DISTINCT.\n\nNote that SET and ENUM fields are currently compared by their string value\nrather than their relative position in the set, so MIN() may produce a\ndifferent lowest result than ORDER BY ASC.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nFrom MariaDB 10.2.2, MIN() can be used as a window function.\n\nMIN() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE TABLE student (name CHAR(10), test CHAR(10), score TINYINT);\n\nINSERT INTO student VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87), (\'Tatiana\', \'Tuning\', 83);\n\nSELECT name, MIN(score) FROM student GROUP BY name;\n+---------+------------+\n| name | MIN(score) |\n+---------+------------+\n| Chun | 73 |\n| Esben | 31 |\n| Kaolin | 56 |\n| Tatiana | 83 |\n+---------+------------+\n\nMIN() with a string:\n\nSELECT MIN(name) FROM student;\n+-----------+\n| MIN(name) |\n+-----------+\n| Chun |\n+-----------+\n\nBe careful to avoid this common mistake, not grouping correctly and returning\nmismatched data:\n\nSELECT name,test,MIN(score) FROM student;\n+------+------+------------+\n| name | test | MIN(score) |\n+------+------+------------+\n| Chun | SQL | 31 |\n+------+------+------------+\n\nDifference between ORDER BY ASC and MIN():\n\nCREATE TABLE student2(name CHAR(10),grade ENUM(\'b\',\'c\',\'a\'));\n\nINSERT INTO student2 VALUES(\'Chun\',\'b\'),(\'Esben\',\'c\'),(\'Kaolin\',\'a\');\n\nSELECT MIN(grade) FROM student2;\n+------------+\n| MIN(grade) |\n+------------+\n| a |\n+------------+\n\nSELECT grade FROM student2 ORDER BY grade ASC LIMIT 1;\n+-------+\n| grade |\n+-------+\n| b |\n+-------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, MIN(score) \n OVER (PARTITION BY name) AS lowest_score FROM student_test;\n+---------+--------+-------+--------------+\n| name | test | score | lowest_score |\n+---------+--------+-------+--------------+\n| Chun | SQL | 75 | 73 |\n| Chun | Tuning | 73 | 73 |\n| Esben | SQL | 43 | 31 |\n| Esben | Tuning | 31 | 31 |\n| Kaolin | SQL | 56 | 56 |\n| Kaolin | Tuning | 88 | 56 |\n| Tatiana | SQL | 87 | 87 |\n+---------+--------+-------+--------------+\n\n\n\nURL: mariadb.com/kb/en/min/','','https://mariadb.com/kb/en/min/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (192,16,'STD','Syntax\n------\n\nSTD(expr)\n\nDescription\n-----------\n\nReturns the population standard deviation of expr. This is an extension to\nstandard SQL. The standard SQL function STDDEV_POP() can be used instead.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nFrom MariaDB 10.2.2, STD() can be used as a window function.\n\nThis function returns NULL if there were no matching rows.\n\nExamples\n--------\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a | 0.8165 | 1.0000 | 0.6667 |\n| b | 18.0400 | 20.1693 | 325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, STDDEV_POP(score) \n OVER (PARTITION BY test) AS stddev_results FROM student_test;\n+---------+--------+-------+----------------+\n| name | test | score | stddev_results |\n+---------+--------+-------+----------------+\n| Chun | SQL | 75 | 16.9466 |\n| Chun | Tuning | 73 | 24.1247 |\n| Esben | SQL | 43 | 16.9466 |\n| Esben | Tuning | 31 | 24.1247 |\n| Kaolin | SQL | 56 | 16.9466 |\n| Kaolin | Tuning | 88 | 24.1247 |\n| Tatiana | SQL | 87 | 16.9466 |\n+---------+--------+-------+----------------+\n\n\n\nURL: mariadb.com/kb/en/std/','','https://mariadb.com/kb/en/std/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (193,16,'STDDEV','Syntax\n------\n\nSTDDEV(expr)\n\nDescription\n-----------\n\nReturns the population standard deviation of expr. This function is provided\nfor compatibility with Oracle. The standard SQL function STDDEV_POP() can be\nused instead.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nFrom MariaDB 10.2.2, STDDEV() can be used as a window function.\n\nThis function returns NULL if there were no matching rows.\n\nExamples\n--------\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a | 0.8165 | 1.0000 | 0.6667 |\n| b | 18.0400 | 20.1693 | 325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, STDDEV_POP(score) \n OVER (PARTITION BY test) AS stddev_results FROM student_test;\n+---------+--------+-------+----------------+\n| name | test | score | stddev_results |\n+---------+--------+-------+----------------+\n| Chun | SQL | 75 | 16.9466 |\n| Chun | Tuning | 73 | 24.1247 |\n| Esben | SQL | 43 | 16.9466 |\n| Esben | Tuning | 31 | 24.1247 |\n| Kaolin | SQL | 56 | 16.9466 |\n| Kaolin | Tuning | 88 | 24.1247 |\n| Tatiana | SQL | 87 | 16.9466 |\n+---------+--------+-------+----------------+\n\n\n\nURL: mariadb.com/kb/en/stddev/','','https://mariadb.com/kb/en/stddev/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (194,16,'STDDEV_POP','Syntax\n------\n\nSTDDEV_POP(expr)\n\nDescription\n-----------\n\nReturns the population standard deviation of expr (the square root of\nVAR_POP()). You can also use STD() or STDDEV(), which are equivalent but not\nstandard SQL.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nFrom MariaDB 10.2.2, STDDEV_POP() can be used as a window function.\n\nSTDDEV_POP() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a | 0.8165 | 1.0000 | 0.6667 |\n| b | 18.0400 | 20.1693 | 325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, STDDEV_POP(score) \n OVER (PARTITION BY test) AS stddev_results FROM student_test;\n+---------+--------+-------+----------------+\n| name | test | score | stddev_results |\n+---------+--------+-------+----------------+\n| Chun | SQL | 75 | 16.9466 |\n| Chun | Tuning | 73 | 24.1247 |\n| Esben | SQL | 43 | 16.9466 |\n| Esben | Tuning | 31 | 24.1247 |\n| Kaolin | SQL | 56 | 16.9466 |\n| Kaolin | Tuning | 88 | 24.1247 |\n| Tatiana | SQL | 87 | 16.9466 |\n+---------+--------+-------+----------------+\n\n\n\nURL: mariadb.com/kb/en/stddev_pop/','','https://mariadb.com/kb/en/stddev_pop/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (195,16,'STDDEV_SAMP','Syntax\n------\n\nSTDDEV_SAMP(expr)\n\nDescription\n-----------\n\nReturns the sample standard deviation of expr (the square root of VAR_SAMP()).\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nFrom MariaDB 10.2.2, STDDEV_SAMP() can be used as a window function.\n\nSTDDEV_SAMP() returns NULL if there were no matching rows.\n\n\n\nURL: mariadb.com/kb/en/stddev_samp/','','https://mariadb.com/kb/en/stddev_samp/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (196,16,'SUM','Syntax\n------\n\nSUM([DISTINCT] expr)\n\nDescription\n-----------\n\nReturns the sum of expr. If the return set has no rows, SUM() returns NULL.\nThe DISTINCT keyword can be used to sum only the distinct values of expr.\n\nFrom MariaDB 10.2.0, SUM() can be used as a window function, although not with\nthe DISTINCT specifier.\n\nExamples\n--------\n\nCREATE TABLE sales (sales_value INT);\nINSERT INTO sales VALUES(10),(20),(20),(40);\n\nSELECT SUM(sales_value) FROM sales;\n+------------------+\n| SUM(sales_value) |\n+------------------+\n| 90 |\n+------------------+\n\nSELECT SUM(DISTINCT(sales_value)) FROM sales;\n+----------------------------+\n| SUM(DISTINCT(sales_value)) |\n+----------------------------+\n| 70 |\n+----------------------------+\n\nCommonly, SUM is used with a GROUP BY clause:\n\nCREATE TABLE sales (name CHAR(10), month CHAR(10), units INT);\n\nINSERT INTO sales VALUES \n (\'Chun\', \'Jan\', 75), (\'Chun\', \'Feb\', 73),\n (\'Esben\', \'Jan\', 43), (\'Esben\', \'Feb\', 31),\n (\'Kaolin\', \'Jan\', 56), (\'Kaolin\', \'Feb\', 88),\n (\'Tatiana\', \'Jan\', 87), (\'Tatiana\', \'Feb\', 83);\n\nSELECT name, SUM(units) FROM sales GROUP BY name;\n+---------+------------+\n| name | SUM(units) |\n+---------+------------+\n| Chun | 148 |\n| Esben | 74 |\n| Kaolin | 144 |\n| Tatiana | 170 |\n+---------+------------+\n\nThe GROUP BY clause is required when using an aggregate function along with\nregular column data, otherwise the result will be a mismatch, as in the\nfollowing common type of mistake:\n\nSELECT name,SUM(units) FROM sales\n;+------+------------+\n| name | SUM(units) |\n+------+------------+\n| Chun | 536 |\n+------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, SUM(score) OVER (PARTITION BY name) AS total_score\nFROM student_test;\n+---------+--------+-------+-------------+\n| name | test | score | total_score |\n+---------+--------+-------+-------------+\n| Chun | SQL | 75 | 148 |\n| Chun | Tuning | 73 | 148 |\n| Esben | SQL | 43 | 74 |\n| Esben | Tuning | 31 | 74 |\n| Kaolin | SQL | 56 | 144 |\n| Kaolin | Tuning | 88 | 144 |\n| Tatiana | SQL | 87 | 87 |\n+---------+--------+-------+-------------+\n\n\n\nURL: mariadb.com/kb/en/sum/','','https://mariadb.com/kb/en/sum/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (197,16,'VARIANCE','Syntax\n------\n\nVARIANCE(expr)\n\nDescription\n-----------\n\nReturns the population standard variance of expr. This is an extension to\nstandard SQL. The standard SQL function VAR_POP() can be used instead.\n\nVariance is calculated by\n\n* working out the mean for the set\n* for each number, subtracting the mean and squaring the result\n* calculate the average of the resulting differences\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nFrom MariaDB 10.2.2, VARIANCE() can be used as a window function.\n\nVARIANCE() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE TABLE v(i tinyint);\n\nINSERT INTO v VALUES(101),(99);\n\nSELECT VARIANCE(i) FROM v;\n+-------------+\n| VARIANCE(i) |\n+-------------+\n| 1.0000 |\n+-------------+\n\nINSERT INTO v VALUES(120),(80);\n\nSELECT VARIANCE(i) FROM v;\n+-------------+\n| VARIANCE(i) |\n+-------------+\n| 200.5000 |\n+-------------+\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a | 0.8165 | 1.0000 | 0.6667 |\n| b | 18.0400 | 20.1693 | 325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, VAR_POP(score) \n OVER (PARTITION BY test) AS variance_results FROM student_test;\n+---------+--------+-------+------------------+\n| name | test | score | variance_results |\n+---------+--------+-------+------------------+\n| Chun | SQL | 75 | 287.1875 |\n| Chun | Tuning | 73 | 582.0000 |\n| Esben | SQL | 43 | 287.1875 |\n| Esben | Tuning | 31 | 582.0000 |\n| Kaolin | SQL | 56 | 287.1875 |\n| Kaolin | Tuning | 88 | 582.0000 |\n| Tatiana | SQL | 87 | 287.1875 |\n+---------+--------+-------+------------------+\n\n\n\nURL: mariadb.com/kb/en/variance/','','https://mariadb.com/kb/en/variance/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (198,16,'VAR_POP','Syntax\n------\n\nVAR_POP(expr)\n\nDescription\n-----------\n\nReturns the population standard variance of expr. It considers rows as the\nwhole population, not as a sample, so it has the number of rows as the\ndenominator. You can also use VARIANCE(), which is equivalent but is not\nstandard SQL.\n\nVariance is calculated by\n\n* working out the mean for the set\n* for each number, subtracting the mean and squaring the result\n* calculate the average of the resulting differences\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nFrom MariaDB 10.2.2, VAR_POP() can be used as a window function.\n\nVAR_POP() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nCREATE TABLE v(i tinyint);\n\nINSERT INTO v VALUES(101),(99);\n\nSELECT VAR_POP(i) FROM v;\n+------------+\n| VAR_POP(i) |\n+------------+\n| 1.0000 |\n+------------+\n\nINSERT INTO v VALUES(120),(80);\n\nSELECT VAR_POP(i) FROM v;\n+------------+\n| VAR_POP(i) |\n+------------+\n| 200.5000 |\n+------------+\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a | 0.8165 | 1.0000 | 0.6667 |\n| b | 18.0400 | 20.1693 | 325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, VAR_POP(score) \n OVER (PARTITION BY test) AS variance_results FROM student_test;\n+---------+--------+-------+------------------+\n| name | test | score | variance_results |\n+---------+--------+-------+------------------+\n| Chun | SQL | 75 | 287.1875 |\n| Esben | SQL | 43 | 287.1875 |\n| Kaolin | SQL | 56 | 287.1875 |\n| Tatiana | SQL | 87 | 287.1875 |\n| Chun | Tuning | 73 | 582.0000 |\n| Esben | Tuning | 31 | 582.0000 |\n| Kaolin | Tuning | 88 | 582.0000 |\n+---------+--------+-------+------------------+\n\n\n\nURL: mariadb.com/kb/en/var_pop/','','https://mariadb.com/kb/en/var_pop/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (199,16,'VAR_SAMP','Syntax\n------\n\nVAR_SAMP(expr)\n\nDescription\n-----------\n\nReturns the sample variance of expr. That is, the denominator is the number of\nrows minus one.\n\nIt is an aggregate function, and so can be used with the GROUP BY clause.\n\nFrom MariaDB 10.2.2, VAR_SAMP() can be used as a window function.\n\nVAR_SAMP() returns NULL if there were no matching rows.\n\nExamples\n--------\n\nAs an aggregate function:\n\nCREATE OR REPLACE TABLE stats (category VARCHAR(2), x INT);\n\nINSERT INTO stats VALUES \n (\'a\',1),(\'a\',2),(\'a\',3),\n (\'b\',11),(\'b\',12),(\'b\',20),(\'b\',30),(\'b\',60);\n\nSELECT category, STDDEV_POP(x), STDDEV_SAMP(x), VAR_POP(x) \n FROM stats GROUP BY category;\n+----------+---------------+----------------+------------+\n| category | STDDEV_POP(x) | STDDEV_SAMP(x) | VAR_POP(x) |\n+----------+---------------+----------------+------------+\n| a | 0.8165 | 1.0000 | 0.6667 |\n| b | 18.0400 | 20.1693 | 325.4400 |\n+----------+---------------+----------------+------------+\n\nAs a window function:\n\nCREATE OR REPLACE TABLE student_test (name CHAR(10), test CHAR(10), score\nTINYINT);\n\nINSERT INTO student_test VALUES \n (\'Chun\', \'SQL\', 75), (\'Chun\', \'Tuning\', 73),\n (\'Esben\', \'SQL\', 43), (\'Esben\', \'Tuning\', 31),\n (\'Kaolin\', \'SQL\', 56), (\'Kaolin\', \'Tuning\', 88),\n (\'Tatiana\', \'SQL\', 87);\n\nSELECT name, test, score, VAR_SAMP(score) \n OVER (PARTITION BY test) AS variance_results FROM student_test;\n+---------+--------+-------+------------------+\n| name | test | score | variance_results |\n+---------+--------+-------+------------------+\n| Chun | SQL | 75 | 382.9167 |\n| Chun | Tuning | 73 | 873.0000 |\n| Esben | SQL | 43 | 382.9167 |\n| Esben | Tuning | 31 | 873.0000 |\n| Kaolin | SQL | 56 | 382.9167 |\n| Kaolin | Tuning | 88 | 873.0000 |\n| Tatiana | SQL | 87 | 382.9167 |\n+---------+--------+-------+------------------+\n\n\n\nURL: mariadb.com/kb/en/var_samp/','','https://mariadb.com/kb/en/var_samp/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (200,17,'BENCHMARK','Syntax\n------\n\nBENCHMARK(count,expr)\n\nDescription\n-----------\n\nThe BENCHMARK() function executes the expression expr repeatedly count times.\nIt may be used to time how quickly MariaDB processes the expression. The\nresult value is always 0. The intended use is from within the mysql client,\nwhich reports query execution times.\n\nExamples\n--------\n\nSELECT BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\'));\n+----------------------------------------------+\n| BENCHMARK(1000000,ENCODE(\'hello\',\'goodbye\')) |\n+----------------------------------------------+\n| 0 |\n+----------------------------------------------+\n1 row in set (0.21 sec)\n\n\n\nURL: mariadb.com/kb/en/benchmark/','','https://mariadb.com/kb/en/benchmark/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (201,17,'BINLOG_GTID_POS','Syntax\n------\n\nBINLOG_GTID_POS(binlog_filename,binlog_offset)\n\nDescription\n-----------\n\nThe BINLOG_GTID_POS() function takes as input an old-style binary log position\nin the form of a file name and a file offset. It looks up the position in the\ncurrent binlog, and returns a string representation of the corresponding GTID\nposition. If the position is not found in the current binlog, NULL is returned.\n\nExamples\n--------\n\nSELECT BINLOG_GTID_POS("master-bin.000001", 600);\n\n\n\nURL: mariadb.com/kb/en/binlog_gtid_pos/','','https://mariadb.com/kb/en/binlog_gtid_pos/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (202,17,'CHARSET','Syntax\n------\n\nCHARSET(str)\n\nDescription\n-----------\n\nReturns the character set of the string argument. If str is not a string, it\nis considered as a binary string (so the function returns \'binary\'). This\napplies to NULL, too. The return value is a string in the utf8 character set.\n\nExamples\n--------\n\nSELECT CHARSET(\'abc\');\n+----------------+\n| CHARSET(\'abc\') |\n+----------------+\n| latin1 |\n+----------------+\n\nSELECT CHARSET(CONVERT(\'abc\' USING utf8));\n+------------------------------------+\n| CHARSET(CONVERT(\'abc\' USING utf8)) |\n+------------------------------------+\n| utf8 |\n+------------------------------------+\n\nSELECT CHARSET(USER());\n+-----------------+\n| CHARSET(USER()) |\n+-----------------+\n| utf8 |\n+-----------------+\n\n\n\nURL: mariadb.com/kb/en/charset/','','https://mariadb.com/kb/en/charset/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (203,17,'COERCIBILITY','Syntax\n------\n\nCOERCIBILITY(str)\n\nDescription\n-----------\n\nReturns the collation coercibility value of the string argument. Coercibility\ndefines what will be converted to what in case of collation conflict, with an\nexpression with higher coercibility being converted to the collation of an\nexpression with lower coercibility.\n\n+------------------------------+---------------------------+------------------+\n| Coercibility | Description | Example |\n+------------------------------+---------------------------+------------------+\n| 0 | Explicit | Value using a |\n| | | COLLATE clause |\n+------------------------------+---------------------------+------------------+\n| 1 | No collation | Concatenated |\n| | | strings using |\n| | | different |\n| | | collations |\n+------------------------------+---------------------------+------------------+\n| 2 | Implicit | Column value |\n+------------------------------+---------------------------+------------------+\n| 3 | Constant | USER() return |\n| | | value |\n+------------------------------+---------------------------+------------------+\n| 4 | Coercible | Literal string |\n+------------------------------+---------------------------+------------------+\n| 5 | Ignorable | NULL or derived |\n| | | from NULL |\n+------------------------------+---------------------------+------------------+\n\nExamples\n--------\n\nSELECT COERCIBILITY(\'abc\' COLLATE latin1_swedish_ci);\n+-----------------------------------------------+\n| COERCIBILITY(\'abc\' COLLATE latin1_swedish_ci) |\n+-----------------------------------------------+\n| 0 |\n+-----------------------------------------------+\n\nSELECT COERCIBILITY(USER());\n+----------------------+\n| COERCIBILITY(USER()) |\n+----------------------+\n| 3 |\n+----------------------+\n\nSELECT COERCIBILITY(\'abc\');\n+---------------------+\n| COERCIBILITY(\'abc\') |\n+---------------------+\n| 4 |\n+---------------------+\n\n\n\nURL: mariadb.com/kb/en/coercibility/','','https://mariadb.com/kb/en/coercibility/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (204,17,'COLLATION','Syntax\n------\n\nCOLLATION(str)\n\nDescription\n-----------\n\nReturns the collation of the string argument. If str is not a string, it is\nconsidered as a binary string (so the function returns \'binary\'). This applies\nto NULL, too. The return value is a string in the utf8 character set.\n\nSee Character Sets and Collations.\n\nExamples\n--------\n\nSELECT COLLATION(\'abc\');\n+-------------------+\n| COLLATION(\'abc\') |\n+-------------------+\n| latin1_swedish_ci |\n+-------------------+\n\nSELECT COLLATION(_utf8\'abc\');\n+-----------------------+\n| COLLATION(_utf8\'abc\') |\n+-----------------------+\n| utf8_general_ci |\n+-----------------------+\n\n\n\nURL: mariadb.com/kb/en/collation/','','https://mariadb.com/kb/en/collation/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (205,17,'CONNECTION_ID','Syntax\n------\n\nCONNECTION_ID()\n\nDescription\n-----------\n\nReturns the connection ID (thread ID) for the connection. Every thread\n(including events) has an ID that is unique among the set of currently\nconnected clients.\n\nUntil MariaDB 10.3.1, returns MYSQL_TYPE_LONGLONG, or bigint(10), in all\ncases. From MariaDB 10.3.1, returns MYSQL_TYPE_LONG, or int(10), when the\nresult would fit within 32-bits.\n\nExamples\n--------\n\nSELECT CONNECTION_ID();\n+-----------------+\n| CONNECTION_ID() |\n+-----------------+\n| 3 |\n+-----------------+\n\n\n\nURL: mariadb.com/kb/en/connection_id/','','https://mariadb.com/kb/en/connection_id/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (206,17,'CURRENT_ROLE','Syntax\n------\n\nCURRENT_ROLE, CURRENT_ROLE()\n\nDescription\n-----------\n\nReturns the current role name. This determines your access privileges. The\nreturn value is a string in the utf8 character set.\n\nIf there is no current role, NULL is returned.\n\nThe output of SELECT CURRENT_ROLE is equivalent to the contents of the\nENABLED_ROLES Information Schema table.\n\nUSER() returns the combination of user and host used to login. CURRENT_USER()\nreturns the account used to determine current connection\'s privileges.\n\nExamples\n--------\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| NULL |\n+--------------+\n\nSET ROLE staff;\n\nSELECT CURRENT_ROLE;\n+--------------+\n| CURRENT_ROLE |\n+--------------+\n| staff |\n+--------------+\n\n\n\nURL: mariadb.com/kb/en/current_role/','','https://mariadb.com/kb/en/current_role/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (207,17,'CURRENT_USER','Syntax\n------\n\nCURRENT_USER, CURRENT_USER()\n\nDescription\n-----------\n\nReturns the user name and host name combination for the MariaDB account that\nthe server used to authenticate the current client. This account determines\nyour access privileges. The return value is a string in the utf8 character set.\n\nThe value of CURRENT_USER() can differ from the value of USER().\nCURRENT_ROLE() returns the current active role.\n\nExamples\n--------\n\nshell> mysql --user="anonymous"\n\nselect user(),current_user();\n+---------------------+----------------+\n| user() | current_user() |\n+---------------------+----------------+\n| anonymous@localhost | @localhost |\n+---------------------+----------------+\n\nWhen calling CURRENT_USER() in a stored procedure, it returns the owner of the\nstored procedure, as defined with DEFINER.\n\n\n\nURL: mariadb.com/kb/en/current_user/','','https://mariadb.com/kb/en/current_user/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (208,17,'DATABASE','Syntax\n------\n\nDATABASE()\n\nDescription\n-----------\n\nReturns the default (current) database name as a string in the utf8 character\nset. If there is no default database, DATABASE() returns NULL. Within a stored\nroutine, the default database is the database that the routine is associated\nwith, which is not necessarily the same as the database that is the default in\nthe calling context.\n\nSCHEMA() is a synonym for DATABASE().\n\nTo select a default database, the USE statement can be run. Another way to set\nthe default database is specifying its name at mysql command line client\nstartup.\n\nExamples\n--------\n\nSELECT DATABASE();\n+------------+\n| DATABASE() |\n+------------+\n| NULL |\n+------------+\n\nUSE test;\nDatabase changed\n\nSELECT DATABASE();\n+------------+\n| DATABASE() |\n+------------+\n| test |\n+------------+\n\n\n\nURL: mariadb.com/kb/en/database/','','https://mariadb.com/kb/en/database/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (209,17,'DECODE_HISTOGRAM','Syntax\n------\n\nDECODE_HISTOGRAM(hist_type,histogram)\n\nDescription\n-----------\n\nReturns a string of comma separated numeric values corresponding to a\nprobability distribution represented by the histogram of type hist_type\n(SINGLE_PREC_HB or DOUBLE_PREC_HB). The hist_type and histogram would be\ncommonly used from the mysql.column_stats table.\n\nSee Histogram Based Statistics for details.\n\nExamples\n--------\n\nCREATE TABLE origin (\n i INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,\n v INT UNSIGNED NOT NULL\n);\n\nINSERT INTO origin(v) VALUES \n (1),(2),(3),(4),(5),(10),(20),\n (30),(40),(50),(60),(70),(80),\n (90),(100),(200),(400),(800);\n\nSET histogram_size=10,histogram_type=SINGLE_PREC_HB;\n\nANALYZE TABLE origin PERSISTENT FOR ALL;\n+-------------+---------+----------+-----------------------------------------+\n| Table | Op | Msg_type | Msg_text |\n+-------------+---------+----------+-----------------------------------------+\n| test.origin | analyze | status | Engine-independent statistics collected |\n| test.origin | analyze | status | OK |\n+-------------+---------+----------+-----------------------------------------+\n\nSELECT db_name,table_name,column_name,hist_type,\n hex(histogram),decode_histogram(hist_type,histogram)\n FROM mysql.column_stats WHERE db_name=\'test\' and table_name=\'origin\';\n+---------+------------+-------------+----------------+----------------------+-\n-----------------------------------------------------------------+\n| db_name | table_name | column_name | hist_type | hex(histogram) |\ndecode_histogram(hist_type,histogram) |\n+---------+------------+-------------+----------------+----------------------+-\n-----------------------------------------------------------------+\n| test | origin | i | SINGLE_PREC_HB | 0F2D3C5A7887A5C3D2F0 |\n0.059,0.118,0.059,0.118,0.118,0.059,0.118,0.118,0.059,0.118,0.059 |\n| test | origin | v | SINGLE_PREC_HB | 000001060C0F161C1F7F |\n0.000,0.000,0.004,0.020,0.024,0.012,0.027,0.024,0.012,0.376,0.502 |\n+---------+------------+-------------+----------------+----------------------+-\n-----------------------------------------------------------------+\n\nSET histogram_size=20,histogram_type=DOUBLE_PREC_HB;\n\nANALYZE TABLE origin PERSISTENT FOR ALL;\n+-------------+---------+----------+-----------------------------------------+\n| Table | Op | Msg_type | Msg_text |\n+-------------+---------+----------+-----------------------------------------+\n| test.origin | analyze | status | Engine-independent statistics collected |\n| test.origin | analyze | status | OK |\n+-------------+---------+----------+-----------------------------------------+\n\nSELECT db_name,table_name,column_name,\n hist_type,hex(histogram),decode_histogram(hist_type,histogram)\n FROM mysql.column_stats WHERE db_name=\'test\' and table_name=\'origin\';\n+---------+------------+-------------+----------------+------------------------\n-----------------+-------------------------------------------------------------\n---------------------------+\n| db_name | table_name | column_name | hist_type | hex(histogram) \n | decode_histogram(hist_type,histogram)\n |\n+---------+------------+-------------+----------------+------------------------\n-----------------+-------------------------------------------------------------\n---------------------------+\n| test | origin | i | DOUBLE_PREC_HB |\n0F0F2D2D3C3C5A5A78788787A5A5C3C3D2D2F0F0 |\n0.05882,0.11765,0.05882,0.11765,0.11765,0.05882,0.11765,0.11765,0.05882,0.11765\n0.05882 |\n| test | origin | v | DOUBLE_PREC_HB |\n5200F600480116067E0CB30F1B16831CB81FD67F |\n0.00125,0.00250,0.00125,0.01877,0.02502,0.01253,0.02502,0.02502,0.01253,0.37546\n0.50063 |\n\n\n\nURL: mariadb.com/kb/en/decode_histogram/','','https://mariadb.com/kb/en/decode_histogram/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (210,17,'DEFAULT','Syntax\n------\n\nDEFAULT(col_name)\n\nDescription\n-----------\n\nReturns the default value for a table column. If the column has no default\nvalue (and is not NULLABLE - NULLABLE fields have a NULL default), an error is\nreturned.\n\nFor integer columns using AUTO_INCREMENT, 0 is returned.\n\nWhen using DEFAULT as a value to set in an INSERT or UPDATE statement, you can\nuse the bare keyword DEFAULT without the parentheses and argument to refer to\nthe column in context. You can only use DEFAULT as a bare keyword if you are\nusing it alone without a surrounding expression or function.\n\nExamples\n--------\n\nSelect only non-default values for a column:\n\nSELECT i FROM t WHERE i != DEFAULT(i);\n\nUpdate values to be one greater than the default value:\n\nUPDATE t SET i = DEFAULT(i)+1 WHERE i < 100;\n\nWhen referring to the default value exactly in UPDATE or INSERT, you can omit\nthe argument:\n\nINSERT INTO t (i) VALUES (DEFAULT);\nUPDATE t SET i = DEFAULT WHERE i < 100;\n\nCREATE OR REPLACE TABLE t (\n i INT NOT NULL AUTO_INCREMENT,\n j INT NOT NULL,\n k INT DEFAULT 3,\n l INT NOT NULL DEFAULT 4,\n m INT,\n PRIMARY KEY (i)\n);\n\nDESC t;\n+-------+---------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+-------+---------+------+-----+---------+----------------+\n| i | int(11) | NO | PRI | NULL | auto_increment |\n| j | int(11) | NO | | NULL | |\n| k | int(11) | YES | | 3 | |\n| l | int(11) | NO | | 4 | |\n| m | int(11) | YES | | NULL | |\n+-------+---------+------+-----+---------+----------------+\n\nINSERT INTO t (j) VALUES (1);\nINSERT INTO t (j,m) VALUES (2,2);\nINSERT INTO t (j,l,m) VALUES (3,3,3);\n\nSELECT * FROM t;\n+---+---+------+---+------+\n| i | j | k | l | m |\n+---+---+------+---+------+\n| 1 | 1 | 3 | 4 | NULL |\n| 2 | 2 | 3 | 4 | 2 |\n| 3 | 3 | 3 | 3 | 3 |\n+---+---+------+---+------+\n\nSELECT DEFAULT(i), DEFAULT(k), DEFAULT (l), DEFAULT(m) FROM t;\n+------------+------------+-------------+------------+\n| DEFAULT(i) | DEFAULT(k) | DEFAULT (l) | DEFAULT(m) |\n+------------+------------+-------------+------------+\n| 0 | 3 | 4 | NULL |\n| 0 | 3 | 4 | NULL |\n| 0 | 3 | 4 | NULL |\n+------------+------------+-------------+------------+\n\nSELECT DEFAULT(i), DEFAULT(k), DEFAULT (l), DEFAULT(m), DEFAULT(j) FROM t;\nERROR 1364 (HY000): Field \'j\' doesn\'t have a default value\n\nSELECT * FROM t WHERE i = DEFAULT(i);\nEmpty set (0.001 sec)\n\nSELECT * FROM t WHERE j = DEFAULT(j);\nERROR 1364 (HY000): Field \'j\' doesn\'t have a default value\n\nSELECT * FROM t WHERE k = DEFAULT(k);\n+---+---+------+---+------+\n| i | j | k | l | m |\n+---+---+------+---+------+\n| 1 | 1 | 3 | 4 | NULL |\n| 2 | 2 | 3 | 4 | 2 |\n| 3 | 3 | 3 | 3 | 3 |\n+---+---+------+---+------+\n\nSELECT * FROM t WHERE l = DEFAULT(l);\n+---+---+------+---+------+\n| i | j | k | l | m |\n+---+---+------+---+------+\n| 1 | 1 | 3 | 4 | NULL |\n| 2 | 2 | 3 | 4 | 2 |\n+---+---+------+---+------+\n\nSELECT * FROM t WHERE m = DEFAULT(m);\nEmpty set (0.001 sec)\n\nSELECT * FROM t WHERE m <=> DEFAULT(m);\n+---+---+------+---+------+\n| i | j | k | l | m |\n+---+---+------+---+------+\n| 1 | 1 | 3 | 4 | NULL |\n+---+---+------+---+------+\n\n\n\nURL: mariadb.com/kb/en/default/','','https://mariadb.com/kb/en/default/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (211,17,'FOUND_ROWS','Syntax\n------\n\nFOUND_ROWS()\n\nDescription\n-----------\n\nA SELECT statement may include a LIMIT clause to restrict the number of rows\nthe server returns to the client. In some cases, it is desirable to know how\nmany rows the statement would have returned without the LIMIT, but without\nrunning the statement again. To obtain this row count, include a\nSQL_CALC_FOUND_ROWS option in the SELECT statement, and then invoke\nFOUND_ROWS() afterwards.\n\nYou can also use FOUND_ROWS() to obtain the number of rows returned by a\nSELECT which does not contain a LIMIT clause. In this case you don\'t need to\nuse the SQL_CALC_FOUND_ROWS option. This can be useful for example in a stored\nprocedure.\n\nAlso, this function works with some other statements which return a resultset,\nincluding SHOW, DESC and HELP. For DELETE ... RETURNING you should use\nROW_COUNT(). It also works as a prepared statement, or after executing a\nprepared statement.\n\nStatements which don\'t return any results don\'t affect FOUND_ROWS() - the\nprevious value will still be returned.\n\nWarning: When used after a CALL statement, this function returns the number of\nrows selected by the last query in the procedure, not by the whole procedure.\n\nStatements using the FOUND_ROWS() function are not safe for replication.\n\nExamples\n--------\n\nSHOW ENGINES\G\n*************************** 1. row ***************************\n Engine: CSV\n Support: YES\n Comment: Stores tables as CSV files\nTransactions: NO\n XA: NO\n Savepoints: NO\n*************************** 2. row ***************************\n Engine: MRG_MyISAM\n Support: YES\n Comment: Collection of identical MyISAM tables\nTransactions: NO\n XA: NO\n Savepoints: NO\n\n...\n\n*************************** 8. row ***************************\n Engine: PERFORMANCE_SCHEMA\n Support: YES\n Comment: Performance Schema\nTransactions: NO\n XA: NO\n Savepoints: NO\n8 rows in set (0.000 sec)\n\nSELECT FOUND_ROWS();\n+--------------+\n| FOUND_ROWS() |\n+--------------+\n| 8 |\n+--------------+\n\nSELECT SQL_CALC_FOUND_ROWS * FROM tbl_name WHERE id > 100 LIMIT 10;\n\nSELECT FOUND_ROWS();\n+--------------+\n| FOUND_ROWS() |\n+--------------+\n| 23 |\n+--------------+\n\n\n\nURL: mariadb.com/kb/en/found_rows/','','https://mariadb.com/kb/en/found_rows/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (212,17,'LAST_INSERT_ID','Syntax\n------\n\nLAST_INSERT_ID(), LAST_INSERT_ID(expr)\n\nDescription\n-----------\n\nLAST_INSERT_ID() (no arguments) returns the first automatically generated\nvalue successfully inserted for an AUTO_INCREMENT column as a result of the\nmost recently executed INSERT statement. The value of LAST_INSERT_ID() remains\nunchanged if no rows are successfully inserted.\n\nIf one gives an argument to LAST_INSERT_ID(), then it will return the value of\nthe expression and the next call to LAST_INSERT_ID() will return the same\nvalue. The value will also be sent to the client and can be accessed by the\nmysql_insert_id function.\n\nFor example, after inserting a row that generates an AUTO_INCREMENT value, you\ncan get the value like this:\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n| 9 |\n+------------------+\n\nYou can also use LAST_INSERT_ID() to delete the last inserted row:\n\nDELETE FROM product WHERE id = LAST_INSERT_ID();\n\nIf no rows were successfully inserted, LAST_INSERT_ID() returns 0.\n\nThe value of LAST_INSERT_ID() will be consistent across all versions if all\nrows in the INSERT or UPDATE statement were successful.\n\nThe currently executing statement does not affect the value of\nLAST_INSERT_ID(). Suppose that you generate an AUTO_INCREMENT value with one\nstatement, and then refer to LAST_INSERT_ID() in a multiple-row INSERT\nstatement that inserts rows into a table with its own AUTO_INCREMENT column.\nThe value of LAST_INSERT_ID() will remain stable in the second statement; its\nvalue for the second and later rows is not affected by the earlier row\ninsertions. (However, if you mix references to LAST_INSERT_ID() and\nLAST_INSERT_ID(expr), the effect is undefined.)\n\nIf the previous statement returned an error, the value of LAST_INSERT_ID() is\nundefined. For transactional tables, if the statement is rolled back due to an\nerror, the value of LAST_INSERT_ID() is left undefined. For manual ROLLBACK,\nthe value of LAST_INSERT_ID() is not restored to that before the transaction;\nit remains as it was at the point of the ROLLBACK.\n\nWithin the body of a stored routine (procedure or function) or a trigger, the\nvalue of LAST_INSERT_ID() changes the same way as for statements executed\noutside the body of these kinds of objects. The effect of a stored routine or\ntrigger upon the value of LAST_INSERT_ID() that is seen by following\nstatements depends on the kind of routine:\n\n* If a stored procedure executes statements that change the value of\nLAST_INSERT_ID(), the new value will be seen by statements that follow the\nprocedure call.\n\n* For stored functions and triggers that change the value, the value is\nrestored when the function or trigger ends, so following statements will not\nsee a changed value.\n\nExamples\n--------\n\nCREATE TABLE t (\n id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY,\n f VARCHAR(1))\nENGINE = InnoDB;\n\nINSERT INTO t(f) VALUES(\'a\');\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n| 1 |\n+------------------+\n\nINSERT INTO t(f) VALUES(\'b\');\n\nINSERT INTO t(f) VALUES(\'c\');\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n| 3 |\n+------------------+\n\nINSERT INTO t(f) VALUES(\'d\'),(\'e\');\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n| 4 |\n+------------------+\n\nSELECT * FROM t;\n+----+------+\n| id | f |\n+----+------+\n| 1 | a |\n| 2 | b |\n| 3 | c |\n| 4 | d |\n| 5 | e |\n+----+------+\n\nSELECT LAST_INSERT_ID(12);\n+--------------------+\n| LAST_INSERT_ID(12) |\n+--------------------+\n| 12 |\n+--------------------+\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n| 12 |\n+------------------+\n\nINSERT INTO t(f) VALUES(\'f\');\n\nSELECT LAST_INSERT_ID();\n+------------------+\n| LAST_INSERT_ID() |\n+------------------+\n| 6 |\n+------------------+\n\nSELECT * FROM t;\n+----+------+\n| id | f |\n+----+------+\n| 1 | a |\n| 2 | b |\n| 3 | c |\n| 4 | d |\n| 5 | e |\n| 6 | f |\n+----+------+\n\nSELECT LAST_INSERT_ID(12);\n+--------------------+\n| LAST_INSERT_ID(12) |\n+--------------------+\n| 12 |\n+--------------------+\n\nINSERT INTO t(f) VALUES(\'g\');\n\nSELECT * FROM t;\n+----+------+\n| id | f |\n+----+------+\n| 1 | a |\n| 2 | b |\n| 3 | c |\n| 4 | d |\n| 5 | e |\n| 6 | f |\n| 7 | g |\n+----+------+\n\n\n\nURL: mariadb.com/kb/en/last_insert_id/','','https://mariadb.com/kb/en/last_insert_id/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (213,17,'LAST_VALUE','Syntax\n------\n\nLAST_VALUE(expr,[expr,...])\n\nLAST_VALUE(expr) OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nLAST_VALUE() evaluates all expressions and returns the last.\n\nThis is useful together with setting user variables to a value with\n@var:=expr, for example when you want to get data of rows updated/deleted\nwithout having to do two queries against the table.\n\nSince MariaDB 10.2.2, LAST_VALUE can be used as a window function.\n\nReturns NULL if no last value exists.\n\nExamples\n--------\n\nCREATE TABLE t1 (a int, b int);\nINSERT INTO t1 VALUES(1,10),(2,20);\nDELETE FROM t1 WHERE a=1 AND last_value(@a:=a,@b:=b,1);\nSELECT @a,@b;\n+------+------+\n| @a | @b |\n+------+------+\n| 1 | 10 |\n+------+------+\n\nAs a window function:\n\nCREATE TABLE t1 (\n pk int primary key,\n a int,\n b int,\n c char(10),\n d decimal(10, 3),\n e real\n);\n\nINSERT INTO t1 VALUES\n( 1, 0, 1, \'one\', 0.1, 0.001),\n( 2, 0, 2, \'two\', 0.2, 0.002),\n( 3, 0, 3, \'three\', 0.3, 0.003),\n( 4, 1, 2, \'three\', 0.4, 0.004),\n( 5, 1, 1, \'two\', 0.5, 0.005),\n( 6, 1, 1, \'one\', 0.6, 0.006),\n( 7, 2, NULL, \'n_one\', 0.5, 0.007),\n( 8, 2, 1, \'n_two\', NULL, 0.008),\n( 9, 2, 2, NULL, 0.7, 0.009),\n(10, 2, 0, \'n_four\', 0.8, 0.010),\n(11, 2, 10, NULL, 0.9, NULL);\n\nSELECT pk, FIRST_VALUE(pk) OVER (ORDER BY pk) AS first_asc,\n LAST_VALUE(pk) OVER (ORDER BY pk) AS last_asc,\n FIRST_VALUE(pk) OVER (ORDER BY pk DESC) AS first_desc,\n LAST_VALUE(pk) OVER (ORDER BY pk DESC) AS last_desc\nFROM t1\nORDER BY pk DESC;\n\n+----+-----------+----------+------------+-----------+\n| pk | first_asc | last_asc | first_desc | last_desc |\n+----+-----------+----------+------------+-----------+\n| 11 | 1 | 11 | 11 | 11 |\n| 10 | 1 | 10 | 11 | 10 |\n| 9 | 1 | 9 | 11 | 9 |\n| 8 | 1 | 8 | 11 | 8 |\n| 7 | 1 | 7 | 11 | 7 |\n| 6 | 1 | 6 | 11 | 6 |\n| 5 | 1 | 5 | 11 | 5 |\n| 4 | 1 | 4 | 11 | 4 |\n| 3 | 1 | 3 | 11 | 3 |\n| 2 | 1 | 2 | 11 | 2 |\n| 1 | 1 | 1 | 11 | 1 |\n+----+-----------+----------+------------+-----------+\n\nCREATE OR REPLACE TABLE t1 (i int);\nINSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);\n\nSELECT i,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and 1 FOLLOWING) AS\nf_1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and 1 FOLLOWING) AS\nl_1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS\nf_1p1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS\nf_1p1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) AS\nf_2p1p,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) AS\nf_2p1p,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) AS\nf_1f2f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) AS\nf_1f2f\nFROM t1;\n\n+------+------+------+--------+--------+--------+--------+--------+--------+\n| i | f_1f | l_1f | f_1p1f | f_1p1f | f_2p1p | f_2p1p | f_1f2f | f_1f2f |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n| 1 | 1 | 2 | 1 | 2 | NULL | NULL | 2 | 3 |\n| 2 | 2 | 3 | 1 | 3 | 1 | 1 | 3 | 4 |\n| 3 | 3 | 4 | 2 | 4 | 1 | 2 | 4 | 5 |\n| 4 | 4 | 5 | 3 | 5 | 2 | 3 | 5 | 6 |\n| 5 | 5 | 6 | 4 | 6 | 3 | 4 | 6 | 7 |\n| 6 | 6 | 7 | 5 | 7 | 4 | 5 | 7 | 8 |\n| 7 | 7 | 8 | 6 | 8 | 5 | 6 | 8 | 9 |\n| 8 | 8 | 9 | 7 | 9 | 6 | 7 | 9 | 10 |\n| 9 | 9 | 10 | 8 | 10 | 7 | 8 | 10 | 10 |\n| 10 | 10 | 10 | 9 | 10 | 8 | 9 | NULL | NULL |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n\n\n\nURL: mariadb.com/kb/en/last_value/','','https://mariadb.com/kb/en/last_value/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (214,17,'PROCEDURE ANALYSE','Syntax\n------\n\nanalyse([max_elements[,max_memory]])\n\nDescription\n-----------\n\nThis procedure is defined in the sql/sql_analyse.cc file. It examines the\nresult from a query and returns an analysis of the results that suggests\noptimal data types for each column. To obtain this analysis, append PROCEDURE\nANALYSE to the end of a SELECT statement:\n\nSELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max_elements,[max_memory]])\n\nFor example:\n\nSELECT col1, col2 FROM table1 PROCEDURE ANALYSE(10, 2000);\n\nThe results show some statistics for the values returned by the query, and\npropose an optimal data type for the columns. This can be helpful for checking\nyour existing tables, or after importing new data. You may need to try\ndifferent settings for the arguments so that PROCEDURE ANALYSE() does not\nsuggest the ENUM data type when it is not appropriate.\n\nThe arguments are optional and are used as follows:\n\n* max_elements (default 256) is the maximum number of distinct values that\nanalyse notices per column. This is used by analyse to check whether the\noptimal data type should be of type ENUM; if there are more than max_elements\ndistinct values, then ENUM is not a suggested type.\n* max_memory (default 8192) is the maximum amount of memory that analyse\nshould allocate per column while trying to find all distinct values.\n\n\n\nURL: mariadb.com/kb/en/procedure-analyse/','','https://mariadb.com/kb/en/procedure-analyse/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (215,17,'ROW_COUNT','Syntax\n------\n\nROW_COUNT()\n\nDescription\n-----------\n\nROW_COUNT() returns the number of rows updated, inserted or deleted by the\npreceding statement. This is the same as the row count that the mysql client\ndisplays and the value from the mysql_affected_rows() C API function.\n\nGenerally:\n\n* For statements which return a result set (such as SELECT, SHOW, DESC or\nHELP), returns -1, even when the result set is empty. This is also true for\nadministrative statements, such as OPTIMIZE.\n* For DML statements other than SELECT and for ALTER TABLE, returns the number\nof affected rows.\n* For DDL statements (including TRUNCATE) and for other statements which don\'t\nreturn any result set (such as USE, DO, SIGNAL or DEALLOCATE PREPARE), returns\n0.\n\nFor UPDATE, affected rows is by default the number of rows that were actually\nchanged. If the CLIENT_FOUND_ROWS flag to mysql_real_connect() is specified\nwhen connecting to mysqld, affected rows is instead the number of rows matched\nby the WHERE clause.\n\nFor REPLACE, deleted rows are also counted. So, if REPLACE deletes a row and\nadds a new row, ROW_COUNT() returns 2.\n\nFor INSERT ... ON DUPLICATE KEY, updated rows are counted twice. So, if INSERT\nadds a new rows and modifies another row, ROW_COUNT() returns 3.\n\nROW_COUNT() does not take into account rows that are not directly\ndeleted/updated by the last statement. This means that rows deleted by foreign\nkeys or triggers are not counted.\n\nWarning: You can use ROW_COUNT() with prepared statements, but you need to\ncall it after EXECUTE, not after DEALLOCATE PREPARE, because the row count for\nallocate prepare is always 0.\n\nWarning: When used after a CALL statement, this function returns the number of\nrows affected by the last statement in the procedure, not by the whole\nprocedure.\n\nWarning: After INSERT DELAYED, ROW_COUNT() returns the number of the rows you\ntried to insert, not the number of the successful writes.\n\nThis information can also be found in the diagnostics area.\n\nStatements using the ROW_COUNT() function are not safe for replication.\n\nExamples\n--------\n\nCREATE TABLE t (A INT);\n\nINSERT INTO t VALUES(1),(2),(3);\n\nSELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 3 |\n+-------------+\n\nDELETE FROM t WHERE A IN(1,2);\n\nSELECT ROW_COUNT(); \n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 2 |\n+-------------+\n\nExample with prepared statements:\n\nSET @q = \'INSERT INTO t VALUES(1),(2),(3);\';\n\nPREPARE stmt FROM @q;\n\nEXECUTE stmt;\nQuery OK, 3 rows affected (0.39 sec)\nRecords: 3 Duplicates: 0 Warnings: 0\n\nSELECT ROW_COUNT();\n+-------------+\n| ROW_COUNT() |\n+-------------+\n| 3 |\n+-------------+\n\n\n\nURL: mariadb.com/kb/en/row_count/','','https://mariadb.com/kb/en/row_count/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (216,17,'SCHEMA','Syntax\n------\n\nSCHEMA()\n\nDescription\n-----------\n\nThis function is a synonym for DATABASE().\n\n\n\nURL: mariadb.com/kb/en/schema/','','https://mariadb.com/kb/en/schema/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (217,17,'SESSION_USER','Syntax\n------\n\nSESSION_USER()\n\nDescription\n-----------\n\nSESSION_USER() is a synonym for USER().\n\n\n\nURL: mariadb.com/kb/en/session_user/','','https://mariadb.com/kb/en/session_user/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (218,17,'SYSTEM_USER','Syntax\n------\n\nSYSTEM_USER()\n\nDescription\n-----------\n\nSYSTEM_USER() is a synonym for USER().\n\n\n\nURL: mariadb.com/kb/en/system_user/','','https://mariadb.com/kb/en/system_user/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (219,17,'USER','Syntax\n------\n\nUSER()\n\nDescription\n-----------\n\nReturns the current MariaDB user name and host name, given when authenticating\nto MariaDB, as a string in the utf8 character set.\n\nNote that the value of USER() may differ from the value of CURRENT_USER(),\nwhich is the user used to authenticate the current client. CURRENT_ROLE()\nreturns the current active role.\n\nSYSTEM_USER() and SESSION_USER are synonyms for USER().\n\nStatements using the USER() function or one of its synonyms are not safe for\nstatement level replication.\n\nExamples\n--------\n\nshell> mysql --user="anonymous"\n\nSELECT USER(),CURRENT_USER();\n+---------------------+----------------+\n| USER() | CURRENT_USER() |\n+---------------------+----------------+\n| anonymous@localhost | @localhost |\n+---------------------+----------------+\n\nTo select only the IP address, use SUBSTRING_INDEX(),\n\nSELECT SUBSTRING_INDEX(USER(), \'@\', -1);\n+----------------------------------+\n| SUBSTRING_INDEX(USER(), \'@\', -1) |\n+----------------------------------+\n| 192.168.0.101 |\n+----------------------------------+\n\n\n\nURL: mariadb.com/kb/en/user/','','https://mariadb.com/kb/en/user/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (220,17,'VERSION','Syntax\n------\n\nVERSION()\n\nDescription\n-----------\n\nReturns a string that indicates the MariaDB server version. The string uses\nthe utf8 character set.\n\nExamples\n--------\n\nSELECT VERSION();\n+----------------+\n| VERSION() |\n+----------------+\n| 10.4.7-MariaDB |\n+----------------+\n\nThe VERSION() string may have one or more of the following suffixes:\n\n+---------------------------+-------------------------------------------------+\n| Suffix | Description |\n+---------------------------+-------------------------------------------------+\n| -embedded | The server is an embedded server (libmysqld). |\n+---------------------------+-------------------------------------------------+\n| -log | General logging, slow logging or binary |\n| | (replication) logging is enabled. |\n+---------------------------+-------------------------------------------------+\n| -debug | The server is compiled for debugging. |\n+---------------------------+-------------------------------------------------+\n| -valgrind | The server is compiled to be instrumented with |\n| | valgrind. |\n+---------------------------+-------------------------------------------------+\n\nChanging the Version String\n---------------------------\n\nSome old legacy code may break because they are parsing the VERSION string and\nexpecting a MySQL string or a simple version string like Joomla til API17, see\nMDEV-7780.\n\nFrom MariaDB 10.2, one can fool these applications by setting the version\nstring from the command line or the my.cnf files with --version=....\n\n\n\nURL: mariadb.com/kb/en/version/','','https://mariadb.com/kb/en/version/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (221,18,'!=','Syntax\n------\n\n<>, !=\n\nDescription\n-----------\n\nNot equal operator. Evaluates both SQL expressions and returns 1 if they are\nnot equal and 0 if they are equal, or NULL if either expression is NULL. If\nthe expressions return different data types, (for instance, a number and a\nstring), performs type conversion.\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) != (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a != t2.x) OR (t1.b != t2.y)\nFROM t1 INNER JOIN t2;\n\nExamples\n--------\n\nSELECT \'.01\' <> \'0.01\';\n+-----------------+\n| \'.01\' <> \'0.01\' |\n+-----------------+\n| 1 |\n+-----------------+\n\nSELECT .01 <> \'0.01\';\n+---------------+\n| .01 <> \'0.01\' |\n+---------------+\n| 0 |\n+---------------+\n\nSELECT \'zapp\' <> \'zappp\';\n+-------------------+\n| \'zapp\' <> \'zappp\' |\n+-------------------+\n| 1 |\n+-------------------+\n\n\n\nURL: mariadb.com/kb/en/not-equal/','','https://mariadb.com/kb/en/not-equal/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (222,18,'&lt;','Syntax\n------\n\n<\n\nDescription\n-----------\n\nLess than operator. Evaluates both SQL expressions and returns 1 if the left\nvalue is less than the right value and 0 if it is not, or NULL if either\nexpression is NULL. If the expressions return different data types, (for\ninstance, a number and a string), performs type conversion.\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) < (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a < t2.x) OR ((t1.a = t2.x) AND (t1.b < t2.y))\nFROM t1 INNER JOIN t2;\n\nExamples\n--------\n\nSELECT 2 < 2;\n+-------+\n| 2 < 2 |\n+-------+\n| 0 |\n+-------+\n\nType conversion:\n\nSELECT 3<\'4\';\n+-------+\n| 3<\'4\' |\n+-------+\n| 1 |\n+-------+\n\nCase insensitivity - see Character Sets and Collations:\n\nSELECT \'a\'<\'A\';\n+---------+\n| \'a\'<\'A\' |\n+---------+\n| 0 |\n+---------+\n\n\n\nURL: mariadb.com/kb/en/less-than/','','https://mariadb.com/kb/en/less-than/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (223,18,'&lt;=','Syntax\n------\n\n<=\n\nDescription\n-----------\n\nLess than or equal operator. Evaluates both SQL expressions and returns 1 if\nthe left value is less than or equal to the right value and 0 if it is not, or\nNULL if either expression is NULL. If the expressions return different data\ntypes, (for instance, a number and a string), performs type conversion.\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) <= (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a < t2.x) OR ((t1.a = t2.x) AND (t1.b <= t2.y))\nFROM t1 INNER JOIN t2;\n\nExamples\n--------\n\nSELECT 0.1 <= 2;\n+----------+\n| 0.1 <= 2 |\n+----------+\n| 1 |\n+----------+\n\nSELECT \'a\'<=\'A\';\n+----------+\n| \'a\'<=\'A\' |\n+----------+\n| 1 |\n+----------+\n\n\n\nURL: mariadb.com/kb/en/less-than-or-equal/','','https://mariadb.com/kb/en/less-than-or-equal/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (224,18,'&lt;=&gt;','Syntax\n------\n\n<=>\n\nDescription\n-----------\n\nNULL-safe equal operator. It performs an equality comparison like the =\noperator, but returns 1 rather than NULL if both operands are NULL, and 0\nrather than NULL if one operand is NULL.\n\na <=> b is equivalent to a = b OR (a IS NULL AND b IS NULL).\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) <=> (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a <=> t2.x) AND (t1.b <=> t2.y)\nFROM t1 INNER JOIN t2;\n\nSee also NULL Values in MariaDB.\n\nExamples\n--------\n\nSELECT 1 <=> 1, NULL <=> NULL, 1 <=> NULL;\n+---------+---------------+------------+\n| 1 <=> 1 | NULL <=> NULL | 1 <=> NULL |\n+---------+---------------+------------+\n| 1 | 1 | 0 |\n+---------+---------------+------------+\n\nSELECT 1 = 1, NULL = NULL, 1 = NULL;\n+-------+-------------+----------+\n| 1 = 1 | NULL = NULL | 1 = NULL |\n+-------+-------------+----------+\n| 1 | NULL | NULL |\n+-------+-------------+----------+\n\n\n\nURL: mariadb.com/kb/en/null-safe-equal/','','https://mariadb.com/kb/en/null-safe-equal/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (225,18,'=','Syntax\n------\n\nleft_expr = right_expr\n\nDescription\n-----------\n\nEqual operator. Evaluates both SQL expressions and returns 1 if they are\nequal, 0 if they are not equal, or NULL if either expression is NULL. If the\nexpressions return different data types (for example, a number and a string),\na type conversion is performed.\n\nWhen used in row comparisons these two queries are synonymous and return the\nsame results:\n\nSELECT (t1.a, t1.b) = (t2.x, t2.y) FROM t1 INNER JOIN t2;\n\nSELECT (t1.a = t2.x) AND (t1.b = t2.y) FROM t1 INNER JOIN t2;\n\nTo perform a NULL-safe comparison, use the <=> operator.\n\n= can also be used as an assignment operator.\n\nExamples\n--------\n\nSELECT 1 = 0;\n+-------+\n| 1 = 0 |\n+-------+\n| 0 |\n+-------+\n\nSELECT \'0\' = 0;\n+---------+\n| \'0\' = 0 |\n+---------+\n| 1 |\n+---------+\n\nSELECT \'0.0\' = 0;\n+-----------+\n| \'0.0\' = 0 |\n+-----------+\n| 1 |\n+-----------+\n\nSELECT \'0.01\' = 0;\n+------------+\n| \'0.01\' = 0 |\n+------------+\n| 0 |\n+------------+\n\nSELECT \'.01\' = 0.01;\n+--------------+\n| \'.01\' = 0.01 |\n+--------------+\n| 1 |\n+--------------+\n\nSELECT (5 * 2) = CONCAT(\'1\', \'0\');\n+----------------------------+\n| (5 * 2) = CONCAT(\'1\', \'0\') |\n+----------------------------+\n| 1 |\n+----------------------------+\n\nSELECT 1 = NULL;\n+----------+\n| 1 = NULL |\n+----------+\n| NULL |\n+----------+\n\nSELECT NULL = NULL;\n+-------------+\n| NULL = NULL |\n+-------------+\n| NULL |\n+-------------+\n\n\n\nURL: mariadb.com/kb/en/equal/','','https://mariadb.com/kb/en/equal/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (226,18,'&gt;','Syntax\n------\n\n>\n\nDescription\n-----------\n\nGreater than operator. Evaluates both SQL expressions and returns 1 if the\nleft value is greater than the right value and 0 if it is not, or NULL if\neither expression is NULL. If the expressions return different data types,\n(for instance, a number and a string), performs type conversion.\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) > (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a > t2.x) OR ((t1.a = t2.x) AND (t1.b > t2.y))\nFROM t1 INNER JOIN t2;\n\nExamples\n--------\n\nSELECT 2 > 2;\n+-------+\n| 2 > 2 |\n+-------+\n| 0 |\n+-------+\n\nSELECT \'b\' > \'a\';\n+-----------+\n| \'b\' > \'a\' |\n+-----------+\n| 1 |\n+-----------+\n\n\n\nURL: mariadb.com/kb/en/greater-than/','','https://mariadb.com/kb/en/greater-than/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (227,18,'&gt;=','Syntax\n------\n\n>=\n\nDescription\n-----------\n\nGreater than or equal operator. Evaluates both SQL expressions and returns 1\nif the left value is greater than or equal to the right value and 0 if it is\nnot, or NULL if either expression is NULL. If the expressions return different\ndata types, (for instance, a number and a string), performs type conversion.\n\nWhen used in row comparisons these two queries return the same results:\n\nSELECT (t1.a, t1.b) >= (t2.x, t2.y) \nFROM t1 INNER JOIN t2;\n\nSELECT (t1.a > t2.x) OR ((t1.a = t2.x) AND (t1.b >= t2.y))\nFROM t1 INNER JOIN t2;\n\nExamples\n--------\n\nSELECT 2 >= 2;\n+--------+\n| 2 >= 2 |\n+--------+\n| 1 |\n+--------+\n\nSELECT \'A\' >= \'a\';\n+------------+\n| \'A\' >= \'a\' |\n+------------+\n| 1 |\n+------------+\n\n\n\nURL: mariadb.com/kb/en/greater-than-or-equal/','','https://mariadb.com/kb/en/greater-than-or-equal/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (228,18,'BETWEEN AND','Syntax\n------\n\nexpr BETWEEN min AND max\n\nDescription\n-----------\n\nIf expr is greater than or equal to min and expr is less than or equal to max,\nBETWEEN returns 1, otherwise it returns 0. This is equivalent to the\nexpression (min <= expr AND expr <= max) if all the arguments are of the same\ntype. Otherwise type conversion takes place according to the rules described\nat Type Conversion, but applied to all the three arguments.\n\nExamples\n--------\n\nSELECT 1 BETWEEN 2 AND 3;\n+-------------------+\n| 1 BETWEEN 2 AND 3 |\n+-------------------+\n| 0 |\n+-------------------+\n\nSELECT \'b\' BETWEEN \'a\' AND \'c\';\n+-------------------------+\n| \'b\' BETWEEN \'a\' AND \'c\' |\n+-------------------------+\n| 1 |\n+-------------------------+\n\nSELECT 2 BETWEEN 2 AND \'3\';\n+---------------------+\n| 2 BETWEEN 2 AND \'3\' |\n+---------------------+\n| 1 |\n+---------------------+\n\nSELECT 2 BETWEEN 2 AND \'x-3\';\n+-----------------------+\n| 2 BETWEEN 2 AND \'x-3\' |\n+-----------------------+\n| 0 |\n+-----------------------+\n1 row in set, 1 warning (0.00 sec)\n\nWarning (Code 1292): Truncated incorrect DOUBLE value: \'x-3\'\n\nNULL:\n\nSELECT 1 BETWEEN 1 AND NULL;\n+----------------------+\n| 1 BETWEEN 1 AND NULL |\n+----------------------+\n| NULL |\n+----------------------+\n\nDATE, DATETIME and TIMESTAMP examples. Omitting the time component compares\nagainst 00:00, so later times on the same date are not returned:\n\nCREATE TABLE `x` (\n a date ,\n b datetime,\n c timestamp\n)\n\nINSERT INTO x VALUES \n (\'2018-11-11\', \'2018-11-11 05:15\', \'2018-11-11 05:15\'), \n (\'2018-11-12\', \'2018-11-12 05:15\', \'2018-11-12 05:15\');\n\nSELECT * FROM x WHERE a BETWEEN \'2018-11-11\' AND \'2018-11-12\';\n+------------+---------------------+---------------------+\n| a | b | c |\n+------------+---------------------+---------------------+\n| 2018-11-11 | 2018-11-11 05:15:00 | 2018-11-11 05:15:00 |\n| 2018-11-12 | 2018-11-12 05:15:00 | 2018-11-12 05:15:00 |\n+------------+---------------------+---------------------+\n\nSELECT * FROM x WHERE b BETWEEN \'2018-11-11\' AND \'2018-11-12\';\n+------------+---------------------+---------------------+\n| a | b | c |\n+------------+---------------------+---------------------+\n| 2018-11-11 | 2018-11-11 05:15:00 | 2018-11-11 05:15:00 |\n+------------+---------------------+---------------------+\n\nSELECT * FROM x WHERE c BETWEEN \'2018-11-11\' AND \'2018-11-12\';\n+------------+---------------------+---------------------+\n| a | b | c |\n+------------+---------------------+---------------------+\n| 2018-11-11 | 2018-11-11 05:15:00 | 2018-11-11 05:15:00 |\n+------------+---------------------+---------------------+\n\n\n\nURL: mariadb.com/kb/en/between-and/','','https://mariadb.com/kb/en/between-and/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (229,18,'COALESCE','Syntax\n------\n\nCOALESCE(value,...)\n\nDescription\n-----------\n\nReturns the first non-NULL value in the list, or NULL if there are no non-NULL\nvalues. At least one parameter must be passed.\n\nThe function is useful when substituting a default value for null values when\ndisplaying data.\n\nSee also NULL Values in MariaDB.\n\nExamples\n--------\n\nSELECT COALESCE(NULL,1);\n+------------------+\n| COALESCE(NULL,1) |\n+------------------+\n| 1 |\n+------------------+\n\nSELECT COALESCE(NULL,NULL,NULL);\n+--------------------------+\n| COALESCE(NULL,NULL,NULL) |\n+--------------------------+\n| NULL |\n+--------------------------+\n\nWhen two arguments are given, COALESCE() is the same as IFNULL():\n\nSET @a=NULL, @b=1;\n\nSELECT COALESCE(@a, @b), IFNULL(@a, @b);\n+------------------+----------------+\n| COALESCE(@a, @b) | IFNULL(@a, @b) |\n+------------------+----------------+\n| 1 | 1 |\n+------------------+----------------+\n\nHex type confusion:\n\nCREATE TABLE t1 (a INT, b VARCHAR(10));\nINSERT INTO t1 VALUES (0x31, 0x61),(COALESCE(0x31), COALESCE(0x61));\n\nSELECT * FROM t1;\n+------+------+\n| a | b |\n+------+------+\n| 49 | a |\n| 1 | a |\n+------+------+\n\nThe reason for the differing results above is that when 0x31 is inserted\ndirectly to the column, it\'s treated as a number (see Hexadecimal Literals),\nwhile when 0x31 is passed to COALESCE(), it\'s treated as a string, because:\n\n* HEX values have a string data type by default.\n* COALESCE() has the same data type as the argument.\n\nSubstituting zero for NULL (in this case when the aggregate function returns\nNULL after finding no rows):\n\nSELECT SUM(score) FROM student;\n+------------+\n| SUM(score) |\n+------------+\n| NULL |\n+------------+\n\nSELECT COALESCE(SUM(score),0) FROM student;\n+------------------------+\n| COALESCE(SUM(score),0) |\n+------------------------+\n| 0 |\n+------------------------+\n\n\n\nURL: mariadb.com/kb/en/coalesce/','','https://mariadb.com/kb/en/coalesce/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (230,18,'GREATEST','Syntax\n------\n\nGREATEST(value1,value2,...)\n\nDescription\n-----------\n\nWith two or more arguments, returns the largest (maximum-valued) argument. The\narguments are compared using the same rules as for LEAST().\n\nExamples\n--------\n\nSELECT GREATEST(2,0);\n+---------------+\n| GREATEST(2,0) |\n+---------------+\n| 2 |\n+---------------+\n\nSELECT GREATEST(34.0,3.0,5.0,767.0);\n+------------------------------+\n| GREATEST(34.0,3.0,5.0,767.0) |\n+------------------------------+\n| 767.0 |\n+------------------------------+\n\nSELECT GREATEST(\'B\',\'A\',\'C\');\n+-----------------------+\n| GREATEST(\'B\',\'A\',\'C\') |\n+-----------------------+\n| C |\n+-----------------------+\n\n\n\nURL: mariadb.com/kb/en/greatest/','','https://mariadb.com/kb/en/greatest/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (231,18,'IN','Syntax\n------\n\nexpr IN (value,...)\n\nDescription\n-----------\n\nReturns 1 if expr is equal to any of the values in the IN list, else returns\n0. If all values are constants, they are evaluated according to the type of\nexpr and sorted. The search for the item then is done using a binary search.\nThis means IN is very quick if the IN value list consists entirely of\nconstants. Otherwise, type conversion takes place according to the rules\ndescribed at Type Conversion, but applied to all the arguments.\n\nIf expr is NULL, IN always returns NULL. If at least one of the values in the\nlist is NULL, and one of the comparisons is true, the result is 1. If at least\none of the values in the list is NULL and none of the comparisons is true, the\nresult is NULL.\n\nExamples\n--------\n\nSELECT 2 IN (0,3,5,7);\n+----------------+\n| 2 IN (0,3,5,7) |\n+----------------+\n| 0 |\n+----------------+\n\nSELECT \'wefwf\' IN (\'wee\',\'wefwf\',\'weg\');\n+----------------------------------+\n| \'wefwf\' IN (\'wee\',\'wefwf\',\'weg\') |\n+----------------------------------+\n| 1 |\n+----------------------------------+\n\nType conversion:\n\nSELECT 1 IN (\'1\', \'2\', \'3\');\n+----------------------+\n| 1 IN (\'1\', \'2\', \'3\') |\n+----------------------+\n| 1 |\n+----------------------+\n\nSELECT NULL IN (1, 2, 3);\n+-------------------+\n| NULL IN (1, 2, 3) |\n+-------------------+\n| NULL |\n+-------------------+\n\nSELECT 1 IN (1, 2, NULL);\n+-------------------+\n| 1 IN (1, 2, NULL) |\n+-------------------+\n| 1 |\n+-------------------+\n\nSELECT 5 IN (1, 2, NULL);\n+-------------------+\n| 5 IN (1, 2, NULL) |\n+-------------------+\n| NULL |\n+-------------------+\n\n\n\nURL: mariadb.com/kb/en/in/','','https://mariadb.com/kb/en/in/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (232,18,'INTERVAL','Syntax\n------\n\nINTERVAL(N,N1,N2,N3,...)\n\nDescription\n-----------\n\nReturns the index of the last argument that is less than the first argument or\nis NULL.\n\nReturns 0 if N < N1, 1 if N < N2, 2 if N < N3 and so on or -1 if N is NULL.\nAll arguments are treated as integers. It is required that N1 < N2 < N3 < ...\n< Nn for this function to work correctly. This is because a fast binary search\nis used.\n\nExamples\n--------\n\nSELECT INTERVAL(23, 1, 15, 17, 30, 44, 200);\n+--------------------------------------+\n| INTERVAL(23, 1, 15, 17, 30, 44, 200) |\n+--------------------------------------+\n| 3 |\n+--------------------------------------+\n\nSELECT INTERVAL(10, 1, 10, 100, 1000);\n+--------------------------------+\n| INTERVAL(10, 1, 10, 100, 1000) |\n+--------------------------------+\n| 2 |\n+--------------------------------+\n\nSELECT INTERVAL(22, 23, 30, 44, 200);\n+-------------------------------+\n| INTERVAL(22, 23, 30, 44, 200) |\n+-------------------------------+\n| 0 |\n+-------------------------------+\n\nSELECT INTERVAL(10, 2, NULL);\n+-----------------------+\n| INTERVAL(10, 2, NULL) |\n+-----------------------+\n| 2 |\n+-----------------------+\n\n\n\nURL: mariadb.com/kb/en/interval/','','https://mariadb.com/kb/en/interval/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (233,18,'IS','Syntax\n------\n\nIS boolean_value\n\nDescription\n-----------\n\nTests a value against a boolean value, where boolean_value can be TRUE, FALSE,\nor UNKNOWN.\n\nThere is an important difference between using IS TRUE or comparing a value\nwith TRUE using =. When using =, only 1 equals to TRUE. But when using IS\nTRUE, all values which are logically true (like a number > 1) return TRUE.\n\nExamples\n--------\n\nSELECT 1 IS TRUE, 0 IS FALSE, NULL IS UNKNOWN;\n+-----------+------------+-----------------+\n| 1 IS TRUE | 0 IS FALSE | NULL IS UNKNOWN |\n+-----------+------------+-----------------+\n| 1 | 1 | 1 |\n+-----------+------------+-----------------+\n\nDifference between = and IS TRUE:\n\nSELECT 2 = TRUE, 2 IS TRUE;\n+----------+-----------+\n| 2 = TRUE | 2 IS TRUE |\n+----------+-----------+\n| 0 | 1 |\n+----------+-----------+\n\n\n\nURL: mariadb.com/kb/en/is/','','https://mariadb.com/kb/en/is/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (234,18,'IS NOT','Syntax\n------\n\nIS NOT boolean_value\n\nDescription\n-----------\n\nTests a value against a boolean value, where boolean_value can be TRUE, FALSE,\nor UNKNOWN.\n\nExamples\n--------\n\nSELECT 1 IS NOT UNKNOWN, 0 IS NOT UNKNOWN, NULL IS NOT UNKNOWN;\n+------------------+------------------+---------------------+\n| 1 IS NOT UNKNOWN | 0 IS NOT UNKNOWN | NULL IS NOT UNKNOWN |\n+------------------+------------------+---------------------+\n| 1 | 1 | 0 |\n+------------------+------------------+---------------------+\n\nSELECT NULL IS NOT TRUE, NULL IS NOT FALSE;\n+------------------+-------------------+\n| NULL IS NOT TRUE | NULL IS NOT FALSE |\n+------------------+-------------------+\n| 1 | 1 |\n+------------------+-------------------+\n\n\n\nURL: mariadb.com/kb/en/is-not/','','https://mariadb.com/kb/en/is-not/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (235,18,'IS NOT NULL','Syntax\n------\n\nIS NOT NULL\n\nDescription\n-----------\n\nTests whether a value is not NULL. See also NULL Values in MariaDB.\n\nExamples\n--------\n\nSELECT 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;\n+---------------+---------------+------------------+\n| 1 IS NOT NULL | 0 IS NOT NULL | NULL IS NOT NULL |\n+---------------+---------------+------------------+\n| 1 | 1 | 0 |\n+---------------+---------------+------------------+\n\n\n\nURL: mariadb.com/kb/en/is-not-null/','','https://mariadb.com/kb/en/is-not-null/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (236,18,'IS NULL','Syntax\n------\n\nIS NULL\n\nDescription\n-----------\n\nTests whether a value is NULL. See also NULL Values in MariaDB.\n\nExamples\n--------\n\nSELECT 1 IS NULL, 0 IS NULL, NULL IS NULL;\n+-----------+-----------+--------------+\n| 1 IS NULL | 0 IS NULL | NULL IS NULL |\n+-----------+-----------+--------------+\n| 0 | 0 | 1 |\n+-----------+-----------+--------------+\n\nCompatibility\n-------------\n\nSome ODBC applications use the syntax auto_increment_field IS NOT NULL to find\nthe latest row that was inserted with an autogenerated key value. If your\napplications need this, you can set the sql_auto_is_null variable to 1.\n\nSET @@sql_auto_is_null=1;\nCREATE TABLE t1 (auto_increment_column INT NOT NULL AUTO_INCREMENT PRIMARY\nKEY);\nINSERT INTO t1 VALUES (NULL);\nSELECT * FROM t1 WHERE auto_increment_column IS NULL;\n\n+-----------------------+\n| auto_increment_column |\n+-----------------------+\n| 1 |\n+-----------------------+\n\n\n\nURL: mariadb.com/kb/en/is-null/','','https://mariadb.com/kb/en/is-null/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (237,18,'ISNULL','Syntax\n------\n\nISNULL(expr)\n\nDescription\n-----------\n\nIf expr is NULL, ISNULL() returns 1, otherwise it returns 0.\n\nSee also NULL Values in MariaDB.\n\nExamples\n--------\n\nSELECT ISNULL(1+1);\n+-------------+\n| ISNULL(1+1) |\n+-------------+\n| 0 |\n+-------------+\n\nSELECT ISNULL(1/0);\n+-------------+\n| ISNULL(1/0) |\n+-------------+\n| 1 |\n+-------------+\n\n\n\nURL: mariadb.com/kb/en/isnull/','','https://mariadb.com/kb/en/isnull/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (238,18,'LEAST','Syntax\n------\n\nLEAST(value1,value2,...)\n\nDescription\n-----------\n\nWith two or more arguments, returns the smallest (minimum-valued) argument.\nThe arguments are compared using the following rules:\n\n* If the return value is used in an INTEGER context or all arguments are\ninteger-valued, they are compared as integers.\n* If the return value is used in a REAL context or all arguments are\nreal-valued, they are compared as reals.\n* If any argument is a case-sensitive string, the arguments are compared as\ncase-sensitive strings.\n* In all other cases, the arguments are compared as case-insensitive strings.\n\nLEAST() returns NULL if any argument is NULL.\n\nExamples\n--------\n\nSELECT LEAST(2,0);\n+------------+\n| LEAST(2,0) |\n+------------+\n| 0 |\n+------------+\n\nSELECT LEAST(34.0,3.0,5.0,767.0);\n+---------------------------+\n| LEAST(34.0,3.0,5.0,767.0) |\n+---------------------------+\n| 3.0 |\n+---------------------------+\n\nSELECT LEAST(\'B\',\'A\',\'C\');\n+--------------------+\n| LEAST(\'B\',\'A\',\'C\') |\n+--------------------+\n| A |\n+--------------------+\n\n\n\nURL: mariadb.com/kb/en/least/','','https://mariadb.com/kb/en/least/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (239,18,'NOT BETWEEN','Syntax\n------\n\nexpr NOT BETWEEN min AND max\n\nDescription\n-----------\n\nThis is the same as NOT (expr BETWEEN min AND max).\n\nNote that the meaning of the alternative form NOT expr BETWEEN min AND max is\naffected by the HIGH_NOT_PRECEDENCE SQL_MODE flag.\n\nExamples\n--------\n\nSELECT 1 NOT BETWEEN 2 AND 3;\n+-----------------------+\n| 1 NOT BETWEEN 2 AND 3 |\n+-----------------------+\n| 1 |\n+-----------------------+\n\nSELECT \'b\' NOT BETWEEN \'a\' AND \'c\';\n+-----------------------------+\n| \'b\' NOT BETWEEN \'a\' AND \'c\' |\n+-----------------------------+\n| 0 |\n+-----------------------------+\n\nNULL:\n\nSELECT 1 NOT BETWEEN 1 AND NULL;\n+--------------------------+\n| 1 NOT BETWEEN 1 AND NULL |\n+--------------------------+\n| NULL |\n+--------------------------+\n\n\n\nURL: mariadb.com/kb/en/not-between/','','https://mariadb.com/kb/en/not-between/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (240,18,'NOT IN','Syntax\n------\n\nexpr NOT IN (value,...)\n\nDescription\n-----------\n\nThis is the same as NOT (expr IN (value,...)).\n\nExamples\n--------\n\nSELECT 2 NOT IN (0,3,5,7);\n+--------------------+\n| 2 NOT IN (0,3,5,7) |\n+--------------------+\n| 1 |\n+--------------------+\n\nSELECT \'wefwf\' NOT IN (\'wee\',\'wefwf\',\'weg\');\n+--------------------------------------+\n| \'wefwf\' NOT IN (\'wee\',\'wefwf\',\'weg\') |\n+--------------------------------------+\n| 0 |\n+--------------------------------------+\n\nSELECT 1 NOT IN (\'1\', \'2\', \'3\');\n+--------------------------+\n| 1 NOT IN (\'1\', \'2\', \'3\') |\n+--------------------------+\n| 0 |\n+--------------------------+\n\nNULL:\n\nSELECT NULL NOT IN (1, 2, 3);\n+-----------------------+\n| NULL NOT IN (1, 2, 3) |\n+-----------------------+\n| NULL |\n+-----------------------+\n\nSELECT 1 NOT IN (1, 2, NULL);\n+-----------------------+\n| 1 NOT IN (1, 2, NULL) |\n+-----------------------+\n| 0 |\n+-----------------------+\n\nSELECT 5 NOT IN (1, 2, NULL);\n+-----------------------+\n| 5 NOT IN (1, 2, NULL) |\n+-----------------------+\n| NULL |\n+-----------------------+\n\n\n\nURL: mariadb.com/kb/en/not-in/','','https://mariadb.com/kb/en/not-in/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (241,19,'Operator Precedence','The precedence is the order in which the SQL operators are evaluated.\n\nThe following list shows the SQL operator precedence. Operators that appear\nfirst in the list have a higher precedence. Operators which are listed\ntogether have the same precedence.\n\n* INTERVAL\n* BINARY, COLLATE\n* !\n* - (unary minus), [[bitwise-not|]] (unary bit inversion)\n* || (string concatenation)\n* ^\n* *, /, DIV, %, MOD\n* -, +\n* <<, >>\n* &\n* |\n* = (comparison), <=>, >=, >, <=, <, <>, !=, IS, LIKE, REGEXP, IN\n* BETWEEN, CASE, WHEN, THEN, ELSE, END\n* NOT\n* &&, AND\n* XOR\n* || (logical or), OR\n* = (assignment), :=\n\nFunctions precedence is always higher than operators precedence.\n\nIn this page CASE refers to the CASE operator, not to the CASE statement.\n\nIf the HIGH_NOT_PRECEDENCE SQL_MODE is set, NOT has the same precedence as !.\n\nThe || operator\'s precedence, as well as its meaning, depends on the\nPIPES_AS_CONCAT SQL_MODE flag: if it is on, || can be used to concatenate\nstrings (like the CONCAT() function) and has a higher precedence.\n\nThe = operator\'s precedence depends on the context - it is higher when = is\nused as a comparison operator.\n\nParenthesis can be used to modify the operators precedence in an expression.\n\nShort-circuit evaluation\n------------------------\n\nThe AND, OR, && and || operators support short-circuit evaluation. This means\nthat, in some cases, the expression on the right of those operators is not\nevaluated, because its result cannot affect the result. In the following\ncases, short-circuit evaluation is used and x() is not evaluated:\n\n* FALSE AND x()\n* FALSE && x()\n* TRUE OR x()\n* TRUE || x()\n* NULL BETWEEN x() AND x()\n\nNote however that the short-circuit evaluation does not apply to NULL AND x().\nAlso, BETWEEN\'s right operands are not evaluated if the left operand is NULL,\nbut in all other cases all the operands are evaluated.\n\nThis is a speed optimization. Also, since functions can have side-effects,\nthis behavior can be used to choose whether execute them or not using a\nconcise syntax:\n\nSELECT some_function() OR log_error();\n\n\n\nURL: mariadb.com/kb/en/operator-precedence/','','https://mariadb.com/kb/en/operator-precedence/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (242,19,'&amp;','Syntax\n------\n\n&\n\nDescription\n-----------\n\nBitwise AND. Converts the values to binary and compares bits. Only if both the\ncorresponding bits are 1 is the resulting bit also 1.\n\nSee also bitwise OR.\n\nExamples\n--------\n\nSELECT 2&1;\n+-----+\n| 2&1 |\n+-----+\n| 0 |\n+-----+\n\nSELECT 3&1;\n+-----+\n| 3&1 |\n+-----+\n| 1 |\n+-----+\n\nSELECT 29 & 15;\n+---------+\n| 29 & 15 |\n+---------+\n| 13 |\n+---------+\n\n\n\nURL: mariadb.com/kb/en/bitwise_and/','','https://mariadb.com/kb/en/bitwise_and/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (243,19,'&lt;&lt;','Syntax\n------\n\nvalue1 << value2\n\nDescription\n-----------\n\nConverts a longlong (BIGINT) number (value1) to binary and shifts value2 units\nto the left.\n\nExamples\n--------\n\nSELECT 1 << 2;\n+--------+\n| 1 << 2 |\n+--------+\n| 4 |\n+--------+\n\n\n\nURL: mariadb.com/kb/en/shift-left/','','https://mariadb.com/kb/en/shift-left/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (244,19,'&gt;&gt;','Syntax\n------\n\nvalue1 >> value2\n\nDescription\n-----------\n\nConverts a longlong (BIGINT) number (value1) to binary and shifts value2 units\nto the right.\n\nExamples\n--------\n\nSELECT 4 >> 2;\n+--------+\n| 4 >> 2 |\n+--------+\n| 1 |\n+--------+\n\n\n\nURL: mariadb.com/kb/en/shift-right/','','https://mariadb.com/kb/en/shift-right/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (245,19,'BIT_COUNT','Syntax\n------\n\nBIT_COUNT(N)\n\nDescription\n-----------\n\nReturns the number of bits that are set in the argument N.\n\nExamples\n--------\n\nSELECT BIT_COUNT(29), BIT_COUNT(b\'101010\');\n+---------------+----------------------+\n| BIT_COUNT(29) | BIT_COUNT(b\'101010\') |\n+---------------+----------------------+\n| 4 | 3 |\n+---------------+----------------------+\n\n\n\nURL: mariadb.com/kb/en/bit_count/','','https://mariadb.com/kb/en/bit_count/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (246,19,'^','Syntax\n------\n\n^\n\nDescription\n-----------\n\nBitwise XOR. Converts the values to binary and compares bits. If one (and only\none) of the corresponding bits is 1 is the resulting bit also 1.\n\nExamples\n--------\n\nSELECT 1 ^ 1;\n+-------+\n| 1 ^ 1 |\n+-------+\n| 0 |\n+-------+\n\nSELECT 1 ^ 0;\n+-------+\n| 1 ^ 0 |\n+-------+\n| 1 |\n+-------+\n\nSELECT 11 ^ 3;\n+--------+\n| 11 ^ 3 |\n+--------+\n| 8 |\n+--------+\n\n\n\nURL: mariadb.com/kb/en/bitwise-xor/','','https://mariadb.com/kb/en/bitwise-xor/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (247,19,'|','Syntax\n------\n\n|\n\nDescription\n-----------\n\nBitwise OR. Converts the values to binary and compares bits. If either of the\ncorresponding bits has a value of 1, the resulting bit is also 1.\n\nSee also bitwise AND.\n\nExamples\n--------\n\nSELECT 2|1;\n+-----+\n| 2|1 |\n+-----+\n| 3 |\n+-----+\n\nSELECT 29 | 15;\n+---------+\n| 29 | 15 |\n+---------+\n| 31 |\n+---------+\n\n\n\nURL: mariadb.com/kb/en/bitwise-or/','','https://mariadb.com/kb/en/bitwise-or/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (248,19,'~','Syntax\n------\n\n~\n\nDescription\n-----------\n\nBitwise NOT. Converts the value to 4 bytes binary and inverts all bits.\n\nExamples\n--------\n\nSELECT 3 & ~1;\n+--------+\n| 3 & ~1 |\n+--------+\n| 2 |\n+--------+\n\nSELECT 5 & ~1;\n+--------+\n| 5 & ~1 |\n+--------+\n| 4 |\n+--------+\n\n\n\nURL: mariadb.com/kb/en/bitwise-not/','','https://mariadb.com/kb/en/bitwise-not/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (249,19,'Parentheses','Parentheses are sometimes called precedence operators - this means\nthat they can be used to change the other operator\'s precedence in an\nexpression. The expressions that are written between parentheses are computed\nbefore the expressions that are written outside. Parentheses must always\ncontain an expression (that is, they cannot be empty), and can be nested.\n\nFor example, the following expressions could return different results:\n\n* NOT a OR b\n* NOT (a OR b)\n\nIn the first case, NOT applies to a, so if a is FALSE or b is TRUE, the\nexpression returns TRUE. In the second case, NOT applies to the result of a OR\nb, so if at least one of a or b is TRUE, the expression is TRUE.\n\nWhen the precedence of operators is not intuitive, you can use parentheses to\nmake it immediately clear for whoever reads the statement.\n\nThe precedence of the NOT operator can also be affected by the\nHIGH_NOT_PRECEDENCE SQL_MODE flag.\n\nOther uses\n----------\n\nParentheses must always be used to enclose subqueries.\n\nParentheses can also be used in a JOIN statement between multiple tables to\ndetermine which tables must be joined first.\n\nAlso, parentheses are used to enclose the list of parameters to be passed to\nbuilt-in functions, user-defined functions and stored routines. However, when\nno parameter is passed to a stored procedure, parentheses are optional. For\nbuiltin functions and user-defined functions, spaces are not allowed between\nthe function name and the open parenthesis, unless the IGNORE_SPACE SQL_MODE\nis set. For stored routines (and for functions if IGNORE_SPACE is set) spaces\nare allowed before the open parenthesis, including tab characters and new line\ncharacters.\n\nSyntax errors\n-------------\n\nIf there are more open parentheses than closed parentheses, the error usually\nlooks like this:\n\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual that\ncorresponds to your MariaDB server version for the right syntax to use near \'\'\na\nt line 1\n\nNote the empty string.\n\nIf there are more closed parentheses than open parentheses, the error usually\nlooks like this:\n\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual that\ncorresponds to your MariaDB server version for the right syntax to use near \')\'\nat line 1\n\nNote the quoted closed parenthesis.\n\n\n\nURL: mariadb.com/kb/en/parentheses/','','https://mariadb.com/kb/en/parentheses/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (250,19,'TRUE FALSE','Description\n-----------\n\nThe constants TRUE and FALSE evaluate to 1 and 0, respectively. The constant\nnames can be written in any lettercase.\n\nExamples\n--------\n\nSELECT TRUE, true, FALSE, false;\n+------+------+-------+-------+\n| TRUE | TRUE | FALSE | FALSE |\n+------+------+-------+-------+\n| 1 | 1 | 0 | 0 |\n+------+------+-------+-------+\n\n\n\nURL: mariadb.com/kb/en/true-false/','','https://mariadb.com/kb/en/true-false/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (251,20,'ANALYZE TABLE','Syntax\n------\n\nANALYZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [,tbl_name ...] \n [PERSISTENT FOR [ALL|COLUMNS ([col_name [,col_name ...]])]\n [INDEXES ([index_name [,index_name ...]])]]\n\nDescription\n-----------\n\nANALYZE TABLE analyzes and stores the key distribution for a table (index\nstatistics). This statement works with MyISAM, Aria and InnoDB tables. During\nthe analysis, InnoDB will allow reads/writes, and MyISAM/Aria reads/inserts.\nFor MyISAM tables, this statement is equivalent to using myisamchk --analyze.\n\nFor more information on how the analysis works within InnoDB, see InnoDB\nLimitations.\n\nMariaDB uses the stored key distribution to decide the order in which tables\nshould be joined when you perform a join on something other than a constant.\nIn addition, key distributions can be used when deciding which indexes to use\nfor a specific table within a query.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nBy default, ANALYZE TABLE statements are written to the binary log and will be\nreplicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) will ensure the\nstatement is not written to the binary log.\n\nFrom MariaDB 10.3.19, ANALYZE TABLE statements are not logged to the binary\nlog if read_only is set. See also Read-Only Replicas.\n\nANALYZE TABLE is also supported for partitioned tables. You can use ALTER\nTABLE ... ANALYZE PARTITION to analyze one or more partitions.\n\nThe Aria storage engine supports progress reporting for the ANALYZE TABLE\nstatement.\n\nEngine-Independent Statistics\n-----------------------------\n\nANALYZE TABLE supports engine-independent statistics. See Engine-Independent\nTable Statistics: Collecting Statistics with the ANALYZE TABLE Statement for\nmore information.\n\n\n\nURL: mariadb.com/kb/en/analyze-table/','','https://mariadb.com/kb/en/analyze-table/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (252,20,'CHECK TABLE','Syntax\n------\n\nCHECK TABLE tbl_name [, tbl_name] ... [option] ...\n\noption = {FOR UPGRADE | QUICK | FAST | MEDIUM | EXTENDED | CHANGED}\n\nDescription\n-----------\n\nCHECK TABLE checks a table or tables for errors. CHECK TABLE works for\nArchive, Aria, CSV, InnoDB, and MyISAM tables. For Aria and MyISAM tables, the\nkey statistics are updated as well. For CSV, see also Checking and Repairing\nCSV Tables.\n\nAs an alternative, myisamchk is a commandline tool for checking MyISAM tables\nwhen the tables are not being accessed.\n\nFor checking dynamic columns integrity, COLUMN_CHECK() can be used.\n\nCHECK TABLE can also check views for problems, such as tables that are\nreferenced in the view definition that no longer exist.\n\nCHECK TABLE is also supported for partitioned tables. You can use ALTER TABLE\n... CHECK PARTITION to check one or more partitions.\n\nThe meaning of the different options are as follows - note that this can vary\na bit between storage engines:\n\n+-----+-----------------------------------------------------------------------+\n| FOR | Do a very quick check if the storage format for the table has |\n| UPG | changed so that one needs to do a REPAIR. This is only needed when |\n| ADE | one upgrades between major versions of MariaDB or MySQL. This is |\n| | usually done by running mysql_upgrade. |\n+-----+-----------------------------------------------------------------------+\n| FAS | Only check tables that has not been closed properly or are marked as |\n| | corrupt. Only supported by the MyISAM and Aria engines. For other |\n| | engines the table is checked normally |\n+-----+-----------------------------------------------------------------------+\n| CHA | Check only tables that has changed since last REPAIR / CHECK. Only |\n| GED | supported by the MyISAM and Aria engines. For other engines the |\n| | table is checked normally. |\n+-----+-----------------------------------------------------------------------+\n| QUI | Do a fast check. For MyISAM and Aria engine this means we skip |\n| K | checking the delete link chain which may take some time. |\n+-----+-----------------------------------------------------------------------+\n| MED | Scan also the data files. Checks integrity between data and index |\n| UM | files with checksums. In most cases this should find all possible |\n| | errors. |\n+-----+-----------------------------------------------------------------------+\n| EXT | Does a full check to verify every possible error. For MyISAM and |\n| NDE | Aria we verify for each row that all it keys exists and points to |\n| | the row. This may take a long time on big tables! |\n+-----+-----------------------------------------------------------------------+\n\nFor most cases running CHECK TABLE without options or MEDIUM should be good\nenough.\n\nThe Aria storage engine supports progress reporting for this statement.\n\nIf you want to know if two tables are identical, take a look at CHECKSUM TABLE.\n\nInnoDB\n------\n\nIf CHECK TABLE finds an error in an InnoDB table, MariaDB might shutdown to\nprevent the error propagation. In this case, the problem will be reported in\nthe error log. Otherwise the table or an index might be marked as corrupted,\nto prevent use. This does not happen with some minor problems, like a wrong\nnumber of entries in a secondary index. Those problems are reported in the\noutput of CHECK TABLE.\n\nEach tablespace contains a header with metadata. This header is not checked by\nthis statement.\n\nDuring the execution of CHECK TABLE, other threads may be blocked.\n\n\n\nURL: mariadb.com/kb/en/sql-commands-check-table/','','https://mariadb.com/kb/en/sql-commands-check-table/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (253,20,'CHECK VIEW','Syntax\n------\n\nCHECK VIEW view_name\n\nDescription\n-----------\n\nThe CHECK VIEW statement was introduced in MariaDB 10.0.18 to assist with\nfixing MDEV-6916, an issue introduced in MariaDB 5.2 where the view algorithms\nwere swapped. It checks whether the view algorithm is correct. It is run as\npart of mysql_upgrade, and should not normally be required in regular use.\n\n\n\nURL: mariadb.com/kb/en/check-view/','','https://mariadb.com/kb/en/check-view/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (254,20,'CHECKSUM TABLE','Syntax\n------\n\nCHECKSUM TABLE tbl_name [, tbl_name] ... [ QUICK | EXTENDED ]\n\nDescription\n-----------\n\nCHECKSUM TABLE reports a table checksum. This is very useful if you want to\nknow if two tables are the same (for example on a master and slave).\n\nWith QUICK, the live table checksum is reported if it is available, or NULL\notherwise. This is very fast. A live checksum is enabled by specifying the\nCHECKSUM=1 table option when you create the table; currently, this is\nsupported only for Aria and MyISAM tables.\n\nWith EXTENDED, the entire table is read row by row and the checksum is\ncalculated. This can be very slow for large tables.\n\nIf neither QUICK nor EXTENDED is specified, MariaDB returns a live checksum if\nthe table storage engine supports it and scans the table otherwise.\n\nCHECKSUM TABLE requires the SELECT privilege for the table.\n\nFor a nonexistent table, CHECKSUM TABLE returns NULL and generates a warning.\n\nThe table row format affects the checksum value. If the row format changes,\nthe checksum will change. This means that when a table created with a\nMariaDB/MySQL version is upgraded to another version, the checksum value will\nprobably change.\n\nTwo identical tables should always match to the same checksum value; however,\nalso for non-identical tables there is a very slight chance that they will\nreturn the same value as the hashing algorithm is not completely\ncollision-free.\n\nDifferences Between MariaDB and MySQL\n-------------------------------------\n\nCHECKSUM TABLE may give a different result as MariaDB doesn\'t ignore NULLs in\nthe columns as MySQL 5.1 does (Later MySQL versions should calculate checksums\nthe same way as MariaDB). You can get the \'old style\' checksum in MariaDB by\nstarting mysqld with the --old option. Note however that that the MyISAM and\nAria storage engines in MariaDB are using the new checksum internally, so if\nyou are using --old, the CHECKSUM command will be slower as it needs to\ncalculate the checksum row by row. Starting from MariaDB Server 10.9, --old is\ndeprecated and will be removed in a future release. Set --old-mode or OLD_MODE\nto COMPAT_5_1_CHECKSUM to get \'old style\' checksum.\n\n\n\nURL: mariadb.com/kb/en/checksum-table/','','https://mariadb.com/kb/en/checksum-table/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (255,20,'OPTIMIZE TABLE','Syntax\n------\n\nOPTIMIZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n [WAIT n | NOWAIT]\n\nDescription\n-----------\n\nOPTIMIZE TABLE has two main functions. It can either be used to defragment\ntables, or to update the InnoDB fulltext index.\n\nMariaDB starting with 10.3.0\n----------------------------\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nDefragmenting\n-------------\n\nOPTIMIZE TABLE works for InnoDB (before MariaDB 10.1.1, only if the\ninnodb_file_per_table server system variable is set), Aria, MyISAM and ARCHIVE\ntables, and should be used if you have deleted a large part of a table or if\nyou have made many changes to a table with variable-length rows (tables that\nhave VARCHAR, VARBINARY, BLOB, or TEXT columns). Deleted rows are maintained\nin a linked list and subsequent INSERT operations reuse old row positions.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nBy default, OPTIMIZE TABLE statements are written to the binary log and will\nbe replicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) will ensure\nthe statement is not written to the binary log.\n\nFrom MariaDB 10.3.19, OPTIMIZE TABLE statements are not logged to the binary\nlog if read_only is set. See also Read-Only Replicas.\n\nOPTIMIZE TABLE is also supported for partitioned tables. You can use ALTER\nTABLE ... OPTIMIZE PARTITION to optimize one or more partitions.\n\nYou can use OPTIMIZE TABLE to reclaim the unused space and to defragment the\ndata file. With other storage engines, OPTIMIZE TABLE does nothing by default,\nand returns this message: " The storage engine for the table doesn\'t support\noptimize". However, if the server has been started with the --skip-new option,\nOPTIMIZE TABLE is linked to ALTER TABLE, and recreates the table. This\noperation frees the unused space and updates index statistics.\n\nThe Aria storage engine supports progress reporting for this statement.\n\nIf a MyISAM table is fragmented, concurrent inserts will not be performed\nuntil an OPTIMIZE TABLE statement is executed on that table, unless the\nconcurrent_insert server system variable is set to ALWAYS.\n\nUpdating an InnoDB fulltext index\n---------------------------------\n\nWhen rows are added or deleted to an InnoDB fulltext index, the index is not\nimmediately re-organized, as this can be an expensive operation. Change\nstatistics are stored in a separate location . The fulltext index is only\nfully re-organized when an OPTIMIZE TABLE statement is run.\n\nBy default, an OPTIMIZE TABLE will defragment a table. In order to use it to\nupdate fulltext index statistics, the innodb_optimize_fulltext_only system\nvariable must be set to 1. This is intended to be a temporary setting, and\nshould be reset to 0 once the fulltext index has been re-organized.\n\nSince fulltext re-organization can take a long time, the\ninnodb_ft_num_word_optimize variable limits the re-organization to a number of\nwords (2000 by default). You can run multiple OPTIMIZE statements to fully\nre-organize the index.\n\nDefragmenting InnoDB tablespaces\n--------------------------------\n\nMariaDB 10.1.1 merged the Facebook/Kakao defragmentation patch, allowing one\nto use OPTIMIZE TABLE to defragment InnoDB tablespaces. For this functionality\nto be enabled, the innodb_defragment system variable must be enabled. No new\ntables are created and there is no need to copy data from old tables to new\ntables. Instead, this feature loads n pages (determined by\ninnodb-defragment-n-pages) and tries to move records so that pages would be\nfull of records and then frees pages that are fully empty after the operation.\nNote that tablespace files (including ibdata1) will not shrink as the result\nof defragmentation, but one will get better memory utilization in the InnoDB\nbuffer pool as there are fewer data pages in use.\n\nSee Defragmenting InnoDB Tablespaces for more details.\n\n\n\nURL: mariadb.com/kb/en/optimize-table/','','https://mariadb.com/kb/en/optimize-table/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (256,20,'REPAIR TABLE','Syntax\n------\n\nREPAIR [NO_WRITE_TO_BINLOG | LOCAL] TABLE\n tbl_name [, tbl_name] ...\n [QUICK] [EXTENDED] [USE_FRM]\n\nDescription\n-----------\n\nREPAIR TABLE repairs a possibly corrupted table. By default, it has the same\neffect as\n\nmyisamchk --recover tbl_name\n\nor\n\naria_chk --recover tbl_name\n\nSee aria_chk and myisamchk for more.\n\nREPAIR TABLE works for Archive, Aria, CSV and MyISAM tables. For InnoDB, see\nrecovery modes. For CSV, see also Checking and Repairing CSV Tables. For\nArchive, this statement also improves compression. If the storage engine does\nnot support this statement, a warning is issued.\n\nThis statement requires SELECT and INSERT privileges for the table.\n\nBy default, REPAIR TABLE statements are written to the binary log and will be\nreplicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) will ensure the\nstatement is not written to the binary log.\n\nFrom MariaDB 10.3.19, REPAIR TABLE statements are not logged to the binary log\nif read_only is set. See also Read-Only Replicas.\n\nWhen an index is recreated, the storage engine may use a configurable buffer\nin the process. Incrementing the buffer speeds up the index creation. Aria and\nMyISAM allocate a buffer whose size is defined by aria_sort_buffer_size or\nmyisam_sort_buffer_size, also used for ALTER TABLE.\n\nREPAIR TABLE is also supported for partitioned tables. However, the USE_FRM\noption cannot be used with this statement on a partitioned table.\n\nALTER TABLE ... REPAIR PARTITION can be used to repair one or more partitions.\n\nThe Aria storage engine supports progress reporting for this statement.\n\n\n\nURL: mariadb.com/kb/en/repair-table/','','https://mariadb.com/kb/en/repair-table/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (257,20,'REPAIR VIEW','Syntax\n------\n\nREPAIR [NO_WRITE_TO_BINLOG | LOCAL] VIEW view_name[, view_name] ... [FROM\nMYSQL]\n\nDescription\n-----------\n\nThe REPAIR VIEW statement was introduced to assist with fixing MDEV-6916, an\nissue introduced in MariaDB 5.2 where the view algorithms were swapped\ncompared to their MySQL on disk representation. It checks whether the view\nalgorithm is correct. It is run as part of mysql_upgrade, and should not\nnormally be required in regular use.\n\nBy default it corrects the checksum and if necessary adds the mariadb-version\nfield. If the optional FROM MYSQL clause is used, and no mariadb-version field\nis present, the MERGE and TEMPTABLE algorithms are toggled.\n\nBy default, REPAIR VIEW statements are written to the binary log and will be\nreplicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) will ensure the\nstatement is not written to the binary log.\n\n\n\nURL: mariadb.com/kb/en/repair-view/','','https://mariadb.com/kb/en/repair-view/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (258,21,'CREATE FUNCTION UDF','Syntax\n------\n\nCREATE [OR REPLACE] [AGGREGATE] FUNCTION [IF NOT EXISTS] function_name\n RETURNS {STRING|INTEGER|REAL|DECIMAL}\n SONAME shared_library_name\n\nDescription\n-----------\n\nA user-defined function (UDF) is a way to extend MariaDB with a new function\nthat works like a native (built-in) MariaDB function such as ABS() or CONCAT().\n\nfunction_name is the name that should be used in SQL statements to invoke the\nfunction.\n\nTo create a function, you must have the INSERT privilege for the mysql\ndatabase. This is necessary becauseCREATE FUNCTION adds a row to the\nmysql.func system table that records the function\'s name, type, and shared\nlibrary name. If you do not have this table, you should run the mysql_upgrade\ncommand to create it.\n\nUDFs need to be written in C, C++ or another language that uses C calling\nconventions, MariaDB needs to have been dynamically compiled, and your\noperating system must support dynamic loading.\n\nFor an example, see sql/udf_example.cc in the source tree. For a collection of\nexisting UDFs see http://www.mysqludf.org/.\n\nStatements making use of user-defined functions are not safe for replication.\n\nFor creating a stored function as opposed to a user-defined function, see\nCREATE FUNCTION.\n\nFor valid identifiers to use as function names, see Identifier Names.\n\nRETURNS\n-------\n\nThe RETURNS clause indicates the type of the function\'s return value, and can\nbe one of STRING, INTEGER, REAL or DECIMAL. DECIMAL functions currently return\nstring values and should be written like STRING functions.\n\nshared_library_name\n-------------------\n\nshared_library_name is the basename of the shared object file that contains\nthe code that implements the function. The file must be located in the plugin\ndirectory. This directory is given by the value of the plugin_dir system\nvariable. Note that before MariaDB/MySQL 5.1, the shared object could be\nlocated in any directory that was searched by your system\'s dynamic linker.\n\nAGGREGATE\n---------\n\nAggregate functions are summary functions such as SUM() and AVG().\n\nMariaDB starting with 10.4\n--------------------------\nAggregate UDF functions can be used as window functions.\n\nOR REPLACE\n----------\n\nMariaDB starting with 10.1.3\n----------------------------\nThe OR REPLACE clause was added in MariaDB 10.1.3\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP FUNCTION IF EXISTS function_name;\nCREATE FUNCTION name ...;\n\nIF NOT EXISTS\n-------------\n\nMariaDB starting with 10.1.3\n----------------------------\nThe IF NOT EXISTS clause was added in MariaDB 10.1.3\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead\nof an error if the specified function already exists. Cannot be used together\nwith OR REPLACE.\n\nUpgrading a UDF\n---------------\n\nTo upgrade the UDF\'s shared library, first run a DROP FUNCTION statement, then\nupgrade the shared library and finally run the CREATE FUNCTION statement. If\nyou upgrade without following this process, you may crash the server.\n\nExamples\n--------\n\nCREATE FUNCTION jsoncontains_path RETURNS integer SONAME \'ha_connect.so\';\nQuery OK, 0 rows affected (0.00 sec)\n\nOR REPLACE and IF NOT EXISTS:\n\nCREATE FUNCTION jsoncontains_path RETURNS integer SONAME \'ha_connect.so\';\nERROR 1125 (HY000): Function \'jsoncontains_path\' already exists\n\nCREATE OR REPLACE FUNCTION jsoncontains_path RETURNS integer SONAME\n\'ha_connect.so\';\nQuery OK, 0 rows affected (0.00 sec)\n\nCREATE FUNCTION IF NOT EXISTS jsoncontains_path RETURNS integer SONAME\n\'ha_connect.so\';\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+---------------------------------------------+\n| Level | Code | Message |\n+-------+------+---------------------------------------------+\n| Note | 1125 | Function \'jsoncontains_path\' already exists |\n+-------+------+---------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/create-function-udf/','','https://mariadb.com/kb/en/create-function-udf/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (259,21,'DROP FUNCTION UDF','Syntax\n------\n\nDROP FUNCTION [IF EXISTS] function_name\n\nDescription\n-----------\n\nThis statement drops the user-defined function (UDF) named function_name.\n\nTo drop a function, you must have the DELETE privilege for the mysql database.\nThis is because DROP FUNCTION removes the row from the mysql.func system table\nthat records the function\'s name, type and shared library name.\n\nFor dropping a stored function, see DROP FUNCTION.\n\nUpgrading a UDF\n---------------\n\nTo upgrade the UDF\'s shared library, first run a DROP FUNCTION statement, then\nupgrade the shared library and finally run the CREATE FUNCTION statement. If\nyou upgrade without following this process, you may crash the server.\n\nExamples\n--------\n\nDROP FUNCTION jsoncontains_path;\n\nIF EXISTS:\n\nDROP FUNCTION jsoncontains_path;\nERROR 1305 (42000): FUNCTION test.jsoncontains_path does not exist\n\nDROP FUNCTION IF EXISTS jsoncontains_path;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------------------------------+\n| Level | Code | Message |\n+-------+------+------------------------------------------------+\n| Note | 1305 | FUNCTION test.jsoncontains_path does not exist |\n+-------+------+------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/drop-function-udf/','','https://mariadb.com/kb/en/drop-function-udf/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (260,21,'Creating User-Defined Functions','User-defined functions allow MariaDB to be extended with a new function that\nworks like a native (built-in) MariaDB function such as ABS() or CONCAT().\nThere are alternative ways to add a new function: writing a native function\n(which requires modifying and compiling the server source code), or writing a\nstored function.\n\nStatements making use of user-defined functions are not safe for replication.\n\nFunctions are written in C or C++, and to make use of them, the operating\nsystem must support dynamic loading.\n\nEach new SQL function requires corresponding functions written in C/C++. In\nthe list below, at least the main function - x() - and one other, are\nrequired. x should be replaced by the name of the function you are creating.\n\nAll functions need to be thread-safe, so not global or static variables that\nchange can be allocated. Memory is allocated in x_init()/ and freed in\nx_deinit().\n\nSimple Functions\n----------------\n\nx()\n---\n\nRequired for all UDFs; this is where the results are calculated.\n\n+------------------------------------------+----------------------------------+\n| C/C++ type | SQL type |\n+------------------------------------------+----------------------------------+\n| char * | STRING |\n+------------------------------------------+----------------------------------+\n| long long | INTEGER |\n+------------------------------------------+----------------------------------+\n| double | REAL |\n+------------------------------------------+----------------------------------+\n\nDECIMAL functions return string values, and so should be written accordingly.\nIt is not possible to create ROW functions.\n\nx_init()\n--------\n\nInitialization function for x(). Can be used for the following:\n\n* Check the number of arguments to X() (the SQL equivalent).\n* Verify the argument types, or to force arguments to be of a particular type\nafter the function is called.\n* Specify whether the result can be NULL.\n* Specify the maximum result length.\n* For REAL functions, specify the maximum number of decimals for the result.\n* Allocate any required memory.\n\nx_deinit()\n----------\n\nDe-initialization function for x(). Used to de-allocate memory that was\nallocated in x_init().\n\nDescription\n-----------\n\nEach time the SQL function X() is called:\n\n* MariaDB will first call the C/C++ initialization function, x_init(),\nassuming it exists. All setup will be performed, and if it returns an error,\nthe SQL statement is aborted and no further functions are called.\n* If there is no x_init() function, or it has been called and did not return\nan error, x() is then called once per row.\n* After all rows have finished processing, x_deinit() is called, if present,\nto clean up by de-allocating any memory that was allocated in x_init().\n* See User-defined Functions Calling Sequences for more details on the\nfunctions.\n\nAggregate Functions\n-------------------\n\nThe following functions are required for aggregate functions, such as AVG()\nand SUM(). When using CREATE FUNCTION, the AGGREGATE keyword is required.\n\nx_clear()\n---------\n\nUsed to reset the current aggregate, but without inserting the argument as the\ninitial aggregate value for the new group.\n\nx_add()\n-------\n\nUsed to add the argument to the current aggregate.\n\nx_remove()\n----------\n\nStarting from MariaDB 10.4, improves the support of window functions (so it is\nnot obligatory to add it) and should remove the argument from the current\naggregate.\n\nDescription\n-----------\n\nEach time the aggregate SQL function X() is called:\n\n* MariaDB will first call the C/C++ initialization function, x_init(),\nassuming it exists. All setup will be performed, and if it returns an error,\nthe SQL statement is aborted and no further functions are called.\n* If there is no x_init() function, or it has been called and did not return\nan error, x() is then called once per row.\n* After all rows have finished processing, x_deinit() is called, if present,\nto clean up by de-allocating any memory that was allocated in x_init().\n\n* MariaDB will first call the C/C++ initialization function, x_init(),\nassuming it exists. All setup will be performed, and if it returns an error,\nthe SQL statement is aborted and no further functions are called.\n* The table is sorted according to the GROUP BY expression.\n* x_clear() is called for the first row of each new group.\n* x_add() is called once per row for each row in the same group.\n* x() is called when the group changes, or after the last row, to get the\naggregate result. \n* The latter three steps are repeated until all rows have been processed.\n* After all rows have finished processing, x_deinit() is called, if present,\nto clean up by de-allocating any memory that was allocated in x_init().\n\nExamples\n--------\n\nFor an example, see sql/udf_example.cc in the source tree. For a collection of\nexisting UDFs see https://github.com/mysqludf.\n\n\n\nURL: mariadb.com/kb/en/creating-user-defined-functions/','','https://mariadb.com/kb/en/creating-user-defined-functions/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (261,21,'User-Defined Functions Calling Sequences','The functions described in Creating User-defined Functions are expanded on\nthis page. They are declared as follows:\n\nSimple Functions\n----------------\n\nx()\n---\n\nIf x() returns an integer, it is declared as follows:\n\nlong long x(UDF_INIT *initid, UDF_ARGS *args,\n char *is_null, char *error);\n\nIf x() returns a string (DECIMAL functions also return string values), it is\ndeclared as follows:\n\nchar *x(UDF_INIT *initid, UDF_ARGS *args,\n char *result, unsigned long *length,\n char *is_null, char *error);\n\nIf x() returns a real, it is declared as follows:\n\ndouble x(UDF_INIT *initid, UDF_ARGS *args,\n char *is_null, char *error);\n\nx_init()\n--------\n\nmy_bool x_init(UDF_INIT *initid, UDF_ARGS *args, char *message);\n\nx_deinit()\n----------\n\nvoid x_deinit(UDF_INIT *initid);\n\nDescription\n-----------\n\ninitid is a parameter passed to all three functions that points to a UDF_INIT\nstructure, used for communicating information between the functions. Its\nstructure members are:\n\n* my_bool maybe_null\nmaybe_null should be set to 1 if x_init can return a NULL value, Defaults to 1\nif any arguments are declared maybe_null.\n\n* unsigned int decimals\nNumber of decimals after the decimal point. The default, if an explicit number\nof decimals is passed in the arguments to the main function, is the maximum\nnumber of decimals, so if 9.5, 9.55 and 9.555 are passed to the function, the\ndefault would be three (based on 9.555, the maximum). If there are no\nexplicit number of decimals, the default is set to 31, or one more than the\nmaximum for the DOUBLE, FLOAT and DECIMAL types. This default can be changed\nin the function to suit the actual calculation.\n\n* unsigned int max_length\nMaximum length of the result. For integers, the default is 21. For strings,\nthe length of the longest argument. For reals, the default is 13 plus the\nnumber of decimals indicated by initid->decimals. The length includes any\nsigns or decimal points. Can also be set to 65KB or 16MB in order to return a\nBLOB. The memory remains unallocated, but this is used to decide on the data\ntype to use if the data needs to be temporarily stored.\n\n* char *ptr\nA pointer for use as required by the function. Commonly, initid->ptr is used\nto communicate allocated memory, with x_init() allocating the memory and\nassigning it to this pointer, x() using it, and x_deinit() de-allocating it.\n\n* my_bool const_item\nShould be set to 1 in x_init() if x() always returns the same value, otherwise\n0.\n\nAggregate Functions\n-------------------\n\nx_clear()\n---------\n\nx_clear() is a required function for aggregate functions, and is declared as\nfollows:\n\nvoid x_clear(UDF_INIT *initid, char *is_null, char *error);\n\nIt is called when the summary results need to be reset, that is at the\nbeginning of each new group. but also to reset the values when there were no\nmatching rows.\n\nis_null is set to point to CHAR(0) before calling x_clear().\n\nIn the case of an error, you can store the value to which the error argument\npoints (a single-byte variable, not a string string buffer) in the variable.\n\nx_reset()\n---------\n\nx_reset() is declared as follows:\n\nvoid x_reset(UDF_INIT *initid, UDF_ARGS *args,\n char *is_null, char *error);\n\nIt is called on finding the first row in a new group. Should reset the summary\nvariables, and then use UDF_ARGS as the first value in the group\'s internal\nsummary value. The function is not required if the UDF interface uses\nx_clear().\n\nx_add()\n-------\n\nx_add() is declared as follows:\n\nvoid x_add(UDF_INIT *initid, UDF_ARGS *args,\n char *is_null, char *error);\n\nIt is called for all rows belonging to the same group, and should be used to\nadd the value in UDF_ARGS to the internal summary variable.\n\nx_remove()\n----------\n\nx_remove() was added in MariaDB 10.4 and is declared as follows (same as\nx_add()):\n\nvoid x_remove(UDF_INIT* initid, UDF_ARGS* args,\n char* is_null, char *error );\n\nIt adds more efficient support of aggregate UDFs as window functions.\nx_remove() should "subtract" the row (reverse x_add()). In MariaDB 10.4\naggregate UDFs will work as WINDOW functions without x_remove() but it will\nnot be so efficient.\n\nIf x_remove() supported (defined) detected automatically.\n\n\n\nURL: mariadb.com/kb/en/user-defined-functions-calling-sequences/','','https://mariadb.com/kb/en/user-defined-functions-calling-sequences/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (262,21,'User-Defined Functions Security','The MariaDB server imposes a number of limitations on user-defined\nfunctions for security purposes.\n\n* The INSERT privilege for the mysql database is required to run CREATE\nFUNCTION, as a record will be added to the mysql.func-table.\n* The DELETE privilege for the mysql database is required to run DROP FUNCTION\nas the corresponding record will be removed from the mysql.func-table.\n* UDF object files can only be placed in the plugin directory, as specified by\nthe value of the plugin_dir system variable.\n* At least one symbol, beyond the required x() - corresponding to an SQL\nfunction X()) - is required. These can be x_init(), x_deinit(), xxx_reset(),\nx_clear() and x_add() functions (see Creating User-defined Functions). The\nallow-suspicious-udfs mysqld option (by default unset) provides a workaround,\npermitting only one symbol to be used. This is not recommended, as it opens\nthe possibility of loading shared objects that are not legitimate user-defined\nfunctions.\n\n\n\nURL: mariadb.com/kb/en/user-defined-functions-security/','','https://mariadb.com/kb/en/user-defined-functions-security/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (263,21,'mysql.func Table','The mysql.func table stores information about user-defined functions\n(UDFs) created with the CREATE FUNCTION UDF statement.\n\nMariaDB starting with 10.4\n--------------------------\nIn MariaDB 10.4 and later, this table uses the Aria storage engine.\n\nMariaDB until 10.3\n------------------\nIn MariaDB 10.3 and before, this table uses the MyISAM storage engine.\n\nThe mysql.func table contains the following fields:\n\n+----------+---------+---------+-------+--------------+---------------------+\n| Field | Type | Null | Key | Default | Description |\n+----------+---------+---------+-------+--------------+---------------------+\n| name | char(64 | NO | PRI | | UDF name |\n| | | | | | |\n+----------+---------+---------+-------+--------------+---------------------+\n| ret | tinyint | NO | | 0 | |\n| | 1) | | | | |\n+----------+---------+---------+-------+--------------+---------------------+\n| dl | char(12 | NO | | | Shared library name |\n| | ) | | | | |\n+----------+---------+---------+-------+--------------+---------------------+\n| type | enum(\'f | NO | | NULL | Type, either |\n| | nction\' | | | | function or |\n| | \'aggreg | | | | aggregate. |\n| | te\') | | | | Aggregate |\n| | | | | | functions are |\n| | | | | | summary functions |\n| | | | | | such as SUM() and |\n| | | | | | AVG(). |\n+----------+---------+---------+-------+--------------+---------------------+\n\nExample\n-------\n\nSELECT * FROM mysql.func;\n+------------------------------+-----+--------------+-----------+\n| name | ret | dl | type |\n+------------------------------+-----+--------------+-----------+\n| spider_direct_sql | 2 | ha_spider.so | function |\n| spider_bg_direct_sql | 2 | ha_spider.so | aggregate |\n| spider_ping_table | 2 | ha_spider.so | function |\n| spider_copy_tables | 2 | ha_spider.so | function |\n| spider_flush_table_mon_cache | 2 | ha_spider.so | function |\n+------------------------------+-----+--------------+-----------+\n\n\n\nURL: mariadb.com/kb/en/mysqlfunc-table/','','https://mariadb.com/kb/en/mysqlfunc-table/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (264,22,'AUTO_INCREMENT','Description\n-----------\n\nThe AUTO_INCREMENT attribute can be used to generate a unique identity for new\nrows. When you insert a new record to the table (or upon adding an\nAUTO_INCREMENT attribute with the ALTER TABLE statement), and the\nauto_increment field is NULL or DEFAULT (in the case of an INSERT), the value\nwill automatically be incremented. This also applies to 0, unless the\nNO_AUTO_VALUE_ON_ZERO SQL_MODE is enabled.\n\nAUTO_INCREMENT columns start from 1 by default. The automatically generated\nvalue can never be lower than 0.\n\nEach table can have only one AUTO_INCREMENT column. It must defined as a key\n(not necessarily the PRIMARY KEY or UNIQUE key). In some storage engines\n(including the default InnoDB), if the key consists of multiple columns, the\nAUTO_INCREMENT column must be the first column. Storage engines that permit\nthe column to be placed elsewhere are Aria, MyISAM, MERGE, Spider, TokuDB,\nBLACKHOLE, FederatedX and Federated.\n\nCREATE TABLE animals (\n id MEDIUMINT NOT NULL AUTO_INCREMENT,\n name CHAR(30) NOT NULL,\n PRIMARY KEY (id)\n );\n\nINSERT INTO animals (name) VALUES\n (\'dog\'),(\'cat\'),(\'penguin\'),\n (\'fox\'),(\'whale\'),(\'ostrich\');\n\nSELECT * FROM animals;\n+----+---------+\n| id | name |\n+----+---------+\n| 1 | dog |\n| 2 | cat |\n| 3 | penguin |\n| 4 | fox |\n| 5 | whale |\n| 6 | ostrich |\n+----+---------+\n\nSERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.\n\nCREATE TABLE t (id SERIAL, c CHAR(1)) ENGINE=InnoDB;\n\nSHOW CREATE TABLE t \G\n*************************** 1. row ***************************\n Table: t\nCreate Table: CREATE TABLE `t` (\n `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n `c` char(1) DEFAULT NULL,\n UNIQUE KEY `id` (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nSetting or Changing the Auto_Increment Value\n--------------------------------------------\n\nYou can use an ALTER TABLE statement to assign a new value to the\nauto_increment table option, or set the insert_id server system variable to\nchange the next AUTO_INCREMENT value inserted by the current session.\n\nLAST_INSERT_ID() can be used to see the last AUTO_INCREMENT value inserted by\nthe current session.\n\nALTER TABLE animals AUTO_INCREMENT=8;\n\nINSERT INTO animals (name) VALUES (\'aardvark\');\n\nSELECT * FROM animals;\n+----+-----------+\n| id | name |\n+----+-----------+\n| 1 | dog |\n| 2 | cat |\n| 3 | penguin |\n| 4 | fox |\n| 5 | whale |\n| 6 | ostrich |\n| 8 | aardvark |\n+----+-----------+\n\nSET insert_id=12;\n\nINSERT INTO animals (name) VALUES (\'gorilla\');\n\nSELECT * FROM animals;\n+----+-----------+\n| id | name |\n+----+-----------+\n| 1 | dog |\n| 2 | cat |\n| 3 | penguin |\n| 4 | fox |\n| 5 | whale |\n| 6 | ostrich |\n| 8 | aardvark |\n| 12 | gorilla |\n+----+-----------+\n\nInnoDB\n------\n\nUntil MariaDB 10.2.3, InnoDB used an auto-increment counter that is stored in\nmemory. When the server restarts, the counter is re-initialized to the highest\nvalue used in the table, which cancels the effects of any AUTO_INCREMENT = N\noption in the table statements.\n\nFrom MariaDB 10.2.4, this restriction has been lifted and AUTO_INCREMENT is\npersistent.\n\nSee also AUTO_INCREMENT Handling in InnoDB.\n\nSetting Explicit Values\n-----------------------\n\nIt is possible to specify a value for an AUTO_INCREMENT column. If the key is\nprimary or unique, the value must not already exist in the key.\n\nIf the new value is higher than the current maximum value, the AUTO_INCREMENT\nvalue is updated, so the next value will be higher. If the new value is lower\nthan the current maximum value, the AUTO_INCREMENT value remains unchanged.\n\nThe following example demonstrates these behaviors:\n\nCREATE TABLE t (id INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY) ENGINE =\nInnoDB;\n\nINSERT INTO t VALUES (NULL);\nSELECT id FROM t;\n+----+\n| id |\n+----+\n| 1 |\n+----+\n\nINSERT INTO t VALUES (10); -- higher value\nSELECT id FROM t;\n+----+\n| id |\n+----+\n| 1 |\n| 10 |\n+----+\n\nINSERT INTO t VALUES (2); -- lower value\nINSERT INTO t VALUES (NULL); -- auto value\nSELECT id FROM t;\n+----+\n| id |\n+----+\n| 1 |\n| 2 |\n| 10 |\n| 11 |\n+----+\n\nThe ARCHIVE storage engine does not allow to insert a value that is lower than\nthe current maximum.\n\nMissing Values\n--------------\n\nAn AUTO_INCREMENT column normally has missing values. This happens because if\na row is deleted, or an AUTO_INCREMENT value is explicitly updated, old values\nare never re-used. The REPLACE statement also deletes a row, and its value is\nwasted. With InnoDB, values can be reserved by a transaction; but if the\ntransaction fails (for example, because of a ROLLBACK) the reserved value will\nbe lost.\n\nThus AUTO_INCREMENT values can be used to sort results in a chronological\norder, but not to create a numeric sequence.\n\nReplication\n-----------\n\nTo make master-master or Galera safe to use AUTO_INCREMENT one should use the\nsystem variables auto_increment_increment and auto_increment_offset to\ngenerate unique values for each server.\n\nCHECK Constraints, DEFAULT Values and Virtual Columns\n-----------------------------------------------------\n\nMariaDB starting with 10.2.6\n----------------------------\nFrom MariaDB 10.2.6 auto_increment columns are no longer permitted in CHECK\nconstraints, DEFAULT value expressions and virtual columns. They were\npermitted in earlier versions, but did not work correctly. See MDEV-11117.\n\nGenerating Auto_Increment Values When Adding the Attribute\n----------------------------------------------------------\n\nCREATE OR REPLACE TABLE t1 (a INT);\nINSERT t1 VALUES (0),(0),(0);\nALTER TABLE t1 MODIFY a INT NOT NULL AUTO_INCREMENT PRIMARY KEY;\nSELECT * FROM t1;\n+---+\n| a |\n+---+\n| 1 |\n| 2 |\n| 3 |\n+---+\n\nCREATE OR REPLACE TABLE t1 (a INT);\nINSERT t1 VALUES (5),(0),(8),(0);\nALTER TABLE t1 MODIFY a INT NOT NULL AUTO_INCREMENT PRIMARY KEY;\nSELECT * FROM t1;\n+---+\n| a |\n+---+\n| 5 |\n| 6 |\n| 8 |\n| 9 |\n+---+\n\nIf the NO_AUTO_VALUE_ON_ZERO SQL_MODE is set, zero values will not be\nautomatically incremented:\n\nSET SQL_MODE=\'no_auto_value_on_zero\';\nCREATE OR REPLACE TABLE t1 (a INT);\nINSERT t1 VALUES (3), (0);\nALTER TABLE t1 MODIFY a INT NOT NULL AUTO_INCREMENT PRIMARY KEY;\nSELECT * FROM t1;\n+---+\n| a |\n+---+\n| 0 |\n| 3 |\n+---+\n\n\n\nURL: mariadb.com/kb/en/auto_increment/','','https://mariadb.com/kb/en/auto_increment/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (265,22,'BIGINT','Syntax\n------\n\nBIGINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA large integer. The signed range is -9223372036854775808 to\n9223372036854775807. The unsigned range is 0 to 18446744073709551615.\n\nIf a column has been set to ZEROFILL, all values will be prepended by zeros so\nthat the BIGINT value contains a number of M digits.\n\nNote: If the ZEROFILL attribute has been specified, the column will\nautomatically become UNSIGNED.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nSERIAL is an alias for:\n\nBIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE\n\nINT8 is a synonym for BIGINT.\n\nExamples\n--------\n\nCREATE TABLE bigints (a BIGINT,b BIGINT UNSIGNED,c BIGINT ZEROFILL);\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO bigints VALUES (-10,-10,-10);\nERROR 1264 (22003): Out of range value for column \'b\' at row 1\n\nINSERT INTO bigints VALUES (-10,10,-10);\nERROR 1264 (22003): Out of range value for column \'c\' at row 1\n\nINSERT INTO bigints VALUES (-10,10,10);\n\nINSERT INTO bigints VALUES\n(9223372036854775808,9223372036854775808,9223372036854775808);\nERROR 1264 (22003): Out of range value for column \'a\' at row 1\n\nINSERT INTO bigints VALUES\n(9223372036854775807,9223372036854775808,9223372036854775808);\n\nSELECT * FROM bigints;\n+---------------------+---------------------+----------------------+\n| a | b | c |\n+---------------------+---------------------+----------------------+\n| -10 | 10 | 00000000000000000010 |\n| 9223372036854775807 | 9223372036854775808 | 09223372036854775808 |\n+---------------------+---------------------+----------------------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO bigints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.08 sec)\nWarning (Code 1264): Out of range value for column \'b\' at row 1\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO bigints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.08 sec)\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO bigints VALUES (-10,10,10);\n\nINSERT INTO bigints VALUES\n(9223372036854775808,9223372036854775808,9223372036854775808);\nQuery OK, 1 row affected, 1 warning (0.07 sec)\nWarning (Code 1264): Out of range value for column \'a\' at row 1\n\nINSERT INTO bigints VALUES\n(9223372036854775807,9223372036854775808,9223372036854775808);\n\nSELECT * FROM bigints;\n+---------------------+---------------------+----------------------+\n| a | b | c |\n+---------------------+---------------------+----------------------+\n| -10 | 0 | 00000000000000000000 |\n| -10 | 10 | 00000000000000000000 |\n| -10 | 10 | 00000000000000000010 |\n| 9223372036854775807 | 9223372036854775808 | 09223372036854775808 |\n| 9223372036854775807 | 9223372036854775808 | 09223372036854775808 |\n+---------------------+---------------------+----------------------+\n\n\n\nURL: mariadb.com/kb/en/bigint/','','https://mariadb.com/kb/en/bigint/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (266,22,'BINARY','This page describes the BINARY data type. For details about the\noperator, see Binary Operator.\n\nSyntax\n------\n\nBINARY(M)\n\nDescription\n-----------\n\nThe BINARY type is similar to the CHAR type, but stores binary byte strings\nrather than non-binary character strings. M represents the column length in\nbytes.\n\nIt contains no character set, and comparison and sorting are based on the\nnumeric value of the bytes.\n\nIf the maximum length is exceeded, and SQL strict mode is not enabled , the\nextra characters will be dropped with a warning. If strict mode is enabled, an\nerror will occur.\n\nBINARY values are right-padded with 0x00 (the zero byte) to the specified\nlength when inserted. The padding is not removed on select, so this needs to\nbe taken into account when sorting and comparing, where all bytes are\nsignificant. The zero byte, 0x00 is less than a space for comparison purposes.\n\nExamples\n--------\n\nInserting too many characters, first with strict mode off, then with it on:\n\nCREATE TABLE bins (a BINARY(10));\n\nINSERT INTO bins VALUES(\'12345678901\');\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n\nSELECT * FROM bins;\n+------------+\n| a |\n+------------+\n| 1234567890 |\n+------------+\n\nSET sql_mode=\'STRICT_ALL_TABLES\';\n\nINSERT INTO bins VALUES(\'12345678901\');\nERROR 1406 (22001): Data too long for column \'a\' at row 1\n\nSorting is performed with the byte value:\n\nTRUNCATE bins;\n\nINSERT INTO bins VALUES(\'A\'),(\'B\'),(\'a\'),(\'b\');\n\nSELECT * FROM bins ORDER BY a;\n+------+\n| a |\n+------+\n| A |\n| B |\n| a |\n| b |\n+------+\n\nUsing CAST to sort as a CHAR instead:\n\nSELECT * FROM bins ORDER BY CAST(a AS CHAR);\n+------+\n| a |\n+------+\n| a |\n| A |\n| b |\n| B |\n+------+\n\nThe field is a BINARY(10), so padding of two \'\0\'s are inserted, causing\ncomparisons that don\'t take this into account to fail:\n\nTRUNCATE bins;\n\nINSERT INTO bins VALUES(\'12345678\');\n\nSELECT a = \'12345678\', a = \'12345678\0\0\' from bins;\n+----------------+--------------------+\n| a = \'12345678\' | a = \'12345678\0\0\' |\n+----------------+--------------------+\n| 0 | 1 |\n+----------------+--------------------+\n\n\n\nURL: mariadb.com/kb/en/binary/','','https://mariadb.com/kb/en/binary/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (267,22,'BIT','Syntax\n------\n\nBIT[(M)]\n\nDescription\n-----------\n\nA bit-field type. M indicates the number of bits per value, from 1 to 64. The\ndefault is 1 if M is omitted.\n\nBit values can be inserted with b\'value\' notation, where value is the bit\nvalue in 0\'s and 1\'s.\n\nBit fields are automatically zero-padded from the left to the full length of\nthe bit, so for example in a BIT(4) field, \'10\' is equivalent to \'0010\'.\n\nBits are returned as binary, so to display them, either add 0, or use a\nfunction such as HEX, OCT or BIN to convert them.\n\nExamples\n--------\n\nCREATE TABLE b ( b1 BIT(8) );\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO b VALUES (b\'11111111\');\n\nINSERT INTO b VALUES (b\'01010101\');\n\nINSERT INTO b VALUES (b\'1111111111111\');\nERROR 1406 (22001): Data too long for column \'b1\' at row 1\n\nSELECT b1+0, HEX(b1), OCT(b1), BIN(b1) FROM b;\n+------+---------+---------+----------+\n| b1+0 | HEX(b1) | OCT(b1) | BIN(b1) |\n+------+---------+---------+----------+\n| 255 | FF | 377 | 11111111 |\n| 85 | 55 | 125 | 1010101 |\n+------+---------+---------+----------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO b VALUES (b\'11111111\'),(b\'01010101\'),(b\'1111111111111\');\nQuery OK, 3 rows affected, 1 warning (0.10 sec)\nRecords: 3 Duplicates: 0 Warnings: 1\n\nSHOW WARNINGS;\n+---------+------+---------------------------------------------+\n| Level | Code | Message |\n+---------+------+---------------------------------------------+\n| Warning | 1264 | Out of range value for column \'b1\' at row 3 |\n+---------+------+---------------------------------------------+\n\nSELECT b1+0, HEX(b1), OCT(b1), BIN(b1) FROM b;\n+------+---------+---------+----------+\n| b1+0 | HEX(b1) | OCT(b1) | BIN(b1) |\n+------+---------+---------+----------+\n| 255 | FF | 377 | 11111111 |\n| 85 | 55 | 125 | 1010101 |\n| 255 | FF | 377 | 11111111 |\n+------+---------+---------+----------+\n\n\n\nURL: mariadb.com/kb/en/bit/','','https://mariadb.com/kb/en/bit/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (268,22,'BLOB','Syntax\n------\n\nBLOB[(M)]\n\nDescription\n-----------\n\nA BLOB column with a maximum length of 65,535 (216 - 1) bytes. Each BLOB value\nis stored using a two-byte length prefix that indicates the number of bytes in\nthe value.\n\nAn optional length M can be given for this type. If this is done, MariaDB\ncreates the column as the smallest BLOB type large enough to hold values M\nbytes long.\n\nBLOBS can also be used to store dynamic columns.\n\nBefore MariaDB 10.2.1, BLOB and TEXT columns could not be assigned a DEFAULT\nvalue. This restriction was lifted in MariaDB 10.2.1.\n\nIndexing\n--------\n\nMariaDB starting with 10.4\n--------------------------\nFrom MariaDB 10.4, it is possible to set a unique index on a column that uses\nthe BLOB data type. In previous releases this was not possible, as the index\nwould only guarantee the uniqueness of a fixed number of characters.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, BLOB is a synonym for LONGBLOB.\n\n\n\nURL: mariadb.com/kb/en/blob/','','https://mariadb.com/kb/en/blob/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (269,22,'BLOB and TEXT Data Types','Description\n-----------\n\nA BLOB is a binary large object that can hold a variable amount of data. The\nfour BLOB types are\n\n* TINYBLOB,\n* BLOB, \n* MEDIUMBLOB, and\n* LONGBLOB.\n\nThese differ only in the maximum length of the values they can hold.\n\nThe TEXT types are\n\n* TINYTEXT,\n* TEXT,\n* MEDIUMTEXT, and\n* LONGTEXT.\n* JSON (alias for LONGTEXT)\n\nThese correspond to the four BLOB types and have the same maximum lengths and\nstorage requirements.\n\nMariaDB starting with 10.2.1\n----------------------------\nStarting from MariaDB 10.2.1, BLOB and TEXT columns can have a DEFAULT value.\n\nMariaDB starting with 10.4.3\n----------------------------\nFrom MariaDB 10.4, it is possible to set a unique index on columns that use\nthe BLOB or TEXT data types.\n\n\n\nURL: mariadb.com/kb/en/blob-and-text-data-types/','','https://mariadb.com/kb/en/blob-and-text-data-types/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (270,22,'BOOLEAN','Syntax\n------\n\nBOOL, BOOLEAN\n\nDescription\n-----------\n\nThese types are synonyms for TINYINT(1). A value of zero is considered false.\nNon-zero values are considered true.\n\nHowever, the values TRUE and FALSE are merely aliases for 1 and 0. See Boolean\nLiterals, as well as the IS operator for testing values against a boolean.\n\nExamples\n--------\n\nCREATE TABLE boo (i BOOLEAN);\n\nDESC boo;\n+-------+------------+------+-----+---------+-------+\n| Field | Type | Null | Key | Default | Extra |\n+-------+------------+------+-----+---------+-------+\n| i | tinyint(1) | YES | | NULL | |\n+-------+------------+------+-----+---------+-------+\n\nSELECT IF(0, \'true\', \'false\');\n+------------------------+\n| IF(0, \'true\', \'false\') |\n+------------------------+\n| false |\n+------------------------+\n\nSELECT IF(1, \'true\', \'false\');\n+------------------------+\n| IF(1, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nSELECT IF(2, \'true\', \'false\');\n+------------------------+\n| IF(2, \'true\', \'false\') |\n+------------------------+\n| true |\n+------------------------+\n\nTRUE and FALSE as aliases for 1 and 0:\n\nSELECT IF(0 = FALSE, \'true\', \'false\');\n\n+--------------------------------+\n| IF(0 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| true |\n+--------------------------------+\n\nSELECT IF(1 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(1 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| true |\n+-------------------------------+\n\nSELECT IF(2 = TRUE, \'true\', \'false\');\n+-------------------------------+\n| IF(2 = TRUE, \'true\', \'false\') |\n+-------------------------------+\n| false |\n+-------------------------------+\n\nSELECT IF(2 = FALSE, \'true\', \'false\');\n+--------------------------------+\n| IF(2 = FALSE, \'true\', \'false\') |\n+--------------------------------+\n| false |\n+--------------------------------+\n\nThe last two statements display the results shown because 2 is equal to\nneither 1 nor 0.\n\n\n\nURL: mariadb.com/kb/en/boolean/','','https://mariadb.com/kb/en/boolean/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (271,22,'CHAR','This article covers the CHAR data type. See CHAR Function for the\nfunction.\n\nSyntax\n------\n\n[NATIONAL] CHAR[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA fixed-length string that is always right-padded with spaces to the specified\nlength when stored. M represents the column length in characters. The range of\nM is 0 to 255. If M is omitted, the length is 1.\n\nCHAR(0) columns can contain 2 values: an empty string or NULL. Such columns\ncannot be part of an index. The CONNECT storage engine does not support\nCHAR(0).\n\nNote: Trailing spaces are removed when CHAR values are retrieved unless the\nPAD_CHAR_TO_FULL_LENGTH SQL mode is enabled.\n\nBefore MariaDB 10.2, all collations were of type PADSPACE, meaning that CHAR\n(as well as VARCHAR and TEXT) values are compared without regard for trailing\nspaces. This does not apply to the LIKE pattern-matching operator, which takes\ninto account trailing spaces.\n\nIf a unique index consists of a column where trailing pad characters are\nstripped or ignored, inserts into that column where values differ only by the\nnumber of trailing pad characters will result in a duplicate-key error.\n\nExamples\n--------\n\nTrailing spaces:\n\nCREATE TABLE strtest (c CHAR(10));\nINSERT INTO strtest VALUES(\'Maria \');\n\nSELECT c=\'Maria\',c=\'Maria \' FROM strtest;\n+-----------+--------------+\n| c=\'Maria\' | c=\'Maria \' |\n+-----------+--------------+\n| 1 | 1 |\n+-----------+--------------+\n\nSELECT c LIKE \'Maria\',c LIKE \'Maria \' FROM strtest;\n+----------------+-------------------+\n| c LIKE \'Maria\' | c LIKE \'Maria \' |\n+----------------+-------------------+\n| 1 | 0 |\n+----------------+-------------------+\n\nNO PAD Collations\n-----------------\n\nNO PAD collations regard trailing spaces as normal characters. You can get a\nlist of all NO PAD collations by querying the Information Schema Collations\ntable, for example:\n\nSELECT collation_name FROM information_schema.collations \n WHERE collation_name LIKE "%nopad%";\n+------------------------------+\n| collation_name |\n+------------------------------+\n| big5_chinese_nopad_ci |\n| big5_nopad_bin |\n...\n\n\n\nURL: mariadb.com/kb/en/char/','','https://mariadb.com/kb/en/char/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (272,22,'CHAR BYTE','Description\n-----------\n\nThe CHAR BYTE data type is an alias for the BINARY data type. This is a\ncompatibility feature.\n\n\n\nURL: mariadb.com/kb/en/char-byte/','','https://mariadb.com/kb/en/char-byte/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (273,22,'DATE','Syntax\n------\n\nDATE\n\nDescription\n-----------\n\nA date. The supported range is \'1000-01-01\' to \'9999-12-31\'. MariaDB displays\nDATE values in \'YYYY-MM-DD\' format, but can be assigned dates in looser\nformats, including strings or numbers, as long as they make sense. These\ninclude a short year, YY-MM-DD, no delimiters, YYMMDD, or any other acceptable\ndelimiter, for example YYYY/MM/DD. For details, see date and time literals.\n\n\'0000-00-00\' is a permitted special value (zero-date), unless the NO_ZERO_DATE\nSQL_MODE is used. Also, individual components of a date can be set to 0 (for\nexample: \'2015-00-12\'), unless the NO_ZERO_IN_DATE SQL_MODE is used. In many\ncases, the result of en expression involving a zero-date, or a date with\nzero-parts, is NULL. If the ALLOW_INVALID_DATES SQL_MODE is enabled, if the\nday part is in the range between 1 and 31, the date does not produce any\nerror, even for months that have less than 31 days.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, DATE with a time portion is a synonym for\nDATETIME. See also mariadb_schema.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DATE);\n\nINSERT INTO t1 VALUES ("2010-01-12"), ("2011-2-28"), (\'120314\'),(\'13*04*21\');\n\nSELECT * FROM t1;\n+------------+\n| d |\n+------------+\n| 2010-01-12 |\n| 2011-02-28 |\n| 2012-03-14 |\n| 2013-04-21 |\n+------------+\n\n\n\nURL: mariadb.com/kb/en/date/','','https://mariadb.com/kb/en/date/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (274,22,'DATETIME','Syntax\n------\n\nDATETIME [(microsecond precision)]\n\nDescription\n-----------\n\nA date and time combination.\n\nMariaDB displays DATETIME values in \'YYYY-MM-DD HH:MM:SS.ffffff\' format, but\nallows assignment of values to DATETIME columns using either strings or\nnumbers. For details, see date and time literals.\n\nDATETIME columns also accept CURRENT_TIMESTAMP as the default value.\n\nMariaDB 10.1.2 introduced the --mysql56-temporal-format option, on by default,\nwhich allows MariaDB to store DATETMEs using the same low-level format MySQL\n5.6 uses. For more information, see Internal Format, below.\n\nFor storage requirements, see Data Type Storage Requirements.\n\nSupported Values\n----------------\n\nMariaDB stores values that use the DATETIME data type in a format that\nsupports values between 1000-01-01 00:00:00.000000 and 9999-12-31\n23:59:59.999999.\n\nMariaDB can also store microseconds with a precision between 0 and 6. If no\nmicrosecond precision is specified, then 0 is used by default.\n\nMariaDB also supports \'0000-00-00\' as a special zero-date value, unless\nNO_ZERO_DATE is specified in the SQL_MODE. Similarly, individual components of\na date can be set to 0 (for example: \'2015-00-12\'), unless NO_ZERO_IN_DATE is\nspecified in the SQL_MODE. In many cases, the result of en expression\ninvolving a zero-date, or a date with zero-parts, is NULL. If the\nALLOW_INVALID_DATES SQL_MODE is enabled, if the day part is in the range\nbetween 1 and 31, the date does not produce any error, even for months that\nhave less than 31 days.\n\nTime Zones\n----------\n\nIf a column uses the DATETIME data type, then any inserted values are stored\nas-is, so no automatic time zone conversions are performed.\n\nMariaDB also does not currently support time zone literals that contain time\nzone identifiers. See MDEV-11829 for more information.\n\nMariaDB validates DATETIME literals against the session\'s time zone. For\nexample, if a specific time range never occurred in a specific time zone due\nto daylight savings time, then DATETIME values within that range would be\ninvalid for that time zone.\n\nFor example, daylight savings time started on March 10, 2019 in the US, so the\ntime range between 02:00:00 and 02:59:59 is invalid for that day in US time\nzones:\n\nSET time_zone = \'America/New_York\';\nQuery OK, 0 rows affected (0.000 sec)\n\nINSERT INTO timestamp_test VALUES (\'2019-03-10 02:55:05\');\nERROR 1292 (22007): Incorrect datetime value: \'2019-03-10 02:55:05\' for column\n`db1`.`timestamp_test`.`timestamp_test` at row 1\n\nBut that same time range is fine in other time zones, such as Coordinated\nUniversal Time (UTC). For example:\n\nSET time_zone = \'UTC\';\nQuery OK, 0 rows affected (0.000 sec)\n\nINSERT INTO timestamp_test VALUES (\'2019-03-10 02:55:05\');\nQuery OK, 1 row affected (0.002 sec)\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, DATE with a time portion is a synonym for\nDATETIME. See also mariadb_schema.\n\nInternal Format\n---------------\n\nIn MariaDB 10.1.2 a new temporal format was introduced from MySQL 5.6 that\nalters how the TIME, DATETIME and TIMESTAMP columns operate at lower levels.\nThese changes allow these temporal data types to have fractional parts and\nnegative values. You can disable this feature using the\nmysql56_temporal_format system variable.\n\nTables that include TIMESTAMP values that were created on an older version of\nMariaDB or that were created while the mysql56_temporal_format system variable\nwas disabled continue to store data using the older data type format.\n\nIn order to update table columns from the older format to the newer format,\nexecute an ALTER TABLE... MODIFY COLUMN statement that changes the column to\nthe *same* data type. This change may be needed if you want to export the\ntable\'s tablespace and import it onto a server that has\nmysql56_temporal_format=ON set (see MDEV-15225).\n\nFor instance, if you have a DATETIME column in your table:\n\nSHOW VARIABLES LIKE \'mysql56_temporal_format\';\n\n+-------------------------+-------+\n| Variable_name | Value |\n+-------------------------+-------+\n| mysql56_temporal_format | ON |\n+-------------------------+-------+\n\nALTER TABLE example_table MODIFY ts_col DATETIME;\n\nWhen MariaDB executes the ALTER TABLE statement, it converts the data from the\nolder temporal format to the newer one.\n\nIn the event that you have several tables and columns using temporal data\ntypes that you want to switch over to the new format, make sure the system\nvariable is enabled, then perform a dump and restore using mysqldump. The\ncolumns using relevant temporal data types are restored using the new temporal\nformat.\n\nStarting from MariaDB 10.5.1 columns with old temporal formats are marked with\na /* mariadb-5.3 */ comment in the output of SHOW CREATE TABLE, SHOW COLUMNS,\nDESCRIBE statements, as well as in the COLUMN_TYPE column of the\nINFORMATION_SCHEMA.COLUMNS Table.\n\nSHOW CREATE TABLE mariadb5312_datetime\G\n*************************** 1. row ***************************\n Table: mariadb5312_datetime\nCreate Table: CREATE TABLE `mariadb5312_datetime` (\n `dt0` datetime /* mariadb-5.3 */ DEFAULT NULL,\n `dt6` datetime(6) /* mariadb-5.3 */ DEFAULT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=latin1\n\nExamples\n--------\n\nCREATE TABLE t1 (d DATETIME);\n\nINSERT INTO t1 VALUES ("2011-03-11"), ("2012-04-19 13:08:22"),\n ("2013-07-18 13:44:22.123456");\n\nSELECT * FROM t1;\n+---------------------+\n| d |\n+---------------------+\n| 2011-03-11 00:00:00 |\n| 2012-04-19 13:08:22 |\n| 2013-07-18 13:44:22 |\n+---------------------+\n\nCREATE TABLE t2 (d DATETIME(6));\n\nINSERT INTO t2 VALUES ("2011-03-11"), ("2012-04-19 13:08:22"),\n ("2013-07-18 13:44:22.123456");\n\nSELECT * FROM t2;\n+----------------------------+\n| d |\n+----------------------------+\n| 2011-03-11 00:00:00.000000 |\n| 2012-04-19 13:08:22.000000 |\n| 2013-07-18 13:44:22.123456 |\n+----------------------------++\n\nStrings used in datetime context are automatically converted to datetime(6).\nIf you want to have a datetime without seconds, you should use\nCONVERT(..,datetime).\n\nSELECT CONVERT(\'2007-11-30 10:30:19\',datetime);\n+-----------------------------------------+\n| CONVERT(\'2007-11-30 10:30:19\',datetime) |\n+-----------------------------------------+\n| 2007-11-30 10:30:19 |\n+-----------------------------------------+\n\nSELECT CONVERT(\'2007-11-30 10:30:19\',datetime(6));\n+--------------------------------------------+\n| CONVERT(\'2007-11-30 10:30:19\',datetime(6)) |\n+--------------------------------------------+\n| 2007-11-30 10:30:19.000000 |\n+--------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/datetime/','','https://mariadb.com/kb/en/datetime/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (275,22,'DECIMAL','Syntax\n------\n\nDECIMAL[(M[,D])] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA packed "exact" fixed-point number. M is the total number of digits (the\nprecision) and D is the number of digits after the decimal point (the scale).\n\n* The decimal point and (for negative numbers) the "-" sign are not\ncounted in M. \n* If D is 0, values have no decimal point or fractional\npart and on INSERT the value will be rounded to the nearest DECIMAL. \n* The maximum number of digits (M) for DECIMAL is 65. \n* The maximum number of supported decimals (D) is 30 before MariadB 10.2.1 and\n38 afterwards. \n* If D is omitted, the default is 0. If M is omitted, the default is 10.\n\nUNSIGNED, if specified, disallows negative values.\n\nZEROFILL, if specified, pads the number with zeros, up to the total number of\ndigits specified by M.\n\nAll basic calculations (+, -, *, /) with DECIMAL columns are done with a\nprecision of 65 digits.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nDEC, NUMERIC and FIXED are synonyms, as well as NUMBER in Oracle mode from\nMariaDB 10.3.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DECIMAL UNSIGNED ZEROFILL);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4.0),(5.2),(5.7);\nQuery OK, 6 rows affected, 2 warnings (0.16 sec)\nRecords: 6 Duplicates: 0 Warnings: 2\n\nNote (Code 1265): Data truncated for column \'d\' at row 5\nNote (Code 1265): Data truncated for column \'d\' at row 6\n\nSELECT * FROM t1;\n+------------+\n| d |\n+------------+\n| 0000000001 |\n| 0000000002 |\n| 0000000003 |\n| 0000000004 |\n| 0000000005 |\n| 0000000006 |\n+------------+\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO t1 VALUES (-7);\nERROR 1264 (22003): Out of range value for column \'d\' at row 1\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO t1 VALUES (-7);\nQuery OK, 1 row affected, 1 warning (0.02 sec)\nWarning (Code 1264): Out of range value for column \'d\' at row 1\n\nSELECT * FROM t1;\n+------------+\n| d |\n+------------+\n| 0000000001 |\n| 0000000002 |\n| 0000000003 |\n| 0000000004 |\n| 0000000005 |\n| 0000000006 |\n| 0000000000 |\n+------------+\n\n\n\nURL: mariadb.com/kb/en/decimal/','','https://mariadb.com/kb/en/decimal/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (276,22,'ENUM','Syntax\n------\n\nENUM(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nDescription\n-----------\n\nAn enumeration. A string object that can have only one value, chosen from the\nlist of values \'value1\', \'value2\', ..., NULL or the special \'\' error value. In\ntheory, an ENUM column can have a maximum of 65,535 distinct values; in\npractice, the real maximum depends on many factors. ENUM values are\nrepresented internally as integers.\n\nTrailing spaces are automatically stripped from ENUM values on table creation.\n\nENUMs require relatively little storage space compared to strings, either one\nor two bytes depending on the number of enumeration values.\n\nNULL and empty values\n---------------------\n\nAn ENUM can also contain NULL and empty values. If the ENUM column is declared\nto permit NULL values, NULL becomes a valid value, as well as the default\nvalue (see below). If strict SQL Mode is not enabled, and an invalid value is\ninserted into an ENUM, a special empty string, with an index value of zero\n(see Numeric index, below), is inserted, with a warning. This may be\nconfusing, because the empty string is also a possible value, and the only\ndifference if that is this case its index is not 0. Inserting will fail with\nan error if strict mode is active.\n\nIf a DEFAULT clause is missing, the default value will be:\n\n* NULL if the column is nullable;\n* otherwise, the first value in the enumeration.\n\nNumeric index\n-------------\n\nENUM values are indexed numerically in the order they are defined, and sorting\nwill be performed in this numeric order. We suggest not using ENUM to store\nnumerals, as there is little to no storage space benefit, and it is easy to\nconfuse the enum integer with the enum numeral value by leaving out the quotes.\n\nAn ENUM defined as ENUM(\'apple\',\'orange\',\'pear\') would have the following\nindex values:\n\n+--------------------------------------+--------------------------------------+\n| Index | Value |\n+--------------------------------------+--------------------------------------+\n| NULL | NULL |\n+--------------------------------------+--------------------------------------+\n| 0 | \'\' |\n+--------------------------------------+--------------------------------------+\n| 1 | \'apple\' |\n+--------------------------------------+--------------------------------------+\n| 2 | \'orange\' |\n+--------------------------------------+--------------------------------------+\n| 3 | \'pear\' |\n+--------------------------------------+--------------------------------------+\n\nExamples\n--------\n\nCREATE TABLE fruits (\n id INT NOT NULL auto_increment PRIMARY KEY,\n fruit ENUM(\'apple\',\'orange\',\'pear\'),\n bushels INT);\n\nDESCRIBE fruits;\n+---------+-------------------------------+------+-----+---------+-------------\n--+\n| Field | Type | Null | Key | Default | Extra \n |\n+---------+-------------------------------+------+-----+---------+-------------\n--+\n| id | int(11) | NO | PRI | NULL |\nauto_increment |\n| fruit | enum(\'apple\',\'orange\',\'pear\') | YES | | NULL | \n |\n| bushels | int(11) | YES | | NULL | \n |\n+---------+-------------------------------+------+-----+---------+-------------\n--+\n\nINSERT INTO fruits\n (fruit,bushels) VALUES\n (\'pear\',20),\n (\'apple\',100),\n (\'orange\',25);\n\nINSERT INTO fruits\n (fruit,bushels) VALUES\n (\'avocado\',10);\nERROR 1265 (01000): Data truncated for column \'fruit\' at row 1\n\nSELECT * FROM fruits;\n+----+--------+---------+\n| id | fruit | bushels |\n+----+--------+---------+\n| 1 | pear | 20 |\n| 2 | apple | 100 |\n| 3 | orange | 25 |\n+----+--------+---------+\n\nSelecting by numeric index:\n\nSELECT * FROM fruits WHERE fruit=2;\n+----+--------+---------+\n| id | fruit | bushels |\n+----+--------+---------+\n| 3 | orange | 25 |\n+----+--------+---------+\n\nSorting is according to the index value:\n\nCREATE TABLE enums (a ENUM(\'2\',\'1\'));\n\nINSERT INTO enums VALUES (\'1\'),(\'2\');\n\nSELECT * FROM enums ORDER BY a ASC;\n+------+\n| a |\n+------+\n| 2 |\n| 1 |\n+------+\n\nIt\'s easy to get confused between returning the enum integer with the stored\nvalue, so we don\'t suggest using ENUM to store numerals. The first example\nreturns the 1st indexed field (\'2\' has an index value of 1, as it\'s defined\nfirst), while the second example returns the string value \'1\'.\n\nSELECT * FROM enums WHERE a=1;\n+------+\n| a |\n+------+\n| 2 |\n+------+\n\nSELECT * FROM enums WHERE a=\'1\';\n+------+\n| a |\n+------+\n| 1 |\n+------+\n\n\n\nURL: mariadb.com/kb/en/enum/','','https://mariadb.com/kb/en/enum/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (277,22,'DOUBLE','Syntax\n------\n\nDOUBLE[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\nDOUBLE PRECISION[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\nREAL[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA normal-size (double-precision) floating-point number (see FLOAT for a\nsingle-precision floating-point number).\n\nAllowable values are:\n\n* -1.7976931348623157E+308 to -2.2250738585072014E-308\n* 0\n* 2.2250738585072014E-308 to 1.7976931348623157E+308\n\nThese are the theoretical limits, based on the IEEE standard. The actual range\nmight be slightly smaller depending on your hardware or operating system.\n\nM is the total number of digits and D is the number of digits following the\ndecimal point. If M and D are omitted, values are stored to the limits allowed\nby the hardware. A double-precision floating-point number is accurate to\napproximately 15 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nZEROFILL, if specified, pads the number with zeros, up to the total number of\ndigits specified by M.\n\nREAL and DOUBLE PRECISION are synonyms, unless the REAL_AS_FLOAT SQL mode is\nenabled, in which case REAL is a synonym for FLOAT rather than DOUBLE.\n\nSee Floating Point Accuracy for issues when using floating-point numbers.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DOUBLE(5,0) zerofill);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4);\n\nSELECT * FROM t1;\n+-------+\n| d |\n+-------+\n| 00001 |\n| 00002 |\n| 00003 |\n| 00004 |\n+-------+\n\n\n\nURL: mariadb.com/kb/en/double/','','https://mariadb.com/kb/en/double/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (278,22,'FLOAT','Syntax\n------\n\nFLOAT[(M,D)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA small (single-precision) floating-point number (see DOUBLE for a\nregular-size floating point number). Allowable values are:\n\n* -3.402823466E+38 to -1.175494351E-38\n* 0\n* 1.175494351E-38 to 3.402823466E+38.\n\nThese are the theoretical limits, based on the IEEE standard. The actual range\nmight be slightly smaller depending on your hardware or operating system.\n\nM is the total number of digits and D is the number of digits following the\ndecimal point. If M and D are omitted, values are stored to the limits allowed\nby the hardware. A single-precision floating-point number is accurate to\napproximately 7 decimal places.\n\nUNSIGNED, if specified, disallows negative values.\n\nUsing FLOAT might give you some unexpected problems because all calculations\nin MariaDB are done with double precision. See Floating Point Accuracy.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\n\n\nURL: mariadb.com/kb/en/float/','','https://mariadb.com/kb/en/float/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (279,22,'Geometry Types','Description\n-----------\n\nMariaDB provides a standard way of creating spatial columns for geometry\ntypes, for example, with CREATE TABLE or ALTER TABLE. Currently, spatial\ncolumns are supported for MyISAM, InnoDB, NDB, and ARCHIVE tables. See also\nSPATIAL INDEX.\n\nThe basic geometry type is GEOMETRY. But the type can be more specific. The\nfollowing types are supported:\n\n+------------------------------------------------------------------------------\n\n| Geometry Types \n|\n+------------------------------------------------------------------------------\n\n| POINT \n|\n+------------------------------------------------------------------------------\n\n| LINESTRING \n|\n+------------------------------------------------------------------------------\n\n| POLYGON \n|\n+------------------------------------------------------------------------------\n\n| MULTIPOINT \n|\n+------------------------------------------------------------------------------\n\n| MULTILINESTRING \n|\n+------------------------------------------------------------------------------\n\n| MULTIPOLYGON \n|\n+------------------------------------------------------------------------------\n\n| GEOMETRYCOLLECTION \n|\n+------------------------------------------------------------------------------\n\n| GEOMETRY \n|\n+------------------------------------------------------------------------------\n\nExamples\n--------\n\nNote: For clarity, only one type is listed per table in the examples below,\nbut a table row can contain multiple types. For example:\n\nCREATE TABLE object (shapeA POLYGON, shapeB LINESTRING);\n\nPOINT\n-----\n\nCREATE TABLE gis_point (g POINT);\nSHOW FIELDS FROM gis_point;\nINSERT INTO gis_point VALUES\n (PointFromText(\'POINT(10 10)\')),\n (PointFromText(\'POINT(20 10)\')),\n (PointFromText(\'POINT(20 20)\')),\n (PointFromWKB(AsWKB(PointFromText(\'POINT(10 20)\'))));\n\nLINESTRING\n----------\n\nCREATE TABLE gis_line (g LINESTRING);\nSHOW FIELDS FROM gis_line;\nINSERT INTO gis_line VALUES\n (LineFromText(\'LINESTRING(0 0,0 10,10 0)\')),\n (LineStringFromText(\'LINESTRING(10 10,20 10,20 20,10 20,10 10)\')),\n (LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));\n\nPOLYGON\n-------\n\nCREATE TABLE gis_polygon (g POLYGON);\nSHOW FIELDS FROM gis_polygon;\nINSERT INTO gis_polygon VALUES\n (PolygonFromText(\'POLYGON((10 10,20 10,20 20,10 20,10 10))\')),\n (PolyFromText(\'POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10\n20,10 10))\')),\n (PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30,\n30), Point(0, 0))))));\n\nMULTIPOINT\n----------\n\nCREATE TABLE gis_multi_point (g MULTIPOINT);\nSHOW FIELDS FROM gis_multi_point;\nINSERT INTO gis_multi_point VALUES\n (MultiPointFromText(\'MULTIPOINT(0 0,10 10,10 20,20 20)\')),\n (MPointFromText(\'MULTIPOINT(1 1,11 11,11 21,21 21)\')),\n (MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10)))));\n\nMULTILINESTRING\n---------------\n\nCREATE TABLE gis_multi_line (g MULTILINESTRING);\nSHOW FIELDS FROM gis_multi_line;\nINSERT INTO gis_multi_line VALUES\n (MultiLineStringFromText(\'MULTILINESTRING((10 48,10 21,10 0),(16 0,16\n23,16 48))\')),\n (MLineFromText(\'MULTILINESTRING((10 48,10 21,10 0))\')),\n (MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)),\nLineString(Point(2, 5), Point(5, 8), Point(21, 7))))));\n\nMULTIPOLYGON\n------------\n\nCREATE TABLE gis_multi_polygon (g MULTIPOLYGON);\nSHOW FIELDS FROM gis_multi_polygon;\nINSERT INTO gis_multi_polygon VALUES\n (MultiPolygonFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52\n18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))\')),\n (MPolyFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66\n23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))\')),\n (MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3,\n3), Point(3, 0), Point(0, 3)))))));\n\nGEOMETRYCOLLECTION\n------------------\n\nCREATE TABLE gis_geometrycollection (g GEOMETRYCOLLECTION);\nSHOW FIELDS FROM gis_geometrycollection;\nINSERT INTO gis_geometrycollection VALUES\n (GeomCollFromText(\'GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10\n10))\')),\n (GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6),\nLineString(Point(3, 6), Point(7, 9)))))),\n (GeomFromText(\'GeometryCollection()\')),\n (GeomFromText(\'GeometryCollection EMPTY\'));\n\nGEOMETRY\n--------\n\nCREATE TABLE gis_geometry (g GEOMETRY);\nSHOW FIELDS FROM gis_geometry;\nINSERT into gis_geometry SELECT * FROM gis_point;\nINSERT into gis_geometry SELECT * FROM gis_line;\nINSERT into gis_geometry SELECT * FROM gis_polygon;\nINSERT into gis_geometry SELECT * FROM gis_multi_point;\nINSERT into gis_geometry SELECT * FROM gis_multi_line;\nINSERT into gis_geometry SELECT * FROM gis_multi_polygon;\nINSERT into gis_geometry SELECT * FROM gis_geometrycollection;\n\n\n\nURL: mariadb.com/kb/en/geometry-types/','','https://mariadb.com/kb/en/geometry-types/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (280,22,'JSON Data Type','MariaDB starting with 10.2.7\n----------------------------\nThe JSON alias was added in MariaDB 10.2.7. This was done to make it possible\nto use JSON columns in statement based replication from MySQL to MariaDB and\nto make it possible for MariaDB to read mysqldumps from MySQL.\n\nJSON is an alias for LONGTEXT introduced for compatibility reasons with\nMySQL\'s JSON data type. MariaDB implements this as a LONGTEXT rather, as the\nJSON data type contradicts the SQL standard, and MariaDB\'s benchmarks indicate\nthat performance is at least equivalent.\n\nIn order to ensure that a a valid json document is inserted, the JSON_VALID\nfunction can be used as a CHECK constraint. This constraint is automatically\nincluded for types using the JSON alias from MariaDB 10.4.3.\n\nExamples\n--------\n\nCREATE TABLE t (j JSON);\n\nDESC t;\n+-------+----------+------+-----+---------+-------+\n| Field | Type | Null | Key | Default | Extra |\n+-------+----------+------+-----+---------+-------+\n| j | longtext | YES | | NULL | |\n+-------+----------+------+-----+---------+-------+\n\nWith validation:\n\nCREATE TABLE t2 (\n j JSON\n CHECK (JSON_VALID(j))\n);\n\nINSERT INTO t2 VALUES (\'invalid\');\nERROR 4025 (23000): CONSTRAINT `j` failed for `test`.`t2`\n\nINSERT INTO t2 VALUES (\'{"id": 1, "name": "Monty"}\');\nQuery OK, 1 row affected (0.13 sec)\n\nReplicating JSON Data Between MySQL and MariaDB\n-----------------------------------------------\n\nThe JSON type in MySQL stores the JSON object in a compact form, not as\nLONGTEXT as in MariaDB. This means that row based replication will not work\nfor JSON types from MySQL to MariaDB.\n\nThere are a a few different ways to solve this:\n\n* Use statement based replication.\n* Change the JSON column to type TEXT in MySQL\n* If you must use row-based replication and cannot change the MySQL master\nfrom JSON to TEXT, you can try to introduce an intermediate MySQL slave and\nchange the column type from JSON to TEXT on it. Then you replicate from this\nintermediate slave to MariaDB.\n\nConverting a MySQL TABLE with JSON Fields to MariaDB\n----------------------------------------------------\n\nMariaDB can\'t directly access MySQL\'s JSON format.\n\nThere are a a few different ways to move the table to MariaDB:\n\n* From MariaDB 10.5.7, see the you can use the mysql_json plugin. See Making\nMariaDB understand MySQL JSON.\n* Change the JSON column to type TEXT in MySQL. After this, MariaDB can\ndirectly use the table without any need for a dump and restore.\n* Use mariadb-dump/mysqldump to copy the table.\n\nDifferences Between MySQL JSON Strings and MariaDB JSON Strings\n---------------------------------------------------------------\n\n* In MySQL, JSON is an object and is compared according to json values. In\nMariaDB JSON strings are normal strings and compared as strings. One exception\nis when using JSON_EXTRACT() in which case strings are unescaped before\ncomparison.\n\n\n\nURL: mariadb.com/kb/en/json-data-type/','','https://mariadb.com/kb/en/json-data-type/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (281,22,'LONGBLOB','Syntax\n------\n\nLONGBLOB\n\nDescription\n-----------\n\nA BLOB column with a maximum length of 4,294,967,295 bytes or 4GB (232 - 1).\nThe effective maximum length of LONGBLOB columns depends on the configured\nmaximum packet size in the client/server protocol and available memory. Each\nLONGBLOB value is stored using a four-byte length prefix that indicates the\nnumber of bytes in the value.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, BLOB is a synonym for LONGBLOB.\n\n\n\nURL: mariadb.com/kb/en/longblob/','','https://mariadb.com/kb/en/longblob/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (282,22,'LONGTEXT','Syntax\n------\n\nLONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA TEXT column with a maximum length of 4,294,967,295 or 4GB (232 - 1)\ncharacters. The effective maximum length is less if the value contains\nmulti-byte characters. The effective maximum length of LONGTEXT columns also\ndepends on the configured maximum packet size in the client/server protocol\nand available memory. Each LONGTEXT value is stored using a four-byte length\nprefix that indicates the number of bytes in the value.\n\nFrom MariaDB 10.2.7, JSON is an alias for LONGTEXT. See JSON Data Type for\ndetails.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, CLOB is a synonym for LONGTEXT.\n\n\n\nURL: mariadb.com/kb/en/longtext/','','https://mariadb.com/kb/en/longtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (283,22,'MEDIUMBLOB','Syntax\n------\n\nMEDIUMBLOB\n\nDescription\n-----------\n\nA BLOB column with a maximum length of 16,777,215 (224 - 1) bytes. Each\nMEDIUMBLOB value is stored using a three-byte length prefix that indicates the\nnumber of bytes in the value.\n\n\n\nURL: mariadb.com/kb/en/mediumblob/','','https://mariadb.com/kb/en/mediumblob/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (284,22,'MEDIUMINT','Syntax\n------\n\nMEDIUMINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA medium-sized integer. The signed range is -8388608 to 8388607. The unsigned\nrange is 0 to 16777215.\n\nZEROFILL pads the integer with zeroes and assumes UNSIGNED (even if UNSIGNED\nis not specified).\n\nINT3 is a synonym for MEDIUMINT.\n\nFor details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE mediumints (a MEDIUMINT,b MEDIUMINT UNSIGNED,c MEDIUMINT\nZEROFILL);\n\nDESCRIBE mediumints;\n+-------+--------------------------------+------+-----+---------+-------+\n| Field | Type | Null | Key | Default | Extra |\n+-------+--------------------------------+------+-----+---------+-------+\n| a | mediumint(9) | YES | | NULL | |\n| b | mediumint(8) unsigned | YES | | NULL | |\n| c | mediumint(8) unsigned zerofill | YES | | NULL | |\n+-------+--------------------------------+------+-----+---------+-------+\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO mediumints VALUES (-10,-10,-10);\nERROR 1264 (22003): Out of range value for column \'b\' at row 1\n\nINSERT INTO mediumints VALUES (-10,10,-10);\nERROR 1264 (22003): Out of range value for column \'c\' at row 1\n\nINSERT INTO mediumints VALUES (-10,10,10);\n\nINSERT INTO mediumints VALUES (8388608,8388608,8388608);\nERROR 1264 (22003): Out of range value for column \'a\' at row 1\n\nINSERT INTO mediumints VALUES (8388607,8388608,8388608);\n\nSELECT * FROM mediumints;\n+---------+---------+----------+\n| a | b | c |\n+---------+---------+----------+\n| -10 | 10 | 00000010 |\n| 8388607 | 8388608 | 08388608 |\n+---------+---------+----------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO mediumints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.05 sec)\nWarning (Code 1264): Out of range value for column \'b\' at row 1\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO mediumints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.08 sec)\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO mediumints VALUES (-10,10,10);\n\nINSERT INTO mediumints VALUES (8388608,8388608,8388608);\nQuery OK, 1 row affected, 1 warning (0.05 sec)\nWarning (Code 1264): Out of range value for column \'a\' at row 1\n\nINSERT INTO mediumints VALUES (8388607,8388608,8388608);\n\nSELECT * FROM mediumints;\n+---------+---------+----------+\n| a | b | c |\n+---------+---------+----------+\n| -10 | 0 | 00000000 |\n| -10 | 0 | 00000000 |\n| -10 | 10 | 00000000 |\n| -10 | 10 | 00000010 |\n| 8388607 | 8388608 | 08388608 |\n| 8388607 | 8388608 | 08388608 |\n+---------+---------+----------+\n\n\n\nURL: mariadb.com/kb/en/mediumint/','','https://mariadb.com/kb/en/mediumint/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (285,22,'MEDIUMTEXT','Syntax\n------\n\nMEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA TEXT column with a maximum length of 16,777,215 (224 - 1) characters. The\neffective maximum length is less if the value contains multi-byte characters.\nEach MEDIUMTEXT value is stored using a three-byte length prefix that\nindicates the number of bytes in the value.\n\n\n\nURL: mariadb.com/kb/en/mediumtext/','','https://mariadb.com/kb/en/mediumtext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (286,22,'Numeric Data Type Overview','There are a number of numeric data types:\n\n* TINYINT\n* BOOLEAN - Synonym for TINYINT(1)\n* INT1 - Synonym for TINYINT\n* SMALLINT\n* INT2 - Synonym for SMALLINT\n* MEDIUMINT\n* INT3 - Synonym for MEDIUMINT\n* INT, INTEGER\n* INT4 - Synonym for INT\n* BIGINT\n* INT8 - Synonym for BIGINT\n* DECIMAL, DEC, NUMERIC, FIXED\n* FLOAT\n* DOUBLE, DOUBLE PRECISION, REAL\n* BIT\n\nSee the specific articles for detailed information on each.\n\nSIGNED, UNSIGNED and ZEROFILL\n-----------------------------\n\nMost numeric types can be defined as SIGNED, UNSIGNED or ZEROFILL, for example:\n\nTINYINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nIf SIGNED, or no attribute, is specified, a portion of the numeric type will\nbe reserved for the sign (plus or minus). For example, a TINYINT SIGNED can\nrange from -128 to 127.\n\nIf UNSIGNED is specified, no portion of the numeric type is reserved for the\nsign, so for integer types range can be larger. For example, a TINYINT\nUNSIGNED can range from 0 to 255. Floating point and fixed-point types also\ncan be UNSIGNED, but this only prevents negative values from being stored and\ndoesn\'t alter the range.\n\nIf ZEROFILL is specified, the column will be set to UNSIGNED and the spaces\nused by default to pad the field are replaced with zeros. ZEROFILL is ignored\nin expressions or as part of a UNION. ZEROFILL is a non-standard MySQL and\nMariaDB enhancement.\n\nNote that although the preferred syntax indicates that the attributes are\nexclusive, more than one attribute can be specified.\n\nUntil MariaDB 10.2.7 (MDEV-8659), any combination of the attributes could be\nused in any order, with duplicates. In this case:\n\n* the presence of ZEROFILL makes the column UNSIGNED ZEROFILL.\n* the presence of UNSIGNED makes the column UNSIGNED.\n\nFrom MariaDB 10.2.8, only the following combinations are supported:\n\n* SIGNED\n* UNSIGNED\n* ZEROFILL\n* UNSIGNED ZEROFILL\n* ZEROFILL UNSIGNED\n\nThe latter two should be replaced with simply ZEROFILL, but are still accepted\nby the parser.\n\nExamples\n--------\n\nCREATE TABLE zf (\n i1 TINYINT SIGNED,\n i2 TINYINT UNSIGNED,\n i3 TINYINT ZEROFILL\n);\n\nINSERT INTO zf VALUES (2,2,2);\n\nSELECT * FROM zf;\n+------+------+------+\n| i1 | i2 | i3 |\n+------+------+------+\n| 2 | 2 | 002 |\n+------+------+------+\n\nRange\n-----\n\nWhen attempting to add a value that is out of the valid range for the numeric\ntype, MariaDB will react depending on the strict SQL_MODE setting.\n\nIf strict_mode has been set (the default from MariaDB 10.2.4), MariaDB will\nreturn an error.\n\nIf strict_mode has not been set (the default until MariaDB 10.2.3), MariaDB\nwill adjust the number to fit in the field, returning a warning.\n\nExamples\n--------\n\nWith strict_mode set:\n\nSHOW VARIABLES LIKE \'sql_mode\';\n+---------------+--------------------------------------------------------------\n----------------------------+\n| Variable_name | Value \n |\n+---------------+--------------------------------------------------------------\n----------------------------+\n| sql_mode |\nSTRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SU\nSTITUTION |\n+---------------+--------------------------------------------------------------\n----------------------------+\n\nCREATE TABLE ranges (i1 TINYINT, i2 SMALLINT, i3 TINYINT UNSIGNED);\n\nINSERT INTO ranges VALUES (257,257,257);\nERROR 1264 (22003): Out of range value for column \'i1\' at row 1\n\nSELECT * FROM ranges;\nEmpty set (0.10 sec)\n\nWith strict_mode unset:\n\nSHOW VARIABLES LIKE \'sql_mode%\';\n+---------------+-------+\n| Variable_name | Value |\n+---------------+-------+\n| sql_mode | |\n+---------------+-------+\n\nCREATE TABLE ranges (i1 TINYINT, i2 SMALLINT, i3 TINYINT UNSIGNED);\n\nINSERT INTO ranges VALUES (257,257,257);\nQuery OK, 1 row affected, 2 warnings (0.00 sec)\n\nSHOW WARNINGS;\n+---------+------+---------------------------------------------+\n| Level | Code | Message |\n+---------+------+---------------------------------------------+\n| Warning | 1264 | Out of range value for column \'i1\' at row 1 |\n| Warning | 1264 | Out of range value for column \'i3\' at row 1 |\n+---------+------+---------------------------------------------+\n2 rows in set (0.00 sec)\n\nSELECT * FROM ranges;\n+------+------+------+\n| i1 | i2 | i3 |\n+------+------+------+\n| 127 | 257 | 255 |\n+------+------+------+\n\nAuto_increment\n--------------\n\nThe AUTO_INCREMENT attribute can be used to generate a unique identity for new\nrows. For more details, see auto_increment.\n\n\n\nURL: mariadb.com/kb/en/numeric-data-type-overview/','','https://mariadb.com/kb/en/numeric-data-type-overview/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (287,22,'ROW','MariaDB starting with 10.3.0\n----------------------------\nThe ROW data type was introduced in MariaDB 10.3.0.\n\nSyntax\n------\n\nROW (<field name> <data type> [{, <field name> <data type>}... ])\n\nDescription\n-----------\n\nROW is a data type for stored procedure variables.\n\nFeatures\n--------\n\nROW fields as normal variables\n------------------------------\n\nROW fields (members) act as normal variables, and are able to appear in all\nquery parts where a stored procedure variable is allowed:\n\n* Assignment is using the := operator and the SET command:\n\na.x:= 10;\na.x:= b.x;\nSET a.x= 10, a.y=20, a.z= b.z;\n\n* Passing to functions and operators:\n\nSELECT f1(rec.a), rec.a<10;\n\n* Clauses (select list, WHERE, HAVING, LIMIT, etc...,):\n\nSELECT var.a, t1.b FROM t1 WHERE t1.b=var.b LIMIT var.c;\n\n* INSERT values:\n\nINSERT INTO t1 VALUES (rec.a, rec.b, rec.c);\n\n* SELECT .. INTO targets\n\nSELECT a,b INTO rec.a, rec.b FROM t1 WHERE t1.id=10;\n\n* Dynamic SQL out parameters (EXECUTE and EXECUTE IMMEDIATE)\n\nEXECUTE IMMEDIATE \'CALL proc_with_out_param(?)\' USING rec.a;\n\nROW type variables as FETCH targets\n-----------------------------------\n\nROW type variables are allowed as FETCH targets:\n\nFETCH cur INTO rec;\n\nwhere cur is a CURSOR and rec is a ROW type stored procedure variable.\n\nNote, currently an attempt to use FETCH for a ROW type variable returns this\nerror:\n\nERROR 1328 (HY000): Incorrect number of FETCH variables\n\nFETCH from a cursor cur into a ROW variable rec works as follows:\n\n* The number of fields in cur must match the number of fields in rec.\n Otherwise, an error is reported.\n\n* Assignment is done from left to right. The first cursor field is assigned to\n the first variable field, the second cursor field is assigned to the second\n variable field, etc.\n\n* Field names in rec are not important and can differ from field names\n in cur.\n\nSee FETCH Examples (below) for examples of using this with sql_mode=ORACLE and\nsql_mode=DEFAULT.\n\nROW type variables as SELECT...INTO targets\n-------------------------------------------\n\nROW type variables are allowed as SELECT..INTO targets with some differences\ndepending on which sql_mode is in use.\n\n* When using sql_mode=ORACLE, table%ROWTYPE and cursor%ROWTYPE\n variables can be used as SELECT...INTO targets.\n\n* Using multiple ROW variables in the SELECT..INTO list will report an\n error.\n\n* Using ROW variables with a different column count than in\n the SELECT..INTO list will report an error.\n\nSee SELECT...INTO Examples (below) for examples of using this with\nsql_mode=ORACLE and sql_mode=DEFAULT.\n\nFeatures not implemented\n------------------------\n\nThe following features are planned, but not implemented yet:\n\n* Returning a ROW type expression from a stored function (see MDEV-12252).\nThis will need some grammar change to support field names after parentheses:\n\nSELECT f1().x FROM DUAL;\n\n* Returning a ROW type expression from a built-in hybrid type function, such\nas CASE, IF, etc. \n* ROW of ROWs\n\nExamples\n--------\n\nDeclaring a ROW in a stored procedure\n-------------------------------------\n\nDELIMITER $$\nCREATE PROCEDURE p1()\nBEGIN\n DECLARE r ROW (c1 INT, c2 VARCHAR(10));\n SET r.c1= 10;\n SET r.c2= \'test\';\n INSERT INTO t1 VALUES (r.c1, r.c2);\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nFETCH Examples\n--------------\n\nA complete FETCH example for sql_mode=ORACLE:\n\nDROP TABLE IF EXISTS t1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nINSERT INTO t1 VALUES (20,\'b20\');\nINSERT INTO t1 VALUES (30,\'b30\');\n\nSET sql_mode=oracle;\nDROP PROCEDURE IF EXISTS p1;\nDELIMITER $$\nCREATE PROCEDURE p1 AS\n rec ROW(a INT, b VARCHAR(32));\n CURSOR c IS SELECT a,b FROM t1;\nBEGIN\n OPEN c;\n LOOP\n FETCH c INTO rec;\n EXIT WHEN c%NOTFOUND;\n SELECT (\'rec=(\' || rec.a ||\',\'|| rec.b||\')\');\n END LOOP;\n CLOSE c;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nA complete FETCH example for sql_mode=DEFAULT:\n\nDROP TABLE IF EXISTS t1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nINSERT INTO t1 VALUES (20,\'b20\');\nINSERT INTO t1 VALUES (30,\'b30\');\n\nSET sql_mode=DEFAULT;\nDROP PROCEDURE IF EXISTS p1;\nDELIMITER $$\nCREATE PROCEDURE p1()\nBEGIN\n DECLARE done INT DEFAULT FALSE;\n DECLARE rec ROW(a INT, b VARCHAR(32));\n DECLARE c CURSOR FOR SELECT a,b FROM t1;\n DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;\n OPEN c;\nread_loop:\n LOOP\n FETCH c INTO rec;\n IF done THEN\n LEAVE read_loop;\n END IF;\n SELECT CONCAT(\'rec=(\',rec.a,\',\',rec.b,\')\');\n END LOOP;\n CLOSE c;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nSELECT...INTO Examples\n----------------------\n\nA SELECT...INTO example for sql_mode=DEFAULT:\n\nSET sql_mode=DEFAULT;\nDROP TABLE IF EXISTS t1;\nDROP PROCEDURE IF EXISTS p1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nDELIMITER $$\nCREATE PROCEDURE p1()\nBEGIN\n DECLARE rec1 ROW(a INT, b VARCHAR(32));\n SELECT * FROM t1 INTO rec1;\n SELECT rec1.a, rec1.b;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nThe above example returns:\n\n+--------+--------+\n| rec1.a | rec1.b |\n+--------+--------+\n| 10 | b10 |\n+--------+--------+\n\nA SELECT...INTO example for sql_mode=ORACLE:\n\nSET sql_mode=ORACLE;\nDROP TABLE IF EXISTS t1;\nDROP PROCEDURE IF EXISTS p1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nDELIMITER $$\nCREATE PROCEDURE p1 AS\n rec1 ROW(a INT, b VARCHAR(32));\nBEGIN\n SELECT * FROM t1 INTO rec1;\n SELECT rec1.a, rec1.b;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nThe above example returns:\n\n+--------+--------+\n| rec1.a | rec1.b |\n+--------+--------+\n| 10 | b10 |\n+--------+--------+\n\nAn example for sql_mode=ORACLE using table%ROWTYPE variables as SELECT..INTO\ntargets:\n\nSET sql_mode=ORACLE;\nDROP TABLE IF EXISTS t1;\nDROP PROCEDURE IF EXISTS p1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nDELIMITER $$\nCREATE PROCEDURE p1 AS\n rec1 t1%ROWTYPE;\nBEGIN\n SELECT * FROM t1 INTO rec1;\n SELECT rec1.a, rec1.b;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nThe above example returns:\n\n+--------+--------+\n| rec1.a | rec1.b |\n+--------+--------+\n| 10 | b10 |\n+--------+--------+\n\nAn example for sql_mode=ORACLE using cursor%ROWTYPE variables as SELECT..INTO\ntargets:\n\nSET sql_mode=ORACLE;\nDROP TABLE IF EXISTS t1;\nDROP PROCEDURE IF EXISTS p1;\nCREATE TABLE t1 (a INT, b VARCHAR(32));\nINSERT INTO t1 VALUES (10,\'b10\');\nDELIMITER $$\nCREATE PROCEDURE p1 AS\n CURSOR cur1 IS SELECT * FROM t1;\n rec1 cur1%ROWTYPE;\nBEGIN\n SELECT * FROM t1 INTO rec1;\n SELECT rec1.a, rec1.b;\nEND;\n$$\nDELIMITER ;\nCALL p1();\n\nThe above example returns:\n\n+--------+--------+\n| rec1.a | rec1.b |\n+--------+--------+\n| 10 | b10 |\n+--------+--------+\n\n\n\nURL: mariadb.com/kb/en/row/','','https://mariadb.com/kb/en/row/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (288,22,'SET Data Type','Syntax\n------\n\nSET(\'value1\',\'value2\',...) [CHARACTER SET charset_name] [COLLATE\ncollation_name]\n\nDescription\n-----------\n\nA set. A string object that can have zero or more values, each of which must\nbe chosen from the list of values \'value1\', \'value2\', ... A SET column can\nhave a maximum of 64 members. SET values are represented internally as\nintegers.\n\nSET values cannot contain commas.\n\nIf a SET contains duplicate values, an error will be returned if strict mode\nis enabled, or a warning if strict mode is not enabled.\n\n\n\nURL: mariadb.com/kb/en/set-data-type/','','https://mariadb.com/kb/en/set-data-type/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (289,22,'SMALLINT','Syntax\n------\n\nSMALLINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA small integer. The signed range is -32768 to 32767. The unsigned range is 0\nto 65535.\n\nIf a column has been set to ZEROFILL, all values will be prepended by zeros so\nthat the SMALLINT value contains a number of M digits.\n\nNote: If the ZEROFILL attribute has been specified, the column will\nautomatically become UNSIGNED.\n\nINT2 is a synonym for SMALLINT.\n\nFor more details on the attributes, see Numeric Data Type Overview.\n\nExamples\n--------\n\nCREATE TABLE smallints (a SMALLINT,b SMALLINT UNSIGNED,c SMALLINT ZEROFILL);\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO smallints VALUES (-10,-10,-10);\nERROR 1264 (22003): Out of range value for column \'b\' at row 1\n\nINSERT INTO smallints VALUES (-10,10,-10);\nERROR 1264 (22003): Out of range value for column \'c\' at row 1\n\nINSERT INTO smallints VALUES (-10,10,10);\n\nINSERT INTO smallints VALUES (32768,32768,32768);\nERROR 1264 (22003): Out of range value for column \'a\' at row 1\n\nINSERT INTO smallints VALUES (32767,32768,32768);\n\nSELECT * FROM smallints;\n+-------+-------+-------+\n| a | b | c |\n+-------+-------+-------+\n| -10 | 10 | 00010 |\n| 32767 | 32768 | 32768 |\n+-------+-------+-------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO smallints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.09 sec)\nWarning (Code 1264): Out of range value for column \'b\' at row 1\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO smallints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.08 sec)\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO smallints VALUES (-10,10,10);\n\nINSERT INTO smallints VALUES (32768,32768,32768);\nQuery OK, 1 row affected, 1 warning (0.04 sec)\nWarning (Code 1264): Out of range value for column \'a\' at row 1\n\nINSERT INTO smallints VALUES (32767,32768,32768);\n\nSELECT * FROM smallints;\n+-------+-------+-------+\n| a | b | c |\n+-------+-------+-------+\n| -10 | 0 | 00000 |\n| -10 | 10 | 00000 |\n| -10 | 10 | 00010 |\n| 32767 | 32768 | 32768 |\n| 32767 | 32768 | 32768 |\n+-------+-------+-------+\n\n\n\nURL: mariadb.com/kb/en/smallint/','','https://mariadb.com/kb/en/smallint/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (290,22,'String Literals','Strings are sequences of characters and are enclosed with quotes.\n\nThe syntax is:\n\n[_charset_name]\'string\' [COLLATE collation_name]\n\nFor example:\n\n\'The MariaDB Foundation\'\n_utf8 \'Foundation\' COLLATE utf8_unicode_ci;\n\nStrings can either be enclosed in single quotes or in double quotes (the same\ncharacter must be used to both open and close the string).\n\nThe ANSI SQL-standard does not permit double quotes for enclosing strings, and\nalthough MariaDB does by default, if the MariaDB server has enabled the\nANSI_QUOTES_SQL SQL_MODE, double quotes will be treated as being used for\nidentifiers instead of strings.\n\nStrings that are next to each other are automatically concatenated. For\nexample:\n\n\'The \' \'MariaDB \' \'Foundation\'\n\nand\n\n\'The MariaDB Foundation\'\n\nare equivalent.\n\nThe \ (backslash character) is used to escape characters (unless the SQL_MODE\nhasn\'t been set to NO_BACKSLASH_ESCAPES). For example:\n\n\'MariaDB\'s new features\'\n\nis not a valid string because of the single quote in the middle of the string,\nwhich is treated as if it closes the string, but is actually meant as part of\nthe string, an apostrophe. The backslash character helps in situations like\nthis:\n\n\'MariaDB\'s new features\'\n\nis now a valid string, and if displayed, will appear without the backslash.\n\nSELECT \'MariaDB\'s new features\';\n+------------------------+\n| MariaDB\'s new features |\n+------------------------+\n| MariaDB\'s new features |\n+------------------------+\n\nAnother way to escape the quoting character is repeating it twice:\n\nSELECT \'I\'\'m here\', """Double""";\n+----------+----------+\n| I\'m here | "Double" |\n+----------+----------+\n| I\'m here | "Double" |\n+----------+----------+\n\nEscape Sequences\n----------------\n\nThere are other escape sequences also. Here is a full list:\n\n+-----------------------------------------------+-----------------------------+\n| Escape sequence | Character |\n+-----------------------------------------------+-----------------------------+\n| \0 | ASCII NUL (0x00). |\n+-----------------------------------------------+-----------------------------+\n| \' | Single quote (“\'”). |\n+-----------------------------------------------+-----------------------------+\n| \" | Double quote (“"”). |\n+-----------------------------------------------+-----------------------------+\n| \b | Backspace. |\n+-----------------------------------------------+-----------------------------+\n| \n | Newline, or linefeed,. |\n+-----------------------------------------------+-----------------------------+\n| \r | Carriage return. |\n+-----------------------------------------------+-----------------------------+\n| \t | Tab. |\n+-----------------------------------------------+-----------------------------+\n| \Z | ASCII 26 (Control+Z). See |\n| | note following the table. |\n+-----------------------------------------------+-----------------------------+\n| \\\\ | Backslash (“\”). |\n+-----------------------------------------------+-----------------------------+\n| \% | “%” character. See note |\n| | following the table. |\n+-----------------------------------------------+-----------------------------+\n| \_ | A “_” character. See note |\n| | following the table. |\n+-----------------------------------------------+-----------------------------+\n\nEscaping the % and _ characters can be necessary when using the LIKE operator,\nwhich treats them as special characters.\n\nThe ASCII 26 character (\Z) needs to be escaped when included in a batch file\nwhich needs to be executed in Windows. The reason is that ASCII 26, in\nWindows, is the end of file (EOF).\n\nBackslash (\), if not used as an escape character, must always be escaped.\nWhen followed by a character that is not in the above table, backslashes will\nsimply be ignored.\n\n\n\nURL: mariadb.com/kb/en/string-literals/','','https://mariadb.com/kb/en/string-literals/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (291,22,'TEXT','Syntax\n------\n\nTEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA TEXT column with a maximum length of 65,535 (216 - 1) characters. The\neffective maximum length is less if the value contains multi-byte characters.\nEach TEXT value is stored using a two-byte length prefix that indicates the\nnumber of bytes in the value. If you need a bigger storage, consider using\nMEDIUMTEXT instead.\n\nAn optional length M can be given for this type. If this is done, MariaDB\ncreates the column as the smallest TEXT type large enough to hold values M\ncharacters long.\n\nBefore MariaDB 10.2, all MariaDB collations were of type PADSPACE, meaning\nthat TEXT (as well as VARCHAR and CHAR values) are compared without regard for\ntrailing spaces. This does not apply to the LIKE pattern-matching operator,\nwhich takes into account trailing spaces.\n\nBefore MariaDB 10.2.1, BLOB and TEXT columns could not be assigned a DEFAULT\nvalue. This restriction was lifted in MariaDB 10.2.1.\n\nExamples\n--------\n\nTrailing spaces:\n\nCREATE TABLE strtest (d TEXT(10));\nINSERT INTO strtest VALUES(\'Maria \');\n\nSELECT d=\'Maria\',d=\'Maria \' FROM strtest;\n+-----------+--------------+\n| d=\'Maria\' | d=\'Maria \' |\n+-----------+--------------+\n| 1 | 1 |\n+-----------+--------------+\n\nSELECT d LIKE \'Maria\',d LIKE \'Maria \' FROM strtest;\n+----------------+-------------------+\n| d LIKE \'Maria\' | d LIKE \'Maria \' |\n+----------------+-------------------+\n| 0 | 1 |\n+----------------+-------------------+\n\nIndexing\n--------\n\nTEXT columns can only be indexed over a specified length. This means that they\ncannot be used as the primary key of a table norm until MariaDB 10.4, can a\nunique index be created on them.\n\nMariaDB starting with 10.4\n--------------------------\nStarting with MariaDB 10.4, a unique index can be created on a TEXT column.\n\nInternally, this uses hash indexing to quickly check the values and if a hash\ncollision is found, the actual stored values are compared in order to retain\nthe uniqueness.\n\nDifference between VARCHAR and TEXT\n-----------------------------------\n\n* VARCHAR columns can be fully indexed. TEXT columns can only be indexed over\na specified length.\n* Using TEXT or BLOB in a SELECT query that uses temporary tables for storing\nintermediate results will force the temporary table to be disk based (using\nthe Aria storage engine instead of the memory storage engine, which is a bit\nslower. This is not that bad as the Aria storage engine caches the rows in\nmemory. To get the benefit of this, one should ensure that the\naria_pagecache_buffer_size variable is big enough to hold most of the row and\nindex data for temporary tables.\n\nFor Storage Engine Developers\n-----------------------------\n\n* Internally the full length of the VARCHAR column is allocated inside each\nTABLE objects record[] structure. As there are three such buffers, each open\ntable will allocate 3 times max-length-to-store-varchar bytes of memory.\n* TEXT and BLOB columns are stored with a pointer (4 or 8 bytes) + a 1-4 bytes\nlength. The TEXT data is only stored once. This means that internally TEXT\nuses less memory for each open table but instead has the additional overhead\nthat each TEXT object needs to be allocated and freed for each row access\n(with some caching in between).\n\n\n\nURL: mariadb.com/kb/en/text/','','https://mariadb.com/kb/en/text/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (292,22,'TIME','Syntax\n------\n\nTIME [(<microsecond precision>)]\n\nDescription\n-----------\n\nA time. The range is \'-838:59:59.999999\' to \'838:59:59.999999\'. Microsecond\nprecision can be from 0-6; if not specified 0 is used. Microseconds have been\navailable since MariaDB 5.3.\n\nMariaDB displays TIME values in \'HH:MM:SS.ssssss\' format, but allows\nassignment of times in looser formats, including \'D HH:MM:SS\', \'HH:MM:SS\',\n\'HH:MM\', \'D HH:MM\', \'D HH\', \'SS\', or \'HHMMSS\', as well as permitting dropping\nof any leading zeros when a delimiter is provided, for example \'3:9:10\'. For\ndetails, see date and time literals.\n\nMariaDB starting with 10.1.2\n----------------------------\nMariaDB 10.1.2 introduced the --mysql56-temporal-format option, on by default,\nwhich allows MariaDB to store TIMEs using the same low-level format MySQL 5.6\nuses.\n\nInternal Format\n---------------\n\nIn MariaDB 10.1.2 a new temporal format was introduced from MySQL 5.6 that\nalters how the TIME, DATETIME and TIMESTAMP columns operate at lower levels.\nThese changes allow these temporal data types to have fractional parts and\nnegative values. You can disable this feature using the\nmysql56_temporal_format system variable.\n\nTables that include TIMESTAMP values that were created on an older version of\nMariaDB or that were created while the mysql56_temporal_format system variable\nwas disabled continue to store data using the older data type format.\n\nIn order to update table columns from the older format to the newer format,\nexecute an ALTER TABLE... MODIFY COLUMN statement that changes the column to\nthe *same* data type. This change may be needed if you want to export the\ntable\'s tablespace and import it onto a server that has\nmysql56_temporal_format=ON set (see MDEV-15225).\n\nFor instance, if you have a TIME column in your table:\n\nSHOW VARIABLES LIKE \'mysql56_temporal_format\';\n\n+-------------------------+-------+\n| Variable_name | Value |\n+-------------------------+-------+\n| mysql56_temporal_format | ON |\n+-------------------------+-------+\n\nALTER TABLE example_table MODIFY ts_col TIME;\n\nWhen MariaDB executes the ALTER TABLE statement, it converts the data from the\nolder temporal format to the newer one.\n\nIn the event that you have several tables and columns using temporal data\ntypes that you want to switch over to the new format, make sure the system\nvariable is enabled, then perform a dump and restore using mysqldump. The\ncolumns using relevant temporal data types are restored using the new temporal\nformat.\n\nStarting from MariaDB 10.5.1 columns with old temporal formats are marked with\na /* mariadb-5.3 */ comment in the output of SHOW CREATE TABLE, SHOW COLUMNS,\nDESCRIBE statements, as well as in the COLUMN_TYPE column of the\nINFORMATION_SCHEMA.COLUMNS Table.\n\nSHOW CREATE TABLE mariadb5312_time\G\n*************************** 1. row ***************************\n Table: mariadb5312_time\nCreate Table: CREATE TABLE `mariadb5312_time` (\n `t0` time /* mariadb-5.3 */ DEFAULT NULL,\n `t6` time(6) /* mariadb-5.3 */ DEFAULT NULL\n) ENGINE=MyISAM DEFAULT CHARSET=latin1\n\nNote, columns with the current format are not marked with a comment.\n\nExamples\n--------\n\nINSERT INTO time VALUES (\'90:00:00\'), (\'800:00:00\'), (800), (22), (151413),\n(\'9:6:3\'), (\'12 09\');\n\nSELECT * FROM time;\n+-----------+\n| t |\n+-----------+\n| 90:00:00 |\n| 800:00:00 |\n| 00:08:00 |\n| 00:00:22 |\n| 15:14:13 |\n| 09:06:03 |\n| 297:00:00 |\n+-----------+\n\n\n\nURL: mariadb.com/kb/en/time/','','https://mariadb.com/kb/en/time/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (293,22,'TIMESTAMP','Syntax\n------\n\nTIMESTAMP [(<microsecond precision)]\n\nDescription\n-----------\n\nA timestamp in the format YYYY-MM-DD HH:MM:SS.ffffff.\n\nThe timestamp field is generally used to define at which moment in time a row\nwas added or updated and by default will automatically be assigned the current\ndatetime when a record is inserted or updated. The automatic properties only\napply to the first TIMESTAMP in the record; subsequent TIMESTAMP columns will\nnot be changed.\n\nMariaDB includes the --mysql56-temporal-format option, on by default, which\nallows MariaDB to store TIMESTAMPs using the same low-level format MySQL 5.6\nuses.\n\nFor more information, see Internal Format.\n\nSupported Values\n----------------\n\nMariaDB stores values that use the TIMESTAMP data type as the number of\nseconds since \'1970-01-01 00:00:00\' (UTC). This means that the TIMESTAMP data\ntype can hold values between \'1970-01-01 00:00:01\' (UTC) and \'2038-01-19\n03:14:07\' (UTC).\n\nMariaDB can also store microseconds with a precision between 0 and 6. If no\nmicrosecond precision is specified, then 0 is used by default.\n\nAutomatic Values\n----------------\n\nMariaDB has special behavior for the first column that uses the TIMESTAMP data\ntype in a specific table. For the first column that uses the TIMESTAMP data\ntype in a specific table, MariaDB automatically assigns the following\nproperties to the column:\n\n* DEFAULT CURRENT_TIMESTAMP\n* ON UPDATE CURRENT_TIMESTAMP\n\nThis means that if the column is not explicitly assigned a value in an INSERT\nor UPDATE query, then MariaDB will automatically initialize the column\'s value\nwith the current date and time.\n\nThis automatic initialization for INSERT and UPDATE queries can also be\nexplicitly enabled for a column that uses the TIMESTAMP data type by\nspecifying the DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP\nclauses for the column. In these clauses, any synonym of CURRENT_TIMESTAMP is\naccepted, including CURRENT_TIMESTAMP(), NOW(), LOCALTIME, LOCALTIME(),\nLOCALTIMESTAMP, and LOCALTIMESTAMP().\n\nThis automatic initialization for INSERT queries can also be explicitly\ndisabled for a column that uses the TIMESTAMP data type by specifying a\nconstant DEFAULT value. For example, DEFAULT 0.\n\nThis automatic initialization for UPDATE queries can also be explicitly\ndisabled for a column that uses the TIMESTAMP data type by specifying a\nDEFAULT clause for the column, but no ON UPDATE clause. If a DEFAULT clause is\nexplicitly specified for a column that uses the TIMESTAMP data type, but an ON\nUPDATE clause is not specified for the column, then the timestamp value will\nnot automatically change when an UPDATE statement is executed.\n\nMariaDB also has special behavior if NULL is assigned to column that uses the\nTIMESTAMP data type. If the column is assigned the NULL value in an INSERT or\nUPDATE query, then MariaDB will automatically initialize the column\'s value\nwith the current date and time. For details, see NULL values in MariaDB.\n\nThis automatic initialization for NULL values can also be explicitly disabled\nfor a column that uses the TIMESTAMP data type by specifying the NULL\nattribute for the column. In this case, if the column\'s value is set to NULL,\nthen the column\'s value will actually be set to NULL.\n\nTime Zones\n----------\n\nIf a column uses the TIMESTAMP data type, then any inserted values are\nconverted from the session\'s time zone to Coordinated Universal Time (UTC)\nwhen stored, and converted back to the session\'s time zone when retrieved.\n\nMariaDB does not currently store any time zone identifier with the value of\nthe TIMESTAMP data type. See MDEV-10018 for more information.\n\nMariaDB does not currently support time zone literals that contain time zone\nidentifiers. See MDEV-11829 for more information.\n\nLimitations\n-----------\n\n* Because the TIMESTAMP value is stored as Epoch Seconds, the timestamp value\n\'1970-01-01 00:00:00\' (UTC) is reserved since the second #0 is used to\nrepresent \'0000-00-00 00:00:00\'.\n* In MariaDB 5.5 and before there could only be one TIMESTAMP column per table\nthat had CURRENT_TIMESTAMP defined as its default value. This limit has no\nlonger applied since MariaDB 10.0.\n\nSQL_MODE=MAXDB\n--------------\n\nIf the SQL_MODE is set to MAXDB, TIMESTAMP fields will be silently converted\nto DATETIME.\n\nInternal Format\n---------------\n\nIn MariaDB 10.1.2 a new temporal format was introduced from MySQL 5.6 that\nalters how the TIME, DATETIME and TIMESTAMP columns operate at lower levels.\nThese changes allow these temporal data types to have fractional parts and\nnegative values. You can disable this feature using the\nmysql56_temporal_format system variable.\n\nTables that include TIMESTAMP values that were created on an older version of\nMariaDB or that were created while the mysql56_temporal_format system variable\nwas disabled continue to store data using the older data type format.\n\nIn order to update table columns from the older format to the newer format,\nexecute an ALTER TABLE... MODIFY COLUMN statement that changes the column to\nthe *same* data type. This change may be needed if you want to export the\ntable\'s tablespace and import it onto a server that has\nmysql56_temporal_format=ON set (see MDEV-15225).\n\nFor instance, if you have a TIMESTAMP column in your table:\n\nSHOW VARIABLES LIKE \'mysql56_temporal_format\';\n\n+-------------------------+-------+\n| Variable_name | Value |\n+-------------------------+-------+\n| mysql56_temporal_format | ON |\n+-------------------------+-------+\n\nALTER TABLE example_table MODIFY ts_col TIMESTAMP;\n\nWhen MariaDB executes the ALTER TABLE statement, it converts the data from the\nolder temporal format to the newer one.\n\nIn the event that you have several tables and columns using temporal data\ntypes that you want to switch over to the new format, make sure the system\nvariable is enabled, then perform a dump and restore using mysqldump. The\ncolumns using relevant temporal data types are restored using the new temporal\nformat.\n\nStarting from MariaDB 10.5.1 columns with old temporal formats are marked with\na /* mariadb-5.3 */ comment in the output of SHOW CREATE TABLE, SHOW COLUMNS,\nDESCRIBE statements, as well as in the COLUMN_TYPE column of the\nINFORMATION_SCHEMA.COLUMNS Table.\n\nSHOW CREATE TABLE mariadb5312_timestamp\G\n*************************** 1. row ***************************\n Table: mariadb5312_timestamp\nCreate Table: CREATE TABLE `mariadb5312_timestamp` (\n `ts0` timestamp /* mariadb-5.3 */ NOT NULL DEFAULT current_timestamp() ON\nUPDATE current_timestamp(),\n `ts6` timestamp(6) /* mariadb-5.3 */ NOT NULL DEFAULT \'0000-00-00\n00:00:00.000000\'\n) ENGINE=MyISAM DEFAULT CHARSET=latin1\n\nNote: Prior to MySQL 4.1 a different format for the TIMESTAMP datatype was\nused. This format is unsupported in MariaDB 5.1 and upwards.\n\nExamples\n--------\n\nCREATE TABLE t (id INT, ts TIMESTAMP);\n\nDESC t;\n+-------+-----------+------+-----+-------------------+-------------------------\n---+\n| Field | Type | Null | Key | Default | Extra \n |\n+-------+-----------+------+-----+-------------------+-------------------------\n---+\n| id | int(11) | YES | | NULL | \n |\n| ts | timestamp | NO | | CURRENT_TIMESTAMP | on update\nCURRENT_TIMESTAMP |\n+-------+-----------+------+-----+-------------------+-------------------------\n---+\n\nINSERT INTO t(id) VALUES (1),(2);\n\nSELECT * FROM t;\n+------+---------------------+\n| id | ts |\n+------+---------------------+\n| 1 | 2013-07-22 12:50:05 |\n| 2 | 2013-07-22 12:50:05 |\n+------+---------------------+\n\nINSERT INTO t VALUES (3,NULL),(4,\'2001-07-22 12:12:12\');\n\nSELECT * FROM t;\n+------+---------------------+\n| id | ts |\n+------+---------------------+\n| 1 | 2013-07-22 12:50:05 |\n| 2 | 2013-07-22 12:50:05 |\n| 3 | 2013-07-22 12:51:56 |\n| 4 | 2001-07-22 12:12:12 |\n+------+---------------------+\n\nConverting to Unix epoch:\n\nSELECT ts, UNIX_TIMESTAMP(ts) FROM t;\n+---------------------+--------------------+\n| ts | UNIX_TIMESTAMP(ts) |\n+---------------------+--------------------+\n| 2013-07-22 12:50:05 | 1374490205 |\n| 2013-07-22 12:50:05 | 1374490205 |\n| 2013-07-22 12:51:56 | 1374490316 |\n| 2001-07-22 12:12:12 | 995796732 |\n+---------------------+--------------------+\n\nUpdate also changes the timestamp:\n\nUPDATE t set id=5 WHERE id=1;\n\nSELECT * FROM t;\n+------+---------------------+\n| id | ts |\n+------+---------------------+\n| 5 | 2013-07-22 14:52:33 |\n| 2 | 2013-07-22 12:50:05 |\n| 3 | 2013-07-22 12:51:56 |\n| 4 | 2001-07-22 12:12:12 |\n+------+---------------------+\n\nDefault NULL:\n\nCREATE TABLE t2 (id INT, ts TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP);\n\nINSERT INTO t(id) VALUES (1),(2);\n\nSELECT * FROM t2;\n\nINSERT INTO t2(id) VALUES (1),(2);\n\nSELECT * FROM t2;\n+------+------+\n| id | ts |\n+------+------+\n| 1 | NULL |\n| 2 | NULL |\n+------+------+\n\nUPDATE t2 SET id=3 WHERE id=1;\n\nSELECT * FROM t2;\n+------+---------------------+\n| id | ts |\n+------+---------------------+\n| 3 | 2013-07-22 15:32:22 |\n| 2 | NULL |\n+------+---------------------+\n\nOnly the first timestamp is automatically inserted and updated:\n\nCREATE TABLE t3 (id INT, ts1 TIMESTAMP, ts2 TIMESTAMP);\n\nINSERT INTO t3(id) VALUES (1),(2);\n\nSELECT * FROM t3;\n+------+---------------------+---------------------+\n| id | ts1 | ts2 |\n+------+---------------------+---------------------+\n| 1 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 |\n| 2 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 |\n+------+---------------------+---------------------+\n\nDESC t3;\n+-------+-----------+------+-----+---------------------+-----------------------\n-----+\n| Field | Type | Null | Key | Default | Extra \n |\n+-------+-----------+------+-----+---------------------+-----------------------\n-----+\n| id | int(11) | YES | | NULL | \n |\n| ts1 | timestamp | NO | | CURRENT_TIMESTAMP | on update\nCURRENT_TIMESTAMP |\n| ts2 | timestamp | NO | | 0000-00-00 00:00:00 | \n |\n+-------+-----------+------+-----+---------------------+-----------------------\n-----+\n\nExplicitly setting a timestamp with the CURRENT_TIMESTAMP function:\n\nINSERT INTO t3(id,ts2) VALUES (3,CURRENT_TIMESTAMP());\n\nSELECT * FROM t3;\n+------+---------------------+---------------------+\n| id | ts1 | ts2 |\n+------+---------------------+---------------------+\n| 1 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 |\n| 2 | 2013-07-22 15:35:07 | 0000-00-00 00:00:00 |\n| 3 | 2013-07-22 15:38:52 | 2013-07-22 15:38:52 |\n+------+---------------------+---------------------+\n\nSpecifying the timestamp as NOT NULL:\n\nCREATE TABLE t4 (id INT, ts TIMESTAMP NOT NULL);\n\nINSERT INTO t4(id) VALUES (1);\nSELECT SLEEP(1);\nINSERT INTO t4(id,ts) VALUES (2,NULL);\n\nSELECT * FROM t4;\n\n\n\nURL: mariadb.com/kb/en/timestamp/','','https://mariadb.com/kb/en/timestamp/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (294,22,'TINYBLOB','Syntax\n------\n\nTINYBLOB\n\nDescription\n-----------\n\nA BLOB column with a maximum length of 255 (28 - 1) bytes. Each TINYBLOB value\nis stored using a one-byte length prefix that indicates the number of bytes in\nthe value.\n\n\n\nURL: mariadb.com/kb/en/tinyblob/','','https://mariadb.com/kb/en/tinyblob/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (295,22,'TINYINT','Syntax\n------\n\nTINYINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]\n\nDescription\n-----------\n\nA very small integer. The signed range is -128 to 127. The unsigned range is 0\nto 255. For details on the attributes, see Numeric Data Type Overview.\n\nINT1 is a synonym for TINYINT. BOOL and BOOLEAN are synonyms for TINYINT(1).\n\nExamples\n--------\n\nCREATE TABLE tinyints (a TINYINT,b TINYINT UNSIGNED,c TINYINT ZEROFILL);\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nINSERT INTO tinyints VALUES (-10,-10,-10);\nERROR 1264 (22003): Out of range value for column \'b\' at row 1\n\nINSERT INTO tinyints VALUES (-10,10,-10);\nERROR 1264 (22003): Out of range value for column \'c\' at row 1\n\nINSERT INTO tinyints VALUES (-10,10,10);\n\nSELECT * FROM tinyints;\n+------+------+------+\n| a | b | c |\n+------+------+------+\n| -10 | 10 | 010 |\n+------+------+------+\n\nINSERT INTO tinyints VALUES (128,128,128);\nERROR 1264 (22003): Out of range value for column \'a\' at row 1\n\nINSERT INTO tinyints VALUES (127,128,128);\n\nSELECT * FROM tinyints;\n+------+------+------+\n| a | b | c |\n+------+------+------+\n| -10 | 10 | 010 |\n| 127 | 128 | 128 |\n+------+------+------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nINSERT INTO tinyints VALUES (-10,-10,-10);\nQuery OK, 1 row affected, 2 warnings (0.08 sec)\nWarning (Code 1264): Out of range value for column \'b\' at row 1\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO tinyints VALUES (-10,10,-10);\nQuery OK, 1 row affected, 1 warning (0.11 sec)\nWarning (Code 1264): Out of range value for column \'c\' at row 1\n\nINSERT INTO tinyints VALUES (-10,10,10);\n\nSELECT * FROM tinyints;\n+------+------+------+\n| a | b | c |\n+------+------+------+\n| -10 | 0 | 000 |\n| -10 | 10 | 000 |\n| -10 | 10 | 010 |\n+------+------+------+\n\nINSERT INTO tinyints VALUES (128,128,128);\nQuery OK, 1 row affected, 1 warning (0.19 sec)\nWarning (Code 1264): Out of range value for column \'a\' at row 1\n\nINSERT INTO tinyints VALUES (127,128,128);\n\nSELECT * FROM tinyints;\n+------+------+------+\n| a | b | c |\n+------+------+------+\n| -10 | 0 | 000 |\n| -10 | 10 | 000 |\n| -10 | 10 | 010 |\n| 127 | 128 | 128 |\n| 127 | 128 | 128 |\n+------+------+------+\n\n\n\nURL: mariadb.com/kb/en/tinyint/','','https://mariadb.com/kb/en/tinyint/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (296,22,'TINYTEXT','Syntax\n------\n\nTINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA TEXT column with a maximum length of 255 (28 - 1) characters. The effective\nmaximum length is less if the value contains multi-byte characters. Each\nTINYTEXT value is stored using a one-byte length prefix that indicates the\nnumber of bytes in the value.\n\n\n\nURL: mariadb.com/kb/en/tinytext/','','https://mariadb.com/kb/en/tinytext/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (297,22,'VARBINARY','Syntax\n------\n\nVARBINARY(M)\n\nDescription\n-----------\n\nThe VARBINARY type is similar to the VARCHAR type, but stores binary byte\nstrings rather than non-binary character strings. M represents the maximum\ncolumn length in bytes.\n\nIt contains no character set, and comparison and sorting are based on the\nnumeric value of the bytes.\n\nIf the maximum length is exceeded, and SQL strict mode is not enabled , the\nextra characters will be dropped with a warning. If strict mode is enabled, an\nerror will occur.\n\nUnlike BINARY values, VARBINARYs are not right-padded when inserting.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, RAW is a synonym for VARBINARY.\n\nExamples\n--------\n\nInserting too many characters, first with strict mode off, then with it on:\n\nCREATE TABLE varbins (a VARBINARY(10));\n\nINSERT INTO varbins VALUES(\'12345678901\');\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n\nSELECT * FROM varbins;\n+------------+\n| a |\n+------------+\n| 1234567890 |\n+------------+\n\nSET sql_mode=\'STRICT_ALL_TABLES\';\n\nINSERT INTO varbins VALUES(\'12345678901\');\nERROR 1406 (22001): Data too long for column \'a\' at row 1\n\nSorting is performed with the byte value:\n\nTRUNCATE varbins;\n\nINSERT INTO varbins VALUES(\'A\'),(\'B\'),(\'a\'),(\'b\');\n\nSELECT * FROM varbins ORDER BY a;\n+------+\n| a |\n+------+\n| A |\n| B |\n| a |\n| b |\n+------+\n\nUsing CAST to sort as a CHAR instead:\n\nSELECT * FROM varbins ORDER BY CAST(a AS CHAR);\n+------+\n| a |\n+------+\n| a |\n| A |\n| b |\n| B |\n+------+\n\n\n\nURL: mariadb.com/kb/en/varbinary/','','https://mariadb.com/kb/en/varbinary/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (298,22,'VARCHAR','Syntax\n------\n\n[NATIONAL] VARCHAR(M) [CHARACTER SET charset_name] [COLLATE collation_name]\n\nDescription\n-----------\n\nA variable-length string. M represents the maximum column length in\ncharacters. The range of M is 0 to 65,532. The effective maximum length of a\nVARCHAR is subject to the maximum row size and the character set used. For\nexample, utf8 characters can require up to three bytes per character, so a\nVARCHAR column that uses the utf8 character set can be declared to be a\nmaximum of 21,844 characters.\n\nNote: For the ColumnStore engine, M represents the maximum column length in\nbytes.\n\nMariaDB stores VARCHAR values as a one-byte or two-byte length prefix plus\ndata. The length prefix indicates the number of bytes in the value. A VARCHAR\ncolumn uses one length byte if values require no more than 255 bytes, two\nlength bytes if values may require more than 255 bytes.\n\nMariaDB follows the standard SQL specification, and does not remove trailing\nspaces from VARCHAR values.\n\nVARCHAR(0) columns can contain 2 values: an empty string or NULL. Such columns\ncannot be part of an index. The CONNECT storage engine does not support\nVARCHAR(0).\n\nVARCHAR is shorthand for CHARACTER VARYING. NATIONAL VARCHAR is the standard\nSQL way to define that a VARCHAR column should use some predefined character\nset. MariaDB uses utf8 as this predefined character set, as does MySQL 4.1 and\nup. NVARCHAR is shorthand for NATIONAL VARCHAR.\n\nBefore MariaDB 10.2, all MariaDB collations were of type PADSPACE, meaning\nthat VARCHAR (as well as CHAR and TEXT values) are compared without regard for\ntrailing spaces. This does not apply to the LIKE pattern-matching operator,\nwhich takes into account trailing spaces. From MariaDB 10.2, a number of NO\nPAD collations are available.\n\nIf a unique index consists of a column where trailing pad characters are\nstripped or ignored, inserts into that column where values differ only by the\nnumber of trailing pad characters will result in a duplicate-key error.\n\nExamples\n--------\n\nThe following are equivalent:\n\nVARCHAR(30) CHARACTER SET utf8\nNATIONAL VARCHAR(30)\nNVARCHAR(30)\nNCHAR VARCHAR(30)\nNATIONAL CHARACTER VARYING(30)\nNATIONAL CHAR VARYING(30)\n\nTrailing spaces:\n\nCREATE TABLE strtest (v VARCHAR(10));\nINSERT INTO strtest VALUES(\'Maria \');\n\nSELECT v=\'Maria\',v=\'Maria \' FROM strtest;\n+-----------+--------------+\n| v=\'Maria\' | v=\'Maria \' |\n+-----------+--------------+\n| 1 | 1 |\n+-----------+--------------+\n\nSELECT v LIKE \'Maria\',v LIKE \'Maria \' FROM strtest;\n+----------------+-------------------+\n| v LIKE \'Maria\' | v LIKE \'Maria \' |\n+----------------+-------------------+\n| 0 | 1 |\n+----------------+-------------------+\n\nTruncation\n----------\n\n* Depending on whether or not strict sql mode is set, you will either get a\nwarning or an error if you try to insert a string that is too long into a\nVARCHAR column. If the extra characters are spaces, the spaces that can\'t fit\nwill be removed and you will always get a warning, regardless of the sql mode\nsetting.\n\nDifference Between VARCHAR and TEXT\n-----------------------------------\n\n* VARCHAR columns can be fully indexed. TEXT columns can only be indexed over\na specified length.\n* Using TEXT or BLOB in a SELECT query that uses temporary tables for storing\nintermediate results will force the temporary table to be disk based (using\nthe Aria storage engine instead of the memory storage engine, which is a bit\nslower. This is not that bad as the Aria storage engine caches the rows in\nmemory. To get the benefit of this, one should ensure that the\naria_pagecache_buffer_size variable is big enough to hold most of the row and\nindex data for temporary tables.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, VARCHAR2 is a synonym.\n\nFor Storage Engine Developers\n-----------------------------\n\n* Internally the full length of the VARCHAR column is allocated inside each\nTABLE objects record[] structure. As there are three such buffers, each open\ntable will allocate 3 times max-length-to-store-varchar bytes of memory.\n* TEXT and BLOB columns are stored with a pointer (4 or 8 bytes) + a 1-4 bytes\nlength. The TEXT data is only stored once. This means that internally TEXT\nuses less memory for each open table but instead has the additional overhead\nthat each TEXT object needs to be allocated and freed for each row access\n(with some caching in between).\n\n\n\nURL: mariadb.com/kb/en/varchar/','','https://mariadb.com/kb/en/varchar/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (299,22,'YEAR Data Type','Syntax\n------\n\nYEAR[(4)]\n\nDescription\n-----------\n\nA year in two-digit or four-digit format. The default is four-digit format.\nNote that the two-digit format has been deprecated since MariaDB 5.5.27.\n\nIn four-digit format, the allowable values are 1901 to 2155, and 0000. In\ntwo-digit format, the allowable values are 70 to 69, representing years from\n1970 to 2069. MariaDB displays YEAR values in YYYY format, but allows you to\nassign values to YEAR columns using either strings or numbers.\n\nInserting numeric zero has a different result for YEAR(4) and YEAR(2). For\nYEAR(2), the value 00 reflects the year 2000. For YEAR(4), the value 0000\nreflects the year zero. This only applies to numeric zero. String zero always\nreflects the year 2000.\n\nExamples\n--------\n\nAccepting a string or a number:\n\nCREATE TABLE y(y YEAR);\n\nINSERT INTO y VALUES (1990),(\'2012\');\n\nSELECT * FROM y;\n+------+\n| y |\n+------+\n| 1990 |\n| 2012 |\n+------+\n\nWith strict_mode set, the default from MariaDB 10.2.4:\n\nOut of range:\n\nINSERT INTO y VALUES (1005),(\'3080\');\nERROR 1264 (22003): Out of range value for column \'y\' at row 1\n\nINSERT INTO y VALUES (\'2013-12-12\');\nERROR 1265 (01000): Data truncated for column \'y\' at row 1\n\nSELECT * FROM y;\n+------+\n| y |\n+------+\n| 1990 |\n| 2012 |\n+------+\n\nWith strict_mode unset, the default until MariaDB 10.2.3:\n\nOut of range:\n\nINSERT INTO y VALUES (1005),(\'3080\');\nQuery OK, 2 rows affected, 2 warnings (0.05 sec)\nRecords: 2 Duplicates: 0 Warnings: 2\n\nSHOW WARNINGS;\n+---------+------+--------------------------------------------+\n| Level | Code | Message |\n+---------+------+--------------------------------------------+\n| Warning | 1264 | Out of range value for column \'y\' at row 1 |\n| Warning | 1264 | Out of range value for column \'y\' at row 2 |\n+---------+------+--------------------------------------------+\n\nSELECT * FROM y;\n+------+\n| y |\n+------+\n| 1990 |\n| 2012 |\n| 0000 |\n| 0000 |\n+------+\n\nTruncating:\n\nINSERT INTO y VALUES (\'2013-12-12\');\nQuery OK, 1 row affected, 1 warning (0.05 sec)\n\nSHOW WARNINGS;\n+---------+------+----------------------------------------+\n| Level | Code | Message |\n+---------+------+----------------------------------------+\n| Warning | 1265 | Data truncated for column \'y\' at row 1 |\n+---------+------+----------------------------------------+\n\nSELECT * FROM y;\n+------+\n| y |\n+------+\n| 1990 |\n| 2012 |\n| 0000 |\n| 0000 |\n| 2013 |\n+------+\n\nDifference between YEAR(2) and YEAR(4), and string and numeric zero:\n\nCREATE TABLE y2(y YEAR(4), y2 YEAR(2));\nQuery OK, 0 rows affected, 1 warning (0.40 sec)\n\nNote (Code 1287): \'YEAR(2)\' is deprecated and will be removed in a future\nrelease. \n Please use YEAR(4) instead\n\nINSERT INTO y2 VALUES(0,0),(\'0\',\'0\');\n\nSELECT YEAR(y),YEAR(y2) FROM y2;\n+---------+----------+\n| YEAR(y) | YEAR(y2) |\n+---------+----------+\n| 0 | 2000 |\n| 2000 | 2000 |\n+---------+----------+\n\n\n\nURL: mariadb.com/kb/en/year-data-type/','','https://mariadb.com/kb/en/year-data-type/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (300,23,'BEGIN END','Syntax\n------\n\n[begin_label:] BEGIN [NOT ATOMIC]\n [statement_list]\nEND [end_label]\n\nNOT ATOMIC is required when used outside of a stored procedure. Inside stored\nprocedures or within an anonymous block, BEGIN alone starts a new anonymous\nblock.\n\nDescription\n-----------\n\nBEGIN ... END syntax is used for writing compound statements. A compound\nstatement can contain multiple statements, enclosed by the BEGIN and END\nkeywords. statement_list represents a list of one or more statements, each\nterminated by a semicolon (i.e., ;) statement delimiter. statement_list is\noptional, which means that the empty compound statement (BEGIN END) is legal.\n\nNote that END will perform a commit. If you are running in autocommit mode,\nevery statement will be committed separately. If you are not running in\nautocommit mode, you must execute a COMMIT or ROLLBACK after END to get the\ndatabase up to date.\n\nUse of multiple statements requires that a client is able to send statement\nstrings containing the ; statement delimiter. This is handled in the mysql\ncommand-line client with the DELIMITER command. Changing the ;\nend-of-statement delimiter (for example, to //) allows ; to be used in a\nprogram body.\n\nA compound statement within a stored program can be labeled. end_label cannot\nbe given unless begin_label also is present. If both are present, they must be\nthe same.\n\nBEGIN ... END constructs can be nested. Each block can define its own\nvariables, a CONDITION, a HANDLER and a CURSOR, which don\'t exist in the outer\nblocks. The most local declarations override the outer objects which use the\nsame name (see example below).\n\nThe declarations order is the following:\n\n* DECLARE local variables;\n* DECLARE CONDITIONs;\n* DECLARE CURSORs;\n* DECLARE HANDLERs;\n\nNote that DECLARE HANDLER contains another BEGIN ... END construct.\n\nHere is an example of a very simple, anonymous block:\n\nBEGIN NOT ATOMIC\nSET @a=1;\nCREATE TABLE test.t1(a INT);\nEND|\n\nBelow is an example of nested blocks in a stored procedure:\n\nCREATE PROCEDURE t( )\nBEGIN\n DECLARE x TINYINT UNSIGNED DEFAULT 1;\n BEGIN\n DECLARE x CHAR(2) DEFAULT \'02\';\n DECLARE y TINYINT UNSIGNED DEFAULT 10;\n SELECT x, y;\n END;\n SELECT x;\nEND;\n\nIn this example, a TINYINT variable, x is declared in the outter block. But in\nthe inner block x is re-declared as a CHAR and an y variable is declared. The\ninner SELECT shows the "new" value of x, and the value of y. But when x is\nselected in the outer block, the "old" value is returned. The final SELECT\ndoesn\'t try to read y, because it doesn\'t exist in that context.\n\n\n\nURL: mariadb.com/kb/en/begin-end/','','https://mariadb.com/kb/en/begin-end/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (301,23,'CASE Statement','Syntax\n------\n\nCASE case_value\n WHEN when_value THEN statement_list\n [WHEN when_value THEN statement_list] ...\n [ELSE statement_list]\nEND CASE\n\nOr:\n\nCASE\n WHEN search_condition THEN statement_list\n [WHEN search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND CASE\n\nDescription\n-----------\n\nThe text on this page describes the CASE statement for stored programs. See\nthe CASE OPERATOR for details on the CASE operator outside of stored programs.\n\nThe CASE statement for stored programs implements a complex conditional\nconstruct. If a search_condition evaluates to true, the corresponding SQL\nstatement list is executed. If no search condition matches, the statement list\nin the ELSE clause is executed. Each statement_list consists of one or more\nstatements.\n\nThe CASE statement cannot have an ELSE NULL clause, and it is terminated with\nEND CASE instead of END. implements a complex conditional construct. If a\nsearch_condition evaluates to true, the corresponding SQL statement list is\nexecuted. If no search condition matches, the statement list in the ELSE\nclause is executed. Each statement_list consists of one or more statements.\n\nIf no when_value or search_condition matches the value tested and the CASE\nstatement contains no ELSE clause, a Case not found for CASE statement error\nresults.\n\nEach statement_list consists of one or more statements; an empty\nstatement_list is not allowed. To handle situations where no value is matched\nby any WHEN clause, use an ELSE containing an empty BEGIN ... END block, as\nshown in this example:\n\nDELIMITER |\nCREATE PROCEDURE p()\nBEGIN\n DECLARE v INT DEFAULT 1;\n CASE v\n WHEN 2 THEN SELECT v;\n WHEN 3 THEN SELECT 0;\n ELSE BEGIN END;\n END CASE;\nEND;\n|\n\nThe indentation used here in the ELSE clause is for purposes of clarity only,\nand is not otherwise significant. See Delimiters in the mysql client for more\non the use of the delimiter command.\n\nNote: The syntax of the CASE statement used inside stored programs differs\nslightly from that of the SQL CASE expression described in CASE OPERATOR. The\nCASE statement cannot have an ELSE NULL clause, and it is terminated with END\nCASE instead of END.\n\n\n\nURL: mariadb.com/kb/en/case-statement/','','https://mariadb.com/kb/en/case-statement/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (302,23,'CLOSE','Syntax\n------\n\nCLOSE cursor_name\n\nDescription\n-----------\n\nThis statement closes a previously opened cursor. The cursor must have been\npreviously opened or else an error occurs.\n\nIf not closed explicitly, a cursor is closed at the end of the compound\nstatement in which it was declared.\n\nSee Cursor Overview for an example.\n\n\n\nURL: mariadb.com/kb/en/close/','','https://mariadb.com/kb/en/close/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (303,23,'DECLARE CONDITION','Syntax\n------\n\nDECLARE condition_name CONDITION FOR condition_value\n\ncondition_value:\n SQLSTATE [VALUE] sqlstate_value\n | mysql_error_code\n\nDescription\n-----------\n\nThe DECLARE ... CONDITION statement defines a named error condition. It\nspecifies a condition that needs specific handling and associates a name with\nthat condition. Later, the name can be used in a DECLARE ... HANDLER, SIGNAL\nor RESIGNAL statement (as long as the statement is located in the same BEGIN\n... END block).\n\nConditions must be declared after local variables, but before CURSORs and\nHANDLERs.\n\nA condition_value for DECLARE ... CONDITION can be an SQLSTATE value (a\n5-character string literal) or a MySQL error code (a number). You should not\nuse SQLSTATE value \'00000\' or MySQL error code 0, because those indicate\nsucess rather than an error condition. If you try, or if you specify an\ninvalid SQLSTATE value, an error like this is produced:\n\nERROR 1407 (42000): Bad SQLSTATE: \'00000\'\n\nFor a list of SQLSTATE values and MariaDB error codes, see MariaDB Error Codes.\n\n\n\nURL: mariadb.com/kb/en/declare-condition/','','https://mariadb.com/kb/en/declare-condition/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (304,23,'DECLARE CURSOR','Syntax\n------\n\n<= MariaDB 10.2\n\nDECLARE cursor_name CURSOR FOR select_statement\n\nFrom MariaDB 10.3\n\nDECLARE cursor_name CURSOR [(cursor_formal_parameter[,...])] FOR\nselect_statement\n\ncursor_formal_parameter:\n name type [collate clause]\n\nFrom MariaDB 10.8\n\nDECLARE cursor_name CURSOR [(cursor_formal_parameter[,...])] FOR\nselect_statement\n\ncursor_formal_parameter:\n [IN] name type [collate clause]\n\nDescription\n-----------\n\nThis statement declares a cursor. Multiple cursors may be declared in a stored\nprogram, but each cursor in a given block must have a unique name.\n\nselect_statement is not executed until the OPEN statement is executed. It is\nimportant to remember this if the query produces an error, or calls functions\nwhich have side effects.\n\nA SELECT associated to a cursor can use variables, but the query itself cannot\nbe a variable, and cannot be dynamically composed. The SELECT statement cannot\nhave an INTO clause.\n\nCursors must be declared before HANDLERs, but after local variables and\nCONDITIONs.\n\nParameters\n----------\n\nMariaDB starting with 10.3.0\n----------------------------\nFrom MariaDB 10.3.0, cursors can have parameters. This is a non-standard SQL\nextension. Cursor parameters can appear in any part of the DECLARE CURSOR\nselect_statement where a stored procedure variable is allowed (select list,\nWHERE, HAVING, LIMIT etc).\n\nIN\n--\n\nMariaDB starting with 10.8.0\n----------------------------\nFrom MariaDB 10.8.0 preview release, the IN qualifier is supported in the\ncursor_format_parameter part of the syntax.\n\nSee Cursor Overview for an example.\n\n\n\nURL: mariadb.com/kb/en/declare-cursor/','','https://mariadb.com/kb/en/declare-cursor/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (305,23,'DECLARE HANDLER','Syntax\n------\n\nDECLARE handler_type HANDLER\n FOR condition_value [, condition_value] ...\n statement\n\nhandler_type:\n CONTINUE\n | EXIT\n | UNDO\n\ncondition_value:\n SQLSTATE [VALUE] sqlstate_value\n | condition_name\n | SQLWARNING\n | NOT FOUND\n | SQLEXCEPTION\n | mariadb_error_code\n\nDescription\n-----------\n\nThe DECLARE ... HANDLER statement specifies handlers that each may deal with\none or more conditions. If one of these conditions occurs, the specified\nstatement is executed. statement can be a simple statement (for example, SET\nvar_name = value), or it can be a compound statement written using BEGIN and\nEND.\n\nHandlers must be declared after local variables, a CONDITION and a CURSOR.\n\nFor a CONTINUE handler, execution of the current program continues after\nexecution of the handler statement. For an EXIT handler, execution terminates\nfor the BEGIN ... END compound statement in which the handler is declared.\n(This is true even if the condition occurs in an inner block.) The UNDO\nhandler type statement is not supported.\n\nIf a condition occurs for which no handler has been declared, the default\naction is EXIT.\n\nA condition_value for DECLARE ... HANDLER can be any of the following values:\n\n* An SQLSTATE value (a 5-character string literal) or a MariaDB error\ncode (a number). You should not use SQLSTATE value \'00000\' or MariaDB\nerror code 0, because those indicate sucess rather than an error\ncondition. For a list of SQLSTATE values and MariaDB error codes, see\nMariaDB Error Codes.\n* A condition name previously specified with DECLARE ... CONDITION. It must be\nin the same stored program. See DECLARE CONDITION.\n* SQLWARNING is shorthand for the class of SQLSTATE values that begin\nwith \'01\'.\n* NOT FOUND is shorthand for the class of SQLSTATE values that begin\nwith \'02\'. This is relevant only the context of cursors and is used to\ncontrol what happens when a cursor reaches the end of a data set. If\nno more rows are available, a No Data condition occurs with SQLSTATE\nvalue 02000. To detect this condition, you can set up a handler for it\n(or for a NOT FOUND condition). An example is shown in Cursor Overview. This\ncondition also occurs for SELECT ... INTO var_list statements that retrieve no\nrows.\n* SQLEXCEPTION is shorthand for the class of SQLSTATE values that do\nnot begin with \'00\', \'01\', or \'02\'.\n\nWhen an error raises, in some cases it could be handled by multiple HANDLERs.\nFor example, there may be an handler for 1050 error, a separate handler for\nthe 42S01 SQLSTATE, and another separate handler for the SQLEXCEPTION class:\nin theory all occurrences of HANDLER may catch the 1050 error, but MariaDB\nchooses the HANDLER with the highest precedence. Here are the precedence rules:\n\n* Handlers which refer to an error code have the highest precedence.\n* Handlers which refer to a SQLSTATE come next.\n* Handlers which refer to an error class have the lowest precedence.\n\nIn some cases, a statement could produce multiple errors. If this happens, in\nsome cases multiple handlers could have the highest precedence. In such cases,\nthe choice of the handler is indeterminate.\n\nNote that if an error occurs within a CONTINUE HANDLER block, it can be\nhandled by another HANDLER. However, a HANDLER which is already in the stack\n(that is, it has been called to handle an error and its execution didn\'t\nfinish yet) cannot handle new errors—this prevents endless loops. For example,\nsuppose that a stored procedure contains a CONTINUE HANDLER for SQLWARNING and\nanother CONTINUE HANDLER for NOT FOUND. At some point, a NOT FOUND error\noccurs, and the execution enters the NOT FOUND HANDLER. But within that\nhandler, a warning occurs, and the execution enters the SQLWARNING HANDLER. If\nanother NOT FOUND error occurs, it cannot be handled again by the NOT FOUND\nHANDLER, because its execution is not finished.\n\nWhen a DECLARE HANDLER block can handle more than one error condition, it may\nbe useful to know which errors occurred. To do so, you can use the GET\nDIAGNOSTICS statement.\n\nAn error that is handled by a DECLARE HANDLER construct can be issued again\nusing the RESIGNAL statement.\n\nBelow is an example using DECLARE HANDLER:\n\nCREATE TABLE test.t (s1 INT, PRIMARY KEY (s1));\n\nDELIMITER //\n\nCREATE PROCEDURE handlerdemo ( )\n BEGIN\n DECLARE CONTINUE HANDLER FOR SQLSTATE \'23000\' SET @x2 = 1;\n SET @x = 1;\n INSERT INTO test.t VALUES (1);\n SET @x = 2;\n INSERT INTO test.t VALUES (1);\n SET @x = 3;\n END;\n //\n\nDELIMITER ;\n\nCALL handlerdemo( );\n\nSELECT @x;\n+------+\n| @x |\n+------+\n| 3 |\n+------+\n\n\n\nURL: mariadb.com/kb/en/declare-handler/','','https://mariadb.com/kb/en/declare-handler/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (306,23,'DECLARE Variable','Syntax\n------\n\nDECLARE var_name [, var_name] ... [[ROW] TYPE OF]] type [DEFAULT value]\n\nDescription\n-----------\n\nThis statement is used to declare local variables within stored programs. To\nprovide a default value for the variable, include a DEFAULT clause. The value\ncan be specified as an expression (even subqueries are permitted); it need not\nbe a constant. If the DEFAULT clause is missing, the initial value is NULL.\n\nLocal variables are treated like stored routine parameters with respect to\ndata type and overflow checking. See CREATE PROCEDURE.\n\nLocal variables must be declared before CONDITIONs, CURSORs and HANDLERs.\n\nLocal variable names are not case sensitive.\n\nThe scope of a local variable is within the BEGIN ... END block where it is\ndeclared. The variable can be referred to in blocks nested within the\ndeclaring block, except those blocks that declare a variable with the same\nname.\n\nTYPE OF / ROW TYPE OF\n---------------------\n\nMariaDB starting with 10.3\n--------------------------\nTYPE OF and ROW TYPE OF anchored data types for stored routines were\nintroduced in MariaDB 10.3.\n\nAnchored data types allow a data type to be defined based on another object,\nsuch as a table row, rather than specifically set in the declaration. If the\nanchor object changes, so will the anchored data type. This can lead to\nroutines being easier to maintain, so that if the data type in the table is\nchanged, it will automatically be changed in the routine as well.\n\nVariables declared with ROW TYPE OF will have the same features as implicit\nROW variables. It is not possible to use ROW TYPE OF variables in a LIMIT\nclause.\n\nThe real data type of TYPE OF and ROW TYPE OF table_name will become known at\nthe very beginning of the stored routine call. ALTER TABLE or DROP TABLE\nstatements performed inside the current routine on the tables that appear in\nanchors won\'t affect the data type of the anchored variables, even if the\nvariable is declared after an ALTER TABLE or DROP TABLE statement.\n\nThe real data type of a ROW TYPE OF cursor_name variable will become known\nwhen execution enters into the block where the variable is declared. Data type\ninstantiation will happen only once. In a cursor ROW TYPE OF variable that is\ndeclared inside a loop, its data type will become known on the very first\niteration and won\'t change on further loop iterations.\n\nThe tables referenced in TYPE OF and ROW TYPE OF declarations will be checked\nfor existence at the beginning of the stored routine call. CREATE PROCEDURE or\nCREATE FUNCTION will not check the referenced tables for existence.\n\nExamples\n--------\n\nTYPE OF and ROW TYPE OF from MariaDB 10.3:\n\nDECLARE tmp TYPE OF t1.a; -- Get the data type from the column {{a}} in the\ntable {{t1}}\n\nDECLARE rec1 ROW TYPE OF t1; -- Get the row data type from the table {{t1}}\n\nDECLARE rec2 ROW TYPE OF cur1; -- Get the row data type from the cursor\n{{cur1}}\n\n\n\nURL: mariadb.com/kb/en/declare-variable/','','https://mariadb.com/kb/en/declare-variable/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (307,23,'FETCH','Syntax\n------\n\nFETCH cursor_name INTO var_name [, var_name] ...\n\nDescription\n-----------\n\nThis statement fetches the next row (if a row exists) using the specified open\ncursor, and advances the cursor pointer.\n\nvar_name can be a local variable, but not a user-defined variable.\n\nIf no more rows are available, a No Data condition occurs with SQLSTATE value\n02000. To detect this condition, you can set up a handler for it (or for a NOT\nFOUND condition).\n\nSee Cursor Overview for an example.\n\n\n\nURL: mariadb.com/kb/en/fetch/','','https://mariadb.com/kb/en/fetch/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (308,23,'FOR','MariaDB starting with 10.3\n--------------------------\nFOR loops were introduced in MariaDB 10.3.\n\nSyntax\n------\n\nInteger range FOR loop:\n\n[begin_label:]\nFOR var_name IN [ REVERSE ] lower_bound .. upper_bound\nDO statement_list\nEND FOR [ end_label ]\n\nExplicit cursor FOR loop\n\n[begin_label:]\nFOR record_name IN cursor_name [ ( cursor_actual_parameter_list)]\nDO statement_list\nEND FOR [ end_label ]\n\nExplicit cursor FOR loop (Oracle mode)\n\n[begin_label:]\nFOR record_name IN cursor_name [ ( cursor_actual_parameter_list)]\nLOOP\n statement_list\nEND LOOP [ end_label ]\n\nImplicit cursor FOR loop\n\n[begin_label:]\nFOR record_name IN ( select_statement )\nDO statement_list\nEND FOR [ end_label ]\n\nDescription\n-----------\n\nFOR loops allow code to be executed a fixed number of times.\n\nIn an integer range FOR loop, MariaDB will compare the lower bound and upper\nbound values, and assign the lower bound value to a counter. If REVERSE is not\nspecified, and the upper bound value is greater than or equal to the counter,\nthe counter will be incremented and the statement will continue, after which\nthe loop is entered again. If the upper bound value is greater than the\ncounter, the loop will be exited.\n\nIf REVERSE is specified, the counter is decremented, and the upper bound value\nneeds to be less than or equal for the loop to continue.\n\nExamples\n--------\n\nIntger range FOR loop:\n\nCREATE TABLE t1 (a INT);\n\nDELIMITER //\n\nFOR i IN 1..3\nDO\n INSERT INTO t1 VALUES (i);\nEND FOR;\n//\n\nDELIMITER ;\n\nSELECT * FROM t1;\n+------+\n| a |\n+------+\n| 1 |\n| 2 |\n| 3 |\n+------+\n\nREVERSE integer range FOR loop:\n\nCREATE OR REPLACE TABLE t1 (a INT);\n\nDELIMITER //\nFOR i IN REVERSE 4..12\n DO\n INSERT INTO t1 VALUES (i);\nEND FOR;\n//\nQuery OK, 9 rows affected (0.422 sec)\n\nDELIMITER ;\n\nSELECT * FROM t1;\n+------+\n| a |\n+------+\n| 12 |\n| 11 |\n| 10 |\n| 9 |\n| 8 |\n| 7 |\n| 6 |\n| 5 |\n| 4 |\n+------+\n\nExplicit cursor in Oracle mode:\n\nSET sql_mode=ORACLE;\n\nCREATE OR REPLACE TABLE t1 (a INT, b VARCHAR(32));\n\nINSERT INTO t1 VALUES (10,\'b0\');\nINSERT INTO t1 VALUES (11,\'b1\');\nINSERT INTO t1 VALUES (12,\'b2\');\n\nDELIMITER //\n\nCREATE OR REPLACE PROCEDURE p1(pa INT) AS \n CURSOR cur(va INT) IS\n SELECT a, b FROM t1 WHERE a=va;\nBEGIN\n FOR rec IN cur(pa)\n LOOP\n SELECT rec.a, rec.b;\n END LOOP;\nEND;\n//\n\nDELIMITER ;\n\nCALL p1(10);\n+-------+-------+\n| rec.a | rec.b |\n+-------+-------+\n| 10 | b0 |\n+-------+-------+\n\nCALL p1(11);\n+-------+-------+\n| rec.a | rec.b |\n+-------+-------+\n| 11 | b1 |\n+-------+-------+\n\nCALL p1(12);\n+-------+-------+\n| rec.a | rec.b |\n+-------+-------+\n| 12 | b2 |\n+-------+-------+\n\nCALL p1(13);\nQuery OK, 0 rows affected (0.000 sec)\n\n\n\nURL: mariadb.com/kb/en/for/','','https://mariadb.com/kb/en/for/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (309,23,'GOTO','MariaDB starting with 10.3\n--------------------------\nThe GOTO statement was introduced in MariaDB 10.3 for Oracle compatibility.\n\nSyntax\n------\n\nGOTO label\n\nDescription\n-----------\n\nThe GOTO statement causes the code to jump to the specified label, and\ncontinue operating from there. It is only accepted when in Oracle mode.\n\nExample\n-------\n\nSET sql_mode=ORACLE;\n\nDELIMITER //\n\nCREATE OR REPLACE PROCEDURE p1 AS\n\nBEGIN\n\nSELECT 1;\n GOTO label;\n SELECT 2;\n <<label>>\n SELECT 3;\n\nEND;\n\n//\n\nDELIMITER\n\ncall p1();\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n1 row in set (0.000 sec)\n\n+---+\n| 3 |\n+---+\n| 3 |\n+---+\n1 row in set (0.000 sec)\n\n\n\nURL: mariadb.com/kb/en/goto/','','https://mariadb.com/kb/en/goto/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (310,23,'IF','Syntax\n------\n\nIF search_condition THEN statement_list\n [ELSEIF search_condition THEN statement_list] ...\n [ELSE statement_list]\nEND IF;\n\nDescription\n-----------\n\nIF implements a basic conditional construct. If the search_condition evaluates\nto true, the corresponding SQL statement list is executed. If no\nsearch_condition matches, the statement list in the ELSE clause is executed.\nEach statement_list consists of one or more statements.\n\n\n\nURL: mariadb.com/kb/en/if/','','https://mariadb.com/kb/en/if/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (311,23,'ITERATE','Syntax\n------\n\nITERATE label\n\nITERATE can appear only within LOOP, REPEAT, and WHILE statements. ITERATE\nmeans "do the loop again", and uses the statement\'s label to determine which\nstatements to repeat. The label must be in the same stored program, not in a\ncaller procedure.\n\nIf you try to use ITERATE with a non-existing label, or if the label is\nassociated to a construct which is not a loop, the following error will be\nproduced:\n\nERROR 1308 (42000): ITERATE with no matching label: <label_name>\n\nBelow is an example of how ITERATE might be used:\n\nCREATE PROCEDURE doiterate(p1 INT)\nBEGIN\n label1: LOOP\n SET p1 = p1 + 1;\n IF p1 < 10 THEN ITERATE label1; END IF;\n LEAVE label1;\n END LOOP label1;\n SET @x = p1;\nEND\n\n\n\nURL: mariadb.com/kb/en/iterate/','','https://mariadb.com/kb/en/iterate/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (312,23,'Labels','Syntax\n------\n\nlabel: <construct>\n[label]\n\nLabels are MariaDB identifiers which can be used to identify a BEGIN ... END\nconstruct or a loop. They have a maximum length of 16 characters and can be\nquoted with backticks (i.e.., `).\n\nLabels have a start part and an end part. The start part must precede the\nportion of code it refers to, must be followed by a colon (:) and can be on\nthe same or different line. The end part is optional and adds nothing, but can\nmake the code more readable. If used, the end part must precede the\nconstruct\'s delimiter (;). Constructs identified by a label can be nested.\nEach construct can be identified by only one label.\n\nLabels need not be unique in the stored program they belong to. However, a\nlabel for an inner loop cannot be identical to a label for an outer loop. In\nthis case, the following error would be produced:\n\nERROR 1309 (42000): Redefining label <label_name>\n\nLEAVE and ITERATE statements can be used to exit or repeat a portion of code\nidentified by a label. They must be in the same Stored Routine, Trigger or\nEvent which contains the target label.\n\nBelow is an example using a simple label that is used to exit a LOOP:\n\nCREATE PROCEDURE `test_sp`()\nBEGIN\n `my_label`:\n LOOP\n SELECT \'looping\';\n LEAVE `my_label`;\n END LOOP;\n SELECT \'out of loop\';\nEND;\n\nThe following label is used to exit a procedure, and has an end part:\n\nCREATE PROCEDURE `test_sp`()\n`my_label`:\nBEGIN\n IF @var = 1 THEN\n LEAVE `my_label`;\n END IF;\n DO something();\nEND `my_label`;\n\n\n\nURL: mariadb.com/kb/en/labels/','','https://mariadb.com/kb/en/labels/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (313,23,'LEAVE','Syntax\n------\n\nLEAVE label\n\nThis statement is used to exit the flow control construct that has the given\nlabel. The label must be in the same stored program, not in a caller\nprocedure. LEAVE can be used within BEGIN ... END or loop constructs (LOOP,\nREPEAT, WHILE). In Stored Procedures, Triggers and Events, LEAVE can refer to\nthe outmost BEGIN ... END construct; in that case, the program exits the\nprocedure. In Stored Functions, RETURN can be used instead.\n\nNote that LEAVE cannot be used to exit a DECLARE HANDLER block.\n\nIf you try to LEAVE a non-existing label, or if you try to LEAVE a HANDLER\nblock, the following error will be produced:\n\nERROR 1308 (42000): LEAVE with no matching label: <label_name>\n\nThe following example uses LEAVE to exit the procedure if a condition is true:\n\nCREATE PROCEDURE proc(IN p TINYINT)\nCONTAINS SQL\n`whole_proc`:\nBEGIN\n SELECT 1;\n IF p < 1 THEN\n LEAVE `whole_proc`;\n END IF;\n SELECT 2;\nEND;\n\nCALL proc(0);\n+---+\n| 1 |\n+---+\n| 1 |\n+---+\n\n\n\nURL: mariadb.com/kb/en/leave/','','https://mariadb.com/kb/en/leave/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (314,23,'LOOP','Syntax\n------\n\n[begin_label:] LOOP\n statement_list\nEND LOOP [end_label]\n\nDescription\n-----------\n\nLOOP implements a simple loop construct, enabling repeated execution of the\nstatement list, which consists of one or more statements, each terminated by a\nsemicolon (i.e., ;) statement delimiter. The statements within the loop are\nrepeated until the loop is exited; usually this is accomplished with a LEAVE\nstatement.\n\nA LOOP statement can be labeled. end_label cannot be given unless begin_label\nalso is present. If both are present, they must be the same.\n\nSee Delimiters in the mysql client for more on delimiter usage in the client.\n\n\n\nURL: mariadb.com/kb/en/loop/','','https://mariadb.com/kb/en/loop/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (315,23,'OPEN','Syntax\n------\n\n<= MariaDB 10.2\n\nOPEN cursor_name\n\nFrom MariaDB 10.3\n\nOPEN cursor_name [expression[,...]];\n\nDescription\n-----------\n\nThis statement opens a cursor which was previously declared with DECLARE\nCURSOR.\n\nThe query associated to the DECLARE CURSOR is executed when OPEN is executed.\nIt is important to remember this if the query produces an error, or calls\nfunctions which have side effects.\n\nThis is necessary in order to FETCH rows from a cursor.\n\nSee Cursor Overview for an example.\n\n\n\nURL: mariadb.com/kb/en/open/','','https://mariadb.com/kb/en/open/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (316,23,'REPEAT LOOP','Syntax\n------\n\n[begin_label:] REPEAT\n statement_list\nUNTIL search_condition\nEND REPEAT [end_label]\n\nThe statement list within a REPEAT statement is repeated until the\nsearch_condition is true. Thus, a REPEAT always enters the loop at least once.\nstatement_list consists of one or more statements, each terminated by a\nsemicolon (i.e., ;) statement delimiter.\n\nA REPEAT statement can be labeled. end_label cannot be given unless\nbegin_label also is present. If both are present, they must be the same.\n\nSee Delimiters in the mysql client for more on client delimiter usage.\n\nDELIMITER //\n\nCREATE PROCEDURE dorepeat(p1 INT)\n BEGIN\n SET @x = 0;\n REPEAT SET @x = @x + 1; UNTIL @x > p1 END REPEAT;\n END\n//\n\nCALL dorepeat(1000)//\n\nSELECT @x//\n+------+\n| @x |\n+------+\n| 1001 |\n+------+\n\n\n\nURL: mariadb.com/kb/en/repeat-loop/','','https://mariadb.com/kb/en/repeat-loop/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (317,23,'RESIGNAL','Syntax\n------\n\nRESIGNAL [error_condition]\n [SET error_property\n [, error_property] ...]\n\nerror_condition:\n SQLSTATE [VALUE] \'sqlstate_value\'\n | condition_name\n\nerror_property:\n error_property_name = <error_property_value>\n\nerror_property_name:\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\nDescription\n-----------\n\nThe syntax of RESIGNAL and its semantics are very similar to SIGNAL. This\nstatement can only be used within an error HANDLER. It produces an error, like\nSIGNAL. RESIGNAL clauses are the same as SIGNAL, except that they all are\noptional, even SQLSTATE. All the properties which are not specified in\nRESIGNAL, will be identical to the properties of the error that was received\nby the error HANDLER. For a description of the clauses, see diagnostics area.\n\nNote that RESIGNAL does not empty the diagnostics area: it just appends\nanother error condition.\n\nRESIGNAL, without any clauses, produces an error which is identical to the\nerror that was received by HANDLER.\n\nIf used out of a HANDLER construct, RESIGNAL produces the following error:\n\nERROR 1645 (0K000): RESIGNAL when handler not active\n\nIn MariaDB 5.5, if a HANDLER contained a CALL to another procedure, that\nprocedure could use RESIGNAL. Since MariaDB 10.0, trying to do this raises the\nabove error.\n\nFor a list of SQLSTATE values and MariaDB error codes, see MariaDB Error Codes.\n\nThe following procedure tries to query two tables which don\'t exist, producing\na 1146 error in both cases. Those errors will trigger the HANDLER. The first\ntime the error will be ignored and the client will not receive it, but the\nsecond time, the error is re-signaled, so the client will receive it.\n\nCREATE PROCEDURE test_error( )\nBEGIN\n DECLARE CONTINUE HANDLER\n FOR 1146\n BEGIN\n IF @hide_errors IS FALSE THEN\n RESIGNAL;\n END IF;\n END;\n SET @hide_errors = TRUE;\n SELECT \'Next error will be ignored\' AS msg;\n SELECT `c` FROM `temptab_one`;\n SELECT \'Next error won\'\'t be ignored\' AS msg;\n SET @hide_errors = FALSE;\n SELECT `c` FROM `temptab_two`;\nEND;\n\nCALL test_error( );\n\n+----------------------------+\n| msg |\n+----------------------------+\n| Next error will be ignored |\n+----------------------------+\n\n+-----------------------------+\n| msg |\n+-----------------------------+\n| Next error won\'t be ignored |\n+-----------------------------+\n\nERROR 1146 (42S02): Table \'test.temptab_two\' doesn\'t exist\n\nThe following procedure re-signals an error, modifying only the error message\nto clarify the cause of the problem.\n\nCREATE PROCEDURE test_error()\nBEGIN\n DECLARE CONTINUE HANDLER\n FOR 1146\n BEGIN\n RESIGNAL SET\n MESSAGE_TEXT = \'`temptab` does not exist\';\n END;\n SELECT `c` FROM `temptab`;\nEND;\n\nCALL test_error( );\nERROR 1146 (42S02): `temptab` does not exist\n\nAs explained above, this works on MariaDB 5.5, but produces a 1645 error since\n10.0.\n\nCREATE PROCEDURE handle_error()\nBEGIN\n RESIGNAL;\nEND;\nCREATE PROCEDURE p()\nBEGIN\n DECLARE EXIT HANDLER FOR SQLEXCEPTION CALL p();\n SIGNAL SQLSTATE \'45000\';\nEND;\n\n\n\nURL: mariadb.com/kb/en/resignal/','','https://mariadb.com/kb/en/resignal/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (318,23,'RETURN','Syntax\n------\n\nRETURN expr\n\nThe RETURN statement terminates execution of a stored function and returns the\nvalue expr to the function caller. There must be at least one RETURN statement\nin a stored function. If the function has multiple exit points, all exit\npoints must have a RETURN.\n\nThis statement is not used in stored procedures, triggers, or events. LEAVE\ncan be used instead.\n\nThe following example shows that RETURN can return the result of a scalar\nsubquery:\n\nCREATE FUNCTION users_count() RETURNS BOOL\n READS SQL DATA\nBEGIN\n RETURN (SELECT COUNT(DISTINCT User) FROM mysql.user);\nEND;\n\n\n\nURL: mariadb.com/kb/en/return/','','https://mariadb.com/kb/en/return/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (319,23,'SELECT INTO','Syntax\n------\n\nSELECT col_name [, col_name] ...\n INTO var_name [, var_name] ...\n table_expr\n\nDescription\n-----------\n\nSELECT ... INTO enables selected columns to be stored directly into variables.\nNo resultset is produced. The query should return a single row. If the query\nreturns no rows, a warning with error code 1329 occurs (No data), and the\nvariable values remain unchanged. If the query returns multiple rows, error\n1172 occurs (Result consisted of more than one row). If it is possible that\nthe statement may retrieve multiple rows, you can use LIMIT 1 to limit the\nresult set to a single row.\n\nThe INTO clause can also be specified at the end of the statement.\n\nIn the context of such statements that occur as part of events executed by the\nEvent Scheduler, diagnostics messages (not only errors, but also warnings) are\nwritten to the error log, and, on Windows, to the application event log.\n\nThis statement can be used with both local variables and user-defined\nvariables.\n\nFor the complete syntax, see SELECT.\n\nAnother way to set a variable\'s value is the SET statement.\n\nSELECT ... INTO results are not stored in the query cache even if SQL_CACHE is\nspecified.\n\nExamples\n--------\n\nSELECT id, data INTO @x,@y \nFROM test.t1 LIMIT 1;\n\n\n\nURL: mariadb.com/kb/en/selectinto/','','https://mariadb.com/kb/en/selectinto/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (320,23,'SIGNAL','Syntax\n------\n\nSIGNAL error_condition\n [SET error_property\n [, error_property] ...]\n\nerror_condition:\n SQLSTATE [VALUE] \'sqlstate_value\'\n | condition_name\n\nerror_property:\n error_property_name = <error_property_value>\n\nerror_property_name:\n CLASS_ORIGIN\n | SUBCLASS_ORIGIN\n | MESSAGE_TEXT\n | MYSQL_ERRNO\n | CONSTRAINT_CATALOG\n | CONSTRAINT_SCHEMA\n | CONSTRAINT_NAME\n | CATALOG_NAME\n | SCHEMA_NAME\n | TABLE_NAME\n | COLUMN_NAME\n | CURSOR_NAME\n\nSIGNAL empties the diagnostics area and produces a custom error. This\nstatement can be used anywhere, but is generally useful when used inside a\nstored program. When the error is produced, it can be caught by a HANDLER. If\nnot, the current stored program, or the current statement, will terminate with\nthe specified error.\n\nSometimes an error HANDLER just needs to SIGNAL the same error it received,\noptionally with some changes. Usually the RESIGNAL statement is the most\nconvenient way to do this.\n\nerror_condition can be an SQLSTATE value or a named error condition defined\nvia DECLARE CONDITION. SQLSTATE must be a constant string consisting of five\ncharacters. These codes are standard to ODBC and ANSI SQL. For customized\nerrors, the recommended SQLSTATE is \'45000\'. For a list of SQLSTATE values\nused by MariaDB, see the MariaDB Error Codes page. The SQLSTATE can be read\nvia the API method mysql_sqlstate( ).\n\nTo specify error properties user-defined variables and local variables can be\nused, as well as character set conversions (but you can\'t set a collation).\n\nThe error properties, their type and their default values are explained in the\ndiagnostics area page.\n\nErrors\n------\n\nIf the SQLSTATE is not valid, the following error like this will be produced:\n\nERROR 1407 (42000): Bad SQLSTATE: \'123456\'\n\nIf a property is specified more than once, an error like this will be produced:\n\nERROR 1641 (42000): Duplicate condition information item \'MESSAGE_TEXT\'\n\nIf you specify a condition name which is not declared, an error like this will\nbe produced:\n\nERROR 1319 (42000): Undefined CONDITION: cond_name\n\nIf MYSQL_ERRNO is out of range, you will get an error like this:\n\nERROR 1231 (42000): Variable \'MYSQL_ERRNO\' can\'t be set to the value of \'0\'\n\nExamples\n--------\n\nHere\'s what happens if SIGNAL is used in the client to generate errors:\n\nSIGNAL SQLSTATE \'01000\';\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n\n+---------+------+------------------------------------------+\n| Level | Code | Message |\n+---------+------+------------------------------------------+\n| Warning | 1642 | Unhandled user-defined warning condition |\n+---------+------+------------------------------------------+\n1 row in set (0.06 sec)\n\nSIGNAL SQLSTATE \'02000\';\nERROR 1643 (02000): Unhandled user-defined not found condition\n\nHow to specify MYSQL_ERRNO and MESSAGE_TEXT properties:\n\nSIGNAL SQLSTATE \'45000\' SET MYSQL_ERRNO=30001, MESSAGE_TEXT=\'H\nello, world!\';\n\nERROR 30001 (45000): Hello, world!\n\nThe following code shows how to use user variables, local variables and\ncharacter set conversion with SIGNAL:\n\nCREATE PROCEDURE test_error(x INT)\nBEGIN\n DECLARE errno SMALLINT UNSIGNED DEFAULT 31001;\n SET @errmsg = \'Hello, world!\';\n IF x = 1 THEN\n SIGNAL SQLSTATE \'45000\' SET\n MYSQL_ERRNO = errno,\n MESSAGE_TEXT = @errmsg;\n ELSE\n SIGNAL SQLSTATE \'45000\' SET\n MYSQL_ERRNO = errno,\n MESSAGE_TEXT = _utf8\'Hello, world!\';\n END IF;\nEND;\n\nHow to use named error conditions:\n\nCREATE PROCEDURE test_error(n INT)\nBEGIN\n DECLARE `too_big` CONDITION FOR SQLSTATE \'45000\';\n IF n > 10 THEN\n SIGNAL `too_big`;\n END IF;\nEND;\n\nIn this example, we\'ll define a HANDLER for an error code. When the error\noccurs, we SIGNAL a more informative error which makes sense for our procedure:\n\nCREATE PROCEDURE test_error()\nBEGIN\n DECLARE EXIT HANDLER\n FOR 1146\n BEGIN\n SIGNAL SQLSTATE \'45000\' SET\n MESSAGE_TEXT = \'Temporary tables not found; did you call init()\nprocedure?\';\n END;\n -- this will produce a 1146 error\n SELECT `c` FROM `temptab`;\nEND;\n\n\n\nURL: mariadb.com/kb/en/signal/','','https://mariadb.com/kb/en/signal/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (321,23,'WHILE','Syntax\n------\n\n[begin_label:] WHILE search_condition DO\n statement_list\nEND WHILE [end_label]\n\nDescription\n-----------\n\nThe statement list within a WHILE statement is repeated as long as the\nsearch_condition is true. statement_list consists of one or more statements.\nIf the loop must be executed at least once, REPEAT ... LOOP can be used\ninstead.\n\nA WHILE statement can be labeled. end_label cannot be given unless begin_label\nalso is present. If both are present, they must be the same.\n\nExamples\n--------\n\nCREATE PROCEDURE dowhile()\nBEGIN\n DECLARE v1 INT DEFAULT 5;\n\nWHILE v1 > 0 DO\n ...\n SET v1 = v1 - 1;\n END WHILE;\nEND\n\n\n\nURL: mariadb.com/kb/en/while/','','https://mariadb.com/kb/en/while/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (322,24,'BUFFER','A synonym for ST_BUFFER.\n\n\n\nURL: mariadb.com/kb/en/buffer/','','https://mariadb.com/kb/en/buffer/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (323,24,'CONVEXHULL','A synonym for ST_CONVEXHULL.\n\n\n\nURL: mariadb.com/kb/en/convexhull/','','https://mariadb.com/kb/en/convexhull/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (324,24,'GEOMETRYCOLLECTION','Syntax\n------\n\nGeometryCollection(g1,g2,...)\n\nDescription\n-----------\n\nConstructs a WKB GeometryCollection. If any argument is not a well-formed WKB\nrepresentation of a geometry, the return value is NULL.\n\nExamples\n--------\n\nCREATE TABLE gis_geometrycollection (g GEOMETRYCOLLECTION);\nSHOW FIELDS FROM gis_geometrycollection;\nINSERT INTO gis_geometrycollection VALUES\n (GeomCollFromText(\'GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10\n10))\')),\n (GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6),\nLineString(Point(3, 6), Point(7, 9)))))),\n (GeomFromText(\'GeometryCollection()\')),\n (GeomFromText(\'GeometryCollection EMPTY\'));\n\n\n\nURL: mariadb.com/kb/en/geometrycollection/','','https://mariadb.com/kb/en/geometrycollection/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (325,24,'LINESTRING','Syntax\n------\n\nLineString(pt1,pt2,...)\n\nDescription\n-----------\n\nConstructs a WKB LineString value from a number of WKB Point arguments. If any\nargument is not a WKB Point, the return value is NULL. If the number of Point\narguments is less than two, the return value is NULL.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT AsText(EndPoint(GeomFromText(@ls)));\n+-------------------------------------+\n| AsText(EndPoint(GeomFromText(@ls))) |\n+-------------------------------------+\n| POINT(3 3) |\n+-------------------------------------+\n\nCREATE TABLE gis_line (g LINESTRING);\nINSERT INTO gis_line VALUES\n (LineFromText(\'LINESTRING(0 0,0 10,10 0)\')),\n (LineStringFromText(\'LINESTRING(10 10,20 10,20 20,10 20,10 10)\')),\n (LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));\n\n\n\nURL: mariadb.com/kb/en/linestring/','','https://mariadb.com/kb/en/linestring/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (326,24,'MULTILINESTRING','Syntax\n------\n\nMultiLineString(ls1,ls2,...)\n\nDescription\n-----------\n\nConstructs a WKB MultiLineString value using WKB LineString arguments. If any\nargument is not a WKB LineString, the return value is NULL.\n\nExample\n-------\n\nCREATE TABLE gis_multi_line (g MULTILINESTRING);\nINSERT INTO gis_multi_line VALUES\n (MultiLineStringFromText(\'MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16\n48))\')),\n (MLineFromText(\'MULTILINESTRING((10 48,10 21,10 0))\')),\n (MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), \n Point(3, 5)), LineString(Point(2, 5),Point(5, 8),Point(21, 7))))));\n\n\n\nURL: mariadb.com/kb/en/multilinestring/','','https://mariadb.com/kb/en/multilinestring/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (327,24,'MULTIPOINT','Syntax\n------\n\nMultiPoint(pt1,pt2,...)\n\nDescription\n-----------\n\nConstructs a WKB MultiPoint value using WKB Point arguments. If any argument\nis not a WKB Point, the return value is NULL.\n\nExamples\n--------\n\nSET @g = ST_GEOMFROMTEXT(\'MultiPoint( 1 1, 2 2, 5 3, 7 2, 9 3, 8 4, 6 6, 6 9,\n4 9, 1 5 )\');\n\nCREATE TABLE gis_multi_point (g MULTIPOINT);\nINSERT INTO gis_multi_point VALUES\n (MultiPointFromText(\'MULTIPOINT(0 0,10 10,10 20,20 20)\')),\n (MPointFromText(\'MULTIPOINT(1 1,11 11,11 21,21 21)\')),\n (MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10)))));\n\n\n\nURL: mariadb.com/kb/en/multipoint/','','https://mariadb.com/kb/en/multipoint/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (328,24,'MULTIPOLYGON','Syntax\n------\n\nMultiPolygon(poly1,poly2,...)\n\nDescription\n-----------\n\nConstructs a WKB MultiPolygon value from a set of WKB Polygon arguments. If\nany argument is not a WKB Polygon, the return value is NULL.\n\nExample\n-------\n\nCREATE TABLE gis_multi_polygon (g MULTIPOLYGON);\nINSERT INTO gis_multi_polygon VALUES\n (MultiPolygonFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52\n18,66 23,73 9,48 6,52 18)),\n ((59 18,67 18,67 13,59 13,59 18)))\')),\n (MPolyFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66\n23,73 9,48 6,52 18)),\n ((59 18,67 18,67 13,59 13,59 18)))\')),\n (MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(\n Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))));\n\n\n\nURL: mariadb.com/kb/en/multipolygon/','','https://mariadb.com/kb/en/multipolygon/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (329,24,'POINT','Syntax\n------\n\nPoint(x,y)\n\nDescription\n-----------\n\nConstructs a WKB Point using the given coordinates.\n\nExamples\n--------\n\nSET @g = ST_GEOMFROMTEXT(\'Point(1 1)\');\n\nCREATE TABLE gis_point (g POINT);\nINSERT INTO gis_point VALUES\n (PointFromText(\'POINT(10 10)\')),\n (PointFromText(\'POINT(20 10)\')),\n (PointFromText(\'POINT(20 20)\')),\n (PointFromWKB(AsWKB(PointFromText(\'POINT(10 20)\'))));\n\n\n\nURL: mariadb.com/kb/en/point/','','https://mariadb.com/kb/en/point/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (330,24,'PointOnSurface','A synonym for ST_PointOnSurface.\n\n\n\nURL: mariadb.com/kb/en/pointonsurface/','','https://mariadb.com/kb/en/pointonsurface/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (331,24,'POLYGON','Syntax\n------\n\nPolygon(ls1,ls2,...)\n\nDescription\n-----------\n\nConstructs a WKB Polygon value from a number of WKB LineString arguments. If\nany argument does not represent the WKB of a LinearRing (that is, not a closed\nand simple LineString) the return value is NULL.\n\nNote that according to the OpenGIS standard, a POLYGON should have exactly one\nExteriorRing and all other rings should lie within that ExteriorRing and thus\nbe the InteriorRings. Practically, however, some systems, including MariaDB\'s,\npermit polygons to have several \'ExteriorRings\'. In the case of there being\nmultiple, non-overlapping exterior rings ST_NUMINTERIORRINGS() will return 1.\n\nExamples\n--------\n\nSET @g = ST_GEOMFROMTEXT(\'POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1 1))\');\n\nCREATE TABLE gis_polygon (g POLYGON);\nINSERT INTO gis_polygon VALUES\n (PolygonFromText(\'POLYGON((10 10,20 10,20 20,10 20,10 10))\')),\n (PolyFromText(\'POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10\n20,10 10))\')),\n (PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30,\n30), Point(0, 0))))));\n\nNon-overlapping \'polygon\':\n\nSELECT ST_NumInteriorRings(ST_PolyFromText(\'POLYGON((0 0,10 0,10 10,0 10,0 0),\n (-1 -1,-5 -1,-5 -5,-1 -5,-1 -1))\')) AS NumInteriorRings;\n+------------------+\n| NumInteriorRings |\n+------------------+\n| 1 |\n+------------------+\n\n\n\nURL: mariadb.com/kb/en/polygon/','','https://mariadb.com/kb/en/polygon/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (332,24,'ST_BUFFER','Syntax\n------\n\nST_BUFFER(g1,r)\nBUFFER(g1,r)\n\nDescription\n-----------\n\nReturns a geometry that represents all points whose distance from geometry g1\nis less than or equal to distance, or radius, r.\n\nUses for this function could include creating for example a new geometry\nrepresenting a buffer zone around an island.\n\nBUFFER() is a synonym.\n\nExamples\n--------\n\nDetermining whether a point is within a buffer zone:\n\nSET @g1 = ST_GEOMFROMTEXT(\'POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'POINT(8 8)\');\n\nSELECT ST_WITHIN(@g2,ST_BUFFER(@g1,5));\n+---------------------------------+\n| ST_WITHIN(@g2,ST_BUFFER(@g1,5)) |\n+---------------------------------+\n| 1 |\n+---------------------------------+\n\nSELECT ST_WITHIN(@g2,ST_BUFFER(@g1,1));\n+---------------------------------+\n| ST_WITHIN(@g2,ST_BUFFER(@g1,1)) |\n+---------------------------------+\n| 0 |\n+---------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_buffer/','','https://mariadb.com/kb/en/st_buffer/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (333,24,'ST_CONVEXHULL','MariaDB starting with 10.1.2\n----------------------------\nST_ConvexHull() was introduced in MariaDB 10.1.2\n\nSyntax\n------\n\nST_ConvexHull(g)\nConvexHull(g)\n\nDescription\n-----------\n\nGiven a geometry, returns a geometry that is the minimum convex geometry\nenclosing all geometries within the set. Returns NULL if the geometry value is\nNULL or an empty value.\n\nST_ConvexHull() and ConvexHull() are synonyms.\n\nExamples\n--------\n\nThe ConvexHull of a single point is simply the single point:\n\nSET @g = ST_GEOMFROMTEXT(\'Point(0 0)\');\n\nSELECT ST_ASTEXT(ST_CONVEXHULL(@g));\n+------------------------------+\n| ST_ASTEXT(ST_CONVEXHULL(@g)) |\n+------------------------------+\n| POINT(0 0) |\n+------------------------------+\n\nSET @g = ST_GEOMFROMTEXT(\'MultiPoint(0 0, 1 2, 2 3)\');\n\nSELECT ST_ASTEXT(ST_CONVEXHULL(@g));\n+------------------------------+\n| ST_ASTEXT(ST_CONVEXHULL(@g)) |\n+------------------------------+\n| POLYGON((0 0,1 2,2 3,0 0)) |\n+------------------------------+\n\nSET @g = ST_GEOMFROMTEXT(\'MultiPoint( 1 1, 2 2, 5 3, 7 2, 9 3, 8 4, 6 6, 6 9,\n4 9, 1 5 )\');\n\nSELECT ST_ASTEXT(ST_CONVEXHULL(@g));\n+----------------------------------------+\n| ST_ASTEXT(ST_CONVEXHULL(@g)) |\n+----------------------------------------+\n| POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1 1)) |\n+----------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_convexhull/','','https://mariadb.com/kb/en/st_convexhull/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (334,24,'ST_INTERSECTION','Syntax\n------\n\nST_INTERSECTION(g1,g2)\n\nDescription\n-----------\n\nReturns a geometry that is the intersection, or shared portion, of geometry g1\nand geometry g2.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 1)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 1, 0 2)\');\n\nSELECT ASTEXT(ST_INTERSECTION(@g1,@g2));\n+----------------------------------+\n| ASTEXT(ST_INTERSECTION(@g1,@g2)) |\n+----------------------------------+\n| POINT(2 1) |\n+----------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_intersection/','','https://mariadb.com/kb/en/st_intersection/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (335,24,'ST_POINTONSURFACE','MariaDB starting with 10.1.2\n----------------------------\nST_POINTONSURFACE() was introduced in MariaDB 10.1.2\n\nSyntax\n------\n\nST_PointOnSurface(g)\nPointOnSurface(g)\n\nDescription\n-----------\n\nGiven a geometry, returns a POINT guaranteed to intersect a surface. However,\nsee MDEV-7514.\n\nST_PointOnSurface() and PointOnSurface() are synonyms.\n\n\n\nURL: mariadb.com/kb/en/st_pointonsurface/','','https://mariadb.com/kb/en/st_pointonsurface/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (336,24,'ST_SYMDIFFERENCE','Syntax\n------\n\nST_SYMDIFFERENCE(g1,g2)\n\nDescription\n-----------\n\nReturns a geometry that represents the portions of geometry g1 and geometry g2\nthat don\'t intersect.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(10 20, 10 40)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(10 15, 10 25)\');\n\nSELECT ASTEXT(ST_SYMDIFFERENCE(@g1,@g2));\n+----------------------------------------------+\n| ASTEXT(ST_SYMDIFFERENCE(@g1,@g2)) |\n+----------------------------------------------+\n| MULTILINESTRING((10 15,10 20),(10 25,10 40)) |\n+----------------------------------------------+\n\nSET @g2 = ST_GeomFromText(\'LINESTRING(10 20, 10 41)\');\n\nSELECT ASTEXT(ST_SYMDIFFERENCE(@g1,@g2));\n+-----------------------------------+\n| ASTEXT(ST_SYMDIFFERENCE(@g1,@g2)) |\n+-----------------------------------+\n| LINESTRING(10 40,10 41) |\n+-----------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_symdifference/','','https://mariadb.com/kb/en/st_symdifference/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (337,24,'ST_UNION','Syntax\n------\n\nST_UNION(g1,g2)\n\nDescription\n-----------\n\nReturns a geometry that is the union of the geometry g1 and geometry g2.\n\nExamples\n--------\n\nSET @g1 = GEOMFROMTEXT(\'POINT (0 2)\');\n\nSET @g2 = GEOMFROMTEXT(\'POINT (2 0)\');\n\nSELECT ASTEXT(ST_UNION(@g1,@g2));\n+---------------------------+\n| ASTEXT(ST_UNION(@g1,@g2)) |\n+---------------------------+\n| MULTIPOINT(2 0,0 2) |\n+---------------------------+\n\nSET @g1 = GEOMFROMTEXT(\'POLYGON((0 0,0 3,3 3,3 0,0 0))\');\n\nSET @g2 = GEOMFROMTEXT(\'POLYGON((2 2,4 2,4 4,2 4,2 2))\');\n\nSELECT ASTEXT(ST_UNION(@g1,@g2));\n+------------------------------------------------+\n| ASTEXT(ST_UNION(@g1,@g2)) |\n+------------------------------------------------+\n| POLYGON((0 0,0 3,2 3,2 4,4 4,4 2,3 2,3 0,0 0)) |\n+------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_union/','','https://mariadb.com/kb/en/st_union/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (338,26,'BINLOG','Syntax\n------\n\nBINLOG \'str\'\n\nDescription\n-----------\n\nBINLOG is an internal-use statement. It is generated by the\nmariadb-binlog/mysqlbinlog program as the printable representation of certain\nevents in binary log files. The \'str\' value is a base 64-encoded string the\nthat server decodes to determine the data change indicated by the\ncorresponding event. This statement requires the SUPER privilege (<= MariaDB\n10.5.1) or theBINLOG REPLAY privilege (>= MariaDB 10.5.2).\n\n\n\nURL: mariadb.com/kb/en/binlog/','','https://mariadb.com/kb/en/binlog/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (339,26,'CACHE INDEX','Syntax\n------\n\nCACHE INDEX \n tbl_index_list [, tbl_index_list] ...\n IN key_cache_name\n\ntbl_index_list:\n tbl_name [[INDEX|KEY] (index_name[, index_name] ...)]\n\nDescription\n-----------\n\nThe CACHE INDEX statement assigns table indexes to a specific key cache. It is\nused only for MyISAM tables.\n\nA default key cache exists and cannot be destroyed. To create more key caches,\nthe key_buffer_size server system variable.\n\nThe associations between tables indexes and key caches are lost on server\nrestart. To recreate them automatically, it is necessary to configure caches\nin a configuration file and include some CACHE INDEX (and optionally LOAD\nINDEX) statements in the init file.\n\nExamples\n--------\n\nThe following statement assigns indexes from the tables t1, t2, and t3 to the\nkey cache named hot_cache:\n\nCACHE INDEX t1, t2, t3 IN hot_cache;\n+---------+--------------------+----------+----------+\n| Table | Op | Msg_type | Msg_text |\n+---------+--------------------+----------+----------+\n| test.t1 | assign_to_keycache | status | OK |\n| test.t2 | assign_to_keycache | status | OK |\n| test.t3 | assign_to_keycache | status | OK |\n+---------+--------------------+----------+----------+\n\nImplementation (for MyISAM)\n---------------------------\n\nNormally CACHE INDEX should not take a long time to execute. Internally it\'s\nimplemented the following way:\n\n* Find the right key cache (under LOCK_global_system_variables)\n* Open the table with a TL_READ_NO_INSERT lock.\n* Flush the original key cache for the given file (under key cache lock)\n* Flush the new key cache for the given file (safety)\n* Move the file to the new key cache (under file share lock)\n\nThe only possible long operations are getting the locks for the table and\nflushing the original key cache, if there were many key blocks for the file in\nit.\n\nWe plan to also add CACHE INDEX for Aria tables if there is a need for this.\n\n\n\nURL: mariadb.com/kb/en/cache-index/','','https://mariadb.com/kb/en/cache-index/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (340,26,'FLUSH','Syntax\n------\n\nFLUSH [NO_WRITE_TO_BINLOG | LOCAL]\n flush_option [, flush_option] ...\n\nor when flushing tables:\n\nFLUSH [NO_WRITE_TO_BINLOG | LOCAL] TABLES [table_list] [table_flush_option]\n\nwhere table_list is a list of tables separated by , (comma).\n\nDescription\n-----------\n\nThe FLUSH statement clears or reloads various internal caches used by MariaDB.\nTo execute FLUSH, you must have the RELOAD privilege. See GRANT.\n\nThe RESET statement is similar to FLUSH. See RESET.\n\nYou cannot issue a FLUSH statement from within a stored function or a trigger.\nDoing so within a stored procedure is permitted, as long as it is not called\nby a stored function or trigger. See Stored Routine Limitations, Stored\nFunction Limitations and Trigger Limitations.\n\nIf a listed table is a view, an error like the following will be produced:\n\nERROR 1347 (HY000): \'test.v\' is not BASE TABLE\n\nBy default, FLUSH statements are written to the binary log and will be\nreplicated. The NO_WRITE_TO_BINLOG keyword (LOCAL is an alias) will ensure the\nstatement is not written to the binary log.\n\nThe different flush options are:\n\n+---------------------------+-------------------------------------------------+\n| Option | Description |\n+---------------------------+-------------------------------------------------+\n| CHANGED_PAGE_BITMAPS | XtraDB only. Internal command used for backup |\n| | purposes. See the Information Schema |\n| | CHANGED_PAGE_BITMAPS Table. |\n+---------------------------+-------------------------------------------------+\n| CLIENT_STATISTICS | Reset client statistics (see SHOW |\n| | CLIENT_STATISTICS). |\n+---------------------------+-------------------------------------------------+\n| DES_KEY_FILE | Reloads the DES key file (Specified with the |\n| | --des-key-file startup option). |\n+---------------------------+-------------------------------------------------+\n| HOSTS | Flush the hostname cache (used for converting |\n| | ip to host names and for unblocking blocked |\n| | hosts. See max_connect_errors) |\n+---------------------------+-------------------------------------------------+\n| INDEX_STATISTICS | Reset index statistics (see SHOW |\n| | INDEX_STATISTICS). |\n+---------------------------+-------------------------------------------------+\n| [ERROR | ENGINE | | Close and reopen the specified log type, or |\n| GENERAL | SLOW | BINARY | all log types if none are specified. FLUSH |\n| | RELAY] LOGS | RELAY LOGS [connection-name] can be used to |\n| | flush the relay logs for a specific |\n| | connection. Only one connection can be |\n| | specified per FLUSH command. See Multi-source |\n| | replication. FLUSH ENGINE LOGS will delete all |\n| | unneeded Aria redo logs. Since MariaDB 10.1.30 |\n| | and MariaDB 10.2.11, FLUSH BINARY LOGS |\n| | DELETE_DOMAIN_ID=(list-of-domains) can be used |\n| | to discard obsolete GTID domains from the |\n| | server\'s binary log state. In order for this |\n| | to be successful, no event group from the |\n| | listed GTID domains can be present in existing |\n| | binary log files. If some still exist, then |\n| | they must be purged prior to executing this |\n| | command. If the command completes |\n| | successfully, then it also rotates the binary |\n| | log. |\n+---------------------------+-------------------------------------------------+\n| MASTER | Deprecated option, use RESET MASTER instead. |\n+---------------------------+-------------------------------------------------+\n| PRIVILEGES | Reload all privileges from the privilege |\n| | tables in the mysql database. If the server is |\n| | started with --skip-grant-table option, this |\n| | will activate the privilege tables again. |\n+---------------------------+-------------------------------------------------+\n| QUERY CACHE | Defragment the query cache to better utilize |\n| | its memory. If you want to reset the query |\n| | cache, you can do it with RESET QUERY CACHE. |\n+---------------------------+-------------------------------------------------+\n| QUERY_RESPONSE_TIME | See the QUERY_RESPONSE_TIME plugin. |\n+---------------------------+-------------------------------------------------+\n| SLAVE | Deprecated option, use RESET REPLICA or RESET |\n| | SLAVE instead. |\n+---------------------------+-------------------------------------------------+\n| SSL | Used to dynamically reinitialize the server\'s |\n| | TLS context by reloading the files defined by |\n| | several TLS system variables. See FLUSH SSL |\n| | for more information. This command was first |\n| | added in MariaDB 10.4.1. |\n+---------------------------+-------------------------------------------------+\n| STATUS | Resets all server status variables that can be |\n| | reset to 0. Not all global status variables |\n| | support this, so not all global values are |\n| | reset. See FLUSH STATUS for more information. |\n+---------------------------+-------------------------------------------------+\n| TABLE | Close tables given as options or all open |\n| | tables if no table list was used. From MariaDB |\n| | 10.4.1, using without any table list will only |\n| | close tables not in use, and tables not locked |\n| | by the FLUSH TABLES connection. If there are |\n| | no locked tables, FLUSH TABLES will be instant |\n| | and will not cause any waits, as it no longer |\n| | waits for tables in use. When a table list is |\n| | provided, from MariaDB 10.4.1, the server will |\n| | wait for the end of any transactions that are |\n| | using the tables. Previously, FLUSH TABLES |\n| | only waited for the statements to complete. |\n+---------------------------+-------------------------------------------------+\n| TABLES | Same as FLUSH TABLE. |\n+---------------------------+-------------------------------------------------+\n| TABLES ... FOR EXPORT | For InnoDB tables, flushes table changes to |\n| | disk to permit binary table copies while the |\n| | server is running. See FLUSH TABLES ... FOR |\n| | EXPORT for more. |\n+---------------------------+-------------------------------------------------+\n| TABLES WITH READ LOCK | Closes all open tables. New tables are only |\n| | allowed to be opened with read locks until an |\n| | UNLOCK TABLES is given. |\n+---------------------------+-------------------------------------------------+\n| TABLES WITH READ LOCK | As TABLES WITH READ LOCK but also disable all |\n| AND DISABLE CHECKPOINT | checkpoint writes by transactional table |\n| | engines. This is useful when doing a disk |\n| | snapshot of all tables. |\n+---------------------------+-------------------------------------------------+\n| TABLE_STATISTICS | Reset table statistics (see SHOW |\n| | TABLE_STATISTICS). |\n+---------------------------+-------------------------------------------------+\n| USER_RESOURCES | Resets all per hour user resources. This |\n| | enables clients that have exhausted their |\n| | resources to connect again. |\n+---------------------------+-------------------------------------------------+\n| USER_STATISTICS | Reset user statistics (see SHOW |\n| | USER_STATISTICS). |\n+---------------------------+-------------------------------------------------+\n| USER_VARIABLES | Reset user variables (see User-defined |\n| | variables). |\n+---------------------------+-------------------------------------------------+\n\nYou can also use the mysqladmin client to flush things. Use mysqladmin --help\nto examine what flush commands it supports.\n\nFLUSH RELAY LOGS\n----------------\n\nFLUSH RELAY LOGS \'connection_name\';\n\nCompatibility with MySQL\n------------------------\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after the FLUSH command.\n\nFor example, one can now use:\n\nFLUSH RELAY LOGS FOR CHANNEL \'connection_name\';\n\nFLUSH STATUS\n------------\n\nServer status variables can be reset by executing the following:\n\nFLUSH STATUS;\n\nGlobal Status Variables that Support FLUSH STATUS\n-------------------------------------------------\n\nNot all global status variables support being reset by FLUSH STATUS.\nCurrently, the following status variables are reset by FLUSH STATUS:\n\n* Aborted_clients\n* Aborted_connects\n* Binlog_cache_disk_use\n* Binlog_cache_use\n* Binlog_stmt_cache_disk_use\n* Binlog_stmt_cache_use\n* Connection_errors_accept\n* Connection_errors_internal\n* Connection_errors_max_connections\n* Connection_errors_peer_address\n* Connection_errors_select\n* Connection_errors_tcpwrap\n* Created_tmp_files\n* Delayed_errors\n* Delayed_writes\n* Feature_check_constraint\n* Feature_delay_key_write\n* Max_used_connections\n* Opened_plugin_libraries\n* Performance_schema_accounts_lost\n* Performance_schema_cond_instances_lost\n* Performance_schema_digest_lost\n* Performance_schema_file_handles_lost\n* Performance_schema_file_instances_lost\n* Performance_schema_hosts_lost\n* Performance_schema_locker_lost\n* Performance_schema_mutex_instances_lost\n* Performance_schema_rwlock_instances_lost\n* Performance_schema_session_connect_attrs_lost\n* Performance_schema_socket_instances_lost\n* Performance_schema_stage_classes_lost\n* Performance_schema_statement_classes_lost\n* Performance_schema_table_handles_lost\n* Performance_schema_table_instances_lost\n* Performance_schema_thread_instances_lost\n* Performance_schema_users_lost\n* Qcache_hits\n* Qcache_inserts\n* Qcache_lowmem_prunes\n* Qcache_not_cached\n* Rpl_semi_sync_master_no_times\n* Rpl_semi_sync_master_no_tx\n* Rpl_semi_sync_master_timefunc_failures\n* Rpl_semi_sync_master_wait_pos_backtraverse\n* Rpl_semi_sync_master_yes_tx\n* Rpl_transactions_multi_engine\n* Server_audit_writes_failed\n* Slave_retried_transactions\n* Slow_launch_threads\n* Ssl_accept_renegotiates\n* Ssl_accepts\n* Ssl_callback_cache_hits\n* Ssl_client_connects\n* Ssl_connect_renegotiates\n* Ssl_ctx_verify_depth\n* Ssl_ctx_verify_mode\n* Ssl_finished_accepts\n* Ssl_finished_connects\n* Ssl_session_cache_hits\n* Ssl_session_cache_misses\n* Ssl_session_cache_overflows\n* Ssl_session_cache_size\n* Ssl_session_cache_timeouts\n* Ssl_sessions_reused\n* Ssl_used_session_cache_entries\n* Subquery_cache_hit\n* Subquery_cache_miss\n* Table_locks_immediate\n* Table_locks_waited\n* Tc_log_max_pages_used\n* Tc_log_page_waits\n* Transactions_gtid_foreign_engine\n* Transactions_multi_engine\n\nThe different usage of FLUSH TABLES\n-----------------------------------\n\nThe purpose of FLUSH TABLES\n---------------------------\n\nThe purpose of FLUSH TABLES is to clean up the open table cache and table\ndefinition cache from not in use tables. This frees up memory and file\ndescriptors. Normally this is not needed as the caches works on a FIFO bases,\nbut can be useful if the server seams to use up to much memory for some reason.\n\nThe purpose of FLUSH TABLES WITH READ LOCK \n-------------------------------------------\n\nFLUSH TABLES WITH READ LOCK is useful if you want to take a backup of some\ntables. When FLUSH TABLES WITH READ LOCK returns, all write access to tables\nare blocked and all tables are marked as \'properly closed\' on disk. The tables\ncan still be used for read operations.\n\nThe purpose of FLUSH TABLES table_list\n--------------------------------------\n\nFLUSH TABLES table_list is useful if you want to copy a table object/files to\nor from the server. This command puts a lock that stops new users of the table\nand will wait until everyone has stopped using the table. The table is then\nremoved from the table definition and table cache.\n\nNote that it\'s up to the user to ensure that no one is accessing the table\nbetween FLUSH TABLES and the table is copied to or from the server. This can\nbe secured by using LOCK TABLES.\n\nIf there are any tables locked by the connection that is using FLUSH TABLES\nall the locked tables will be closed as part of the flush and reopened and\nrelocked before FLUSH TABLES returns. This allows one to copy the table after\nFLUSH TABLES returns without having any writes on the table. For now this\nworks works with most tables, except InnoDB as InnoDB may do background purges\non the table even while it\'s write locked.\n\nThe purpose of FLUSH TABLES table_list WITH READ LOCK\n-----------------------------------------------------\n\nFLUSH TABLES table_list WITH READ LOCK should work as FLUSH TABLES WITH READ\nLOCK, but only those tables that are listed will be properly closed. However\nin practice this works exactly like FLUSH TABLES WITH READ LOCK as the FLUSH\ncommand has anyway to wait for all WRITE operations to end because we are\ndepending on a global read lock for this code. In the future we should\nconsider fixing this to instead use meta data locks.\n\nImplementation of FLUSH TABLES commands in MariaDB 10.4.8 and above\n-------------------------------------------------------------------\n\nImplementation of FLUSH TABLES\n------------------------------\n\n* Free memory and file descriptors not in use\n\nImplementation of FLUSH TABLES WITH READ LOCK\n---------------------------------------------\n\n* Lock all tables read only for simple old style backup.\n* All background writes are suspended and tables are marked as closed.\n* No statement requiring table changes are allowed for any user until UNLOCK\nTABLES.\n\nInstead of using FLUSH TABLE WITH READ LOCK one should in most cases instead\nuse BACKUP STAGE BLOCK_COMMIT.\n\nImplementation of FLUSH TABLES table_list\n-----------------------------------------\n\n* Free memory and file descriptors for tables not in use from table list.\n* Lock given tables as read only.\n* Wait until all translations has ended that uses any of the given tables.\n* Wait until all background writes are suspended and tables are marked as\nclosed.\n\nImplementation of FLUSH TABLES table_list FOR EXPORT\n----------------------------------------------------\n\n* Free memory and file descriptors for tables not in use from table list\n* Lock given tables as read.\n* Wait until all background writes are suspended and tables are marked as\nclosed.\n* Check that all tables supports FOR EXPORT\n* No changes to these tables allowed until UNLOCK TABLES\n\nThis is basically the same behavior as in old MariaDB version if one first\nlock the tables, then do FLUSH TABLES. The tables will be copyable until\nUNLOCK TABLES.\n\nFLUSH SSL\n---------\n\nMariaDB starting with 10.4\n--------------------------\nThe FLUSH SSL command was first added in MariaDB 10.4.\n\nIn MariaDB 10.4 and later, the FLUSH SSL command can be used to dynamically\nreinitialize the server\'s TLS context. This is most useful if you need to\nreplace a certificate that is about to expire without restarting the server.\n\nThis operation is performed by reloading the files defined by the following\nTLS system variables:\n\n* ssl_cert\n* ssl_key\n* ssl_ca\n* ssl_capath\n* ssl_crl\n* ssl_crlpath\n\nThese TLS system variables are not dynamic, so their values can not be changed\nwithout restarting the server.\n\nIf you want to dynamically reinitialize the server\'s TLS context, then you\nneed to change the certificate and key files at the relevant paths defined by\nthese TLS system variables, without actually changing the values of the\nvariables. See MDEV-19341 for more information.\n\nReducing Memory Usage\n---------------------\n\nTo flush some of the global caches that take up memory, you could execute the\nfollowing command:\n\nFLUSH LOCAL HOSTS,\n QUERY CACHE,\n TABLE_STATISTICS,\n INDEX_STATISTICS,\n USER_STATISTICS;\n\n\n\nURL: mariadb.com/kb/en/flush/','','https://mariadb.com/kb/en/flush/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (341,26,'FLUSH QUERY CACHE','Description\n-----------\n\nYou can defragment the query cache to better utilize its memory with the FLUSH\nQUERY CACHE statement. The statement does not remove any queries from the\ncache.\n\nThe RESET QUERY CACHE statement removes all query results from the query\ncache. The FLUSH TABLES statement also does this.\n\n\n\nURL: mariadb.com/kb/en/flush-query-cache/','','https://mariadb.com/kb/en/flush-query-cache/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (342,26,'FLUSH TABLES FOR EXPORT','Syntax\n------\n\nFLUSH TABLES table_name [, table_name] FOR EXPORT\n\nDescription\n-----------\n\nFLUSH TABLES ... FOR EXPORT flushes changes to the specified tables to disk so\nthat binary copies can be made while the server is still running. This works\nfor Archive, Aria, CSV, InnoDB, MyISAM, MERGE, and XtraDB tables.\n\nThe table is read locked until one has issued UNLOCK TABLES.\n\nIf a storage engine does not support FLUSH TABLES FOR EXPORT, a 1031 error\n(SQLSTATE \'HY000\') is produced.\n\nIf FLUSH TABLES ... FOR EXPORT is in effect in the session, the following\nstatements will produce an error if attempted:\n\n* FLUSH TABLES WITH READ LOCK\n* FLUSH TABLES ... WITH READ LOCK\n* FLUSH TABLES ... FOR EXPORT\n* Any statement trying to update any table\n\nIf any of the following statements is in effect in the session, attempting\nFLUSH TABLES ... FOR EXPORT will produce an error.\n\n* FLUSH TABLES ... WITH READ LOCK\n* FLUSH TABLES ... FOR EXPORT\n* LOCK TABLES ... READ\n* LOCK TABLES ... WRITE\n\nFLUSH FOR EXPORT is not written to the binary log.\n\nThis statement requires the RELOAD and the LOCK TABLES privileges.\n\nIf one of the specified tables cannot be locked, none of the tables will be\nlocked.\n\nIf a table does not exist, an error like the following will be produced:\n\nERROR 1146 (42S02): Table \'test.xxx\' doesn\'t exist\n\nIf a table is a view, an error like the following will be produced:\n\nERROR 1347 (HY000): \'test.v\' is not BASE TABLE\n\nExample\n-------\n\nFLUSH TABLES test.t1 FOR EXPORT;\n# Copy files related to the table (see below)\nUNLOCK TABLES;\n\nFor a full description, please see copying MariaDB tables.\n\n\n\nURL: mariadb.com/kb/en/flush-tables-for-export/','','https://mariadb.com/kb/en/flush-tables-for-export/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (343,26,'HELP Command','Syntax\n------\n\nHELP search_string\n\nDescription\n-----------\n\nThe HELP command can be used in any MariaDB client, such as the mysql\ncommand-line client, to get basic syntax help and a short description for most\ncommands and functions.\n\nIf you provide an argument to the HELP command, the mysql client uses it as a\nsearch string to access server-side help. The proper operation of this command\nrequires that the help tables in the mysql database be initialized with help\ntopic information.\n\nIf there is no match for the search string, the search fails. Use HELP\ncontents to see a list of the help categories:\n\nHELP contents\nYou asked for help about help category: "Contents"\nFor more information, type \'help <item>\', where <item> is one of the following\ncategories:\n Account Management\n Administration\n Compound Statements\n Data Definition\n Data Manipulation\n Data Types\n Functions\n Functions and Modifiers for Use with GROUP BY\n Geographic Features\n Help Metadata\n Language Structure\n Plugins\n Procedures\n Sequences\n Table Maintenance\n Transactions\n User-Defined Functions\n Utility\n\nIf a search string matches multiple items, MariaDB shows a list of matching\ntopics:\n\nHELP drop\nMany help items for your request exist.\nTo make a more specific request, please type \'help <item>\',\nwhere <item> is one of the following\ntopics:\n ALTER TABLE\n DROP DATABASE\n DROP EVENT\n DROP FUNCTION\n DROP FUNCTION UDF\n DROP INDEX\n DROP PACKAGE\n DROP PACKAGE BODY\n DROP PROCEDURE\n DROP ROLE\n DROP SEQUENCE\n DROP SERVER\n DROP TABLE\n DROP TRIGGER\n DROP USER\n DROP VIEW\n\nThen you can enter a topic as the search string to see the help entry for that\ntopic.\n\nThe help is provided with the MariaDB server and makes use of four help tables\nfound in the mysql database: help_relation, help_topic, help_category and\nhelp_keyword. These tables are populated by the mysql_install_db or\nfill_help_table.sql scripts which, until MariaDB 10.4.7, contain data\ngenerated from an old version of MySQL.\n\n\n\nURL: mariadb.com/kb/en/help-command/','','https://mariadb.com/kb/en/help-command/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (344,26,'KILL [CONNECTION | QUERY]','Syntax\n------\n\nKILL [HARD | SOFT] { {CONNECTION|QUERY} thread_id | QUERY ID query_id | USER\nuser_name }\n\nDescription\n-----------\n\nEach connection to mysqld runs in a separate thread. You can see which threads\nare running with the SHOW PROCESSLIST statement and kill a thread with the\nKILL thread_id statement. KILL allows the optional CONNECTION or\nQUERY modifier:\n\n* KILL CONNECTION is the same as KILL with no\n modifier: It terminates the connection associated with the given thread or\nquery id.\n* KILL QUERY terminates the statement that the connection thread_id is\n currently executing, but leaves the connection itself intact.\n* KILL QUERY ID terminates the query by query_id, leaving the connection\nintact.\n\nIf a connection is terminated that has an active transaction, the transaction\nwill be rolled back. If only a query is killed, the current transaction will\nstay active. See also idle_transaction_timeout.\n\nIf you have the PROCESS privilege, you can see all threads. If you have the\nSUPER privilege, or, from MariaDB 10.5.2, the CONNECTION ADMIN privilege, you\ncan kill all threads and statements. Otherwise, you can see and kill only your\nown threads and statements.\n\nKilling queries that repair or create indexes on MyISAM and Aria tables may\nresult in corrupted tables. Use the SOFT option to avoid this!\n\nThe HARD option (default) kills a command as soon as possible. If you use\nSOFT, then critical operations that may leave a table in an inconsistent state\nwill not be interrupted. Such operations include REPAIR and INDEX creation for\nMyISAM and Aria tables (REPAIR TABLE, OPTIMIZE TABLE).\n\nKILL ... USER username will kill all connections/queries for a given user.\nUSER can be specified one of the following ways:\n\n* username (Kill without regard to hostname)\n* username@hostname\n* CURRENT_USER or CURRENT_USER()\n\nIf you specify a thread id and that thread does not exist, you get the\nfollowing error:\n\nERROR 1094 (HY000): Unknown thread id: <thread_id>\n\nIf you specify a query id that doesn\'t exist, you get the following error:\n\nERROR 1957 (HY000): Unknown query id: <query_id>\n\nHowever, if you specify a user name, no error is issued for non-connected (or\neven non-existing) users. To check if the connection/query has been killed,\nyou can use the ROW_COUNT() function.\n\nA client whose connection is killed receives the following error:\n\nERROR 1317 (70100): Query execution was interrupted\n\nTo obtain a list of existing sessions, use the SHOW PROCESSLIST statement or\nquery the Information Schema PROCESSLIST table.\n\nNote: You cannot use KILL with the Embedded MySQL Server library because the\nembedded server merely runs inside the threads of the host application. It\ndoes not create any connection threads of its own.\n\nNote: You can also use mysqladmin kill thread_id [,thread_id...] to kill\nconnections. To get a list of running queries, use mysqladmin processlist. See\nmysqladmin.\n\nPercona Toolkit contains a program, pt-kill that can be used to automatically\nkill connections that match certain criteria. For example, it can be used to\nterminate idle connections, or connections that have been busy for more than\n60 seconds.\n\n\n\nURL: mariadb.com/kb/en/data-manipulation-kill-connection-query/','','https://mariadb.com/kb/en/data-manipulation-kill-connection-query/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (345,26,'LOAD INDEX','Syntax\n------\n\nLOAD INDEX INTO CACHE\n tbl_index_list [, tbl_index_list] ...\n\ntbl_index_list:\n tbl_name\n [[INDEX|KEY] (index_name[, index_name] ...)]\n [IGNORE LEAVES]\n\nDescription\n-----------\n\nThe LOAD INDEX INTO CACHE statement preloads a table index into the key cache\nto which it has been assigned by an explicit CACHE INDEX statement, or into\nthe default key cache otherwise. LOAD INDEX INTO CACHE is used only for MyISAM\nor Aria tables.\n\nThe IGNORE LEAVES modifier causes only blocks for the nonleaf nodes of the\nindex to be preloaded.\n\n\n\nURL: mariadb.com/kb/en/load-index/','','https://mariadb.com/kb/en/load-index/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (346,26,'RESET','Syntax\n------\n\nRESET reset_option [, reset_option] ...\n\nDescription\n-----------\n\nThe RESET statement is used to clear the state of various server operations.\nYou must have the RELOAD privilege to execute RESET.\n\nRESET acts as a stronger version of the FLUSH statement.\n\nThe different RESET options are:\n\n+---------------------------+-------------------------------------------------+\n| Option | Description |\n+---------------------------+-------------------------------------------------+\n| SLAVE | Deletes all relay logs from the slave and |\n| ["connection_name"] [ALL] | reset the replication position in the master |\n| | binary log. |\n+---------------------------+-------------------------------------------------+\n| MASTER | Deletes all old binary logs, makes the binary |\n| | index file (--log-bin-index) empty and creates |\n| | a new binary log file. This is useful when |\n| | you want to reset the master to an initial |\n| | state. If you want to just delete old, not |\n| | used binary logs, you should use the PURGE |\n| | BINARY LOGS command. |\n+---------------------------+-------------------------------------------------+\n| QUERY CACHE | Removes all queries from the query cache. See |\n| | also FLUSH QUERY CACHE. |\n+---------------------------+-------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/reset/','','https://mariadb.com/kb/en/reset/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (347,26,'SET','Syntax\n------\n\nSET variable_assignment [, variable_assignment] ...\n\nvariable_assignment:\n user_var_name = expr\n | [GLOBAL | SESSION] system_var_name = expr\n | [@@global. | @@session. | @@]system_var_name = expr\n\nOne can also set a user variable in any expression with this syntax:\n\nuser_var_name:= expr\n\nDescription\n-----------\n\nThe SET statement assigns values to different types of variables that affect\nthe operation of the server or your client. Older versions of MySQL employed\nSET OPTION, but this syntax was deprecated in favor of SET without OPTION, and\nwas removed in MariaDB 10.0.\n\nChanging a system variable by using the SET statement does not make the change\npermanently. To do so, the change must be made in a configuration file.\n\nFor setting variables on a per-query basis, see SET STATEMENT.\n\nSee SHOW VARIABLES for documentation on viewing server system variables.\n\nSee Server System Variables for a list of all the system variables.\n\nGLOBAL / SESSION\n----------------\n\nWhen setting a system variable, the scope can be specified as either GLOBAL or\nSESSION.\n\nA global variable change affects all new sessions. It does not affect any\ncurrently open sessions, including the one that made the change.\n\nA session variable change affects the current session only.\n\nIf the variable has a session value, not specifying either GLOBAL or SESSION\nwill be the same as specifying SESSION. If the variable only has a global\nvalue, not specifying GLOBAL or SESSION will apply to the change to the global\nvalue.\n\nDEFAULT\n-------\n\nSetting a global variable to DEFAULT will restore it to the server default,\nand setting a session variable to DEFAULT will restore it to the current\nglobal value.\n\nExamples\n--------\n\n* innodb_sync_spin_loops is a global variable.\n* skip_parallel_replication is a session variable.\n* max_error_count is both global and session.\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE \n VARIABLE_NAME IN (\'max_error_count\', \'skip_parallel_replication\',\n\'innodb_sync_spin_loops\');\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT | 64 | 64 |\n| SKIP_PARALLEL_REPLICATION | OFF | NULL |\n| INNODB_SYNC_SPIN_LOOPS | NULL | 30 |\n+---------------------------+---------------+--------------+\n\nSetting the session values:\n\nSET max_error_count=128;Query OK, 0 rows affected (0.000 sec)\n\nSET skip_parallel_replication=ON;Query OK, 0 rows affected (0.000 sec)\n\nSET innodb_sync_spin_loops=60;\nERROR 1229 (HY000): Variable \'innodb_sync_spin_loops\' is a GLOBAL variable \n and should be set with SET GLOBAL\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE \n VARIABLE_NAME IN (\'max_error_count\', \'skip_parallel_replication\',\n\'innodb_sync_spin_loops\');\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT | 128 | 64 |\n| SKIP_PARALLEL_REPLICATION | ON | NULL |\n| INNODB_SYNC_SPIN_LOOPS | NULL | 30 |\n+---------------------------+---------------+--------------+\n\nSetting the global values:\n\nSET GLOBAL max_error_count=256;\n\nSET GLOBAL skip_parallel_replication=ON;\nERROR 1228 (HY000): Variable \'skip_parallel_replication\' is a SESSION variable \n and can\'t be used with SET GLOBAL\n\nSET GLOBAL innodb_sync_spin_loops=120;\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE \n VARIABLE_NAME IN (\'max_error_count\', \'skip_parallel_replication\',\n\'innodb_sync_spin_loops\');\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT | 128 | 256 |\n| SKIP_PARALLEL_REPLICATION | ON | NULL |\n| INNODB_SYNC_SPIN_LOOPS | NULL | 120 |\n+---------------------------+---------------+--------------+\n\nSHOW VARIABLES will by default return the session value unless the variable is\nglobal only.\n\nSHOW VARIABLES LIKE \'max_error_count\';\n+-----------------+-------+\n| Variable_name | Value |\n+-----------------+-------+\n| max_error_count | 128 |\n+-----------------+-------+\n\nSHOW VARIABLES LIKE \'skip_parallel_replication\';\n+---------------------------+-------+\n| Variable_name | Value |\n+---------------------------+-------+\n| skip_parallel_replication | ON |\n+---------------------------+-------+\n\nSHOW VARIABLES LIKE \'innodb_sync_spin_loops\';\n+------------------------+-------+\n| Variable_name | Value |\n+------------------------+-------+\n| innodb_sync_spin_loops | 120 |\n+------------------------+-------+\n\nUsing the inplace syntax:\n\nSELECT (@a:=1);\n+---------+\n| (@a:=1) |\n+---------+\n| 1 |\n+---------+\n\nSELECT @a;\n+------+\n| @a |\n+------+\n| 1 |\n+------+\n\n\n\nURL: mariadb.com/kb/en/set/','','https://mariadb.com/kb/en/set/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (348,26,'About SHOW','SHOW has many forms that provide information about databases, tables,\ncolumns, or status information about the server. These include:\n\n* SHOW AUTHORS\n* SHOW CHARACTER SET [like_or_where]\n* SHOW COLLATION [like_or_where]\n* SHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where]\n* SHOW CONTRIBUTORS\n* SHOW CREATE DATABASE db_name\n* SHOW CREATE EVENT event_name\n* SHOW CREATE PACKAGE package_name\n* SHOW CREATE PACKAGE BODY package_name\n* SHOW CREATE PROCEDURE proc_name\n* SHOW CREATE TABLE tbl_name\n* SHOW CREATE TRIGGER trigger_name\n* SHOW CREATE VIEW view_name\n* SHOW DATABASES [like_or_where]\n* SHOW ENGINE engine_name {STATUS | MUTEX}\n* SHOW [STORAGE] ENGINES\n* SHOW ERRORS [LIMIT [offset,] row_count]\n* SHOW [FULL] EVENTS\n* SHOW FUNCTION CODE func_name\n* SHOW FUNCTION STATUS [like_or_where]\n* SHOW GRANTS FOR user\n* SHOW INDEX FROM tbl_name [FROM db_name]\n* SHOW INNODB STATUS\n* SHOW OPEN TABLES [FROM db_name] [like_or_where]\n* SHOW PLUGINS\n* SHOW PROCEDURE CODE proc_name\n* SHOW PROCEDURE STATUS [like_or_where]\n* SHOW PRIVILEGES\n* SHOW [FULL] PROCESSLIST\n* SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]\n* SHOW PROFILES\n* SHOW [GLOBAL | SESSION] STATUS [like_or_where]\n* SHOW TABLE STATUS [FROM db_name] [like_or_where]\n* SHOW TABLES [FROM db_name] [like_or_where]\n* SHOW TRIGGERS [FROM db_name] [like_or_where]\n* SHOW [GLOBAL | SESSION] VARIABLES [like_or_where]\n* SHOW WARNINGS [LIMIT [offset,] row_count]\n\nlike_or_where:\n LIKE \'pattern\'\n | WHERE expr\n\nIf the syntax for a given SHOW statement includes a LIKE \'pattern\' part,\n\'pattern\' is a string that can contain the SQL "%" and "_" wildcard\ncharacters. The pattern is useful for restricting statement output to matching\nvalues.\n\nSeveral SHOW statements also accept a WHERE clause that provides more\nflexibility in specifying which rows to display. See Extended Show.\n\n\n\nURL: mariadb.com/kb/en/about-show/','','https://mariadb.com/kb/en/about-show/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (349,26,'SHOW AUTHORS','Syntax\n------\n\nSHOW AUTHORS\n\nDescription\n-----------\n\nThe SHOW AUTHORS statement displays information about the people who work on\nMariaDB. For each author, it displays Name, Location, and Comment values. All\ncolumns are encoded as latin1.\n\nThese include:\n\n* First the active people in MariaDB are listed.\n* Then the active people in MySQL.\n* Last the people that have contributed to MariaDB/MySQL in the past.\n\nThe order is somewhat related to importance of the contribution given to the\nMariaDB project, but this is not 100% accurate. There is still room for\nimprovement and debate...\n\nExample\n-------\n\nSHOW AUTHORS\G\n*************************** 1. row ***************************\n Name: Michael (Monty) Widenius\nLocation: Tusby, Finland\n Comment: Lead developer and main author\n*************************** 2. row ***************************\n Name: Sergei Golubchik\nLocation: Kerpen, Germany\n Comment: Architect, Full-text search, precision math, plugin framework,\nmerges etc\n*************************** 3. row ***************************\n Name: Igor Babaev\nLocation: Bellevue, USA\n Comment: Optimizer, keycache, core work\n*************************** 4. row ***************************\n Name: Sergey Petrunia\nLocation: St. Petersburg, Russia\n Comment: Optimizer\n*************************** 5. row ***************************\n Name: Oleksandr Byelkin\nLocation: Lugansk, Ukraine\n Comment: Query Cache (4.0), Subqueries (4.1), Views (5.0)\n*************************** 6. row ***************************\n Name: Timour Katchaounov\nLocation: Sofia , Bulgaria\n Comment: Optimizer\n*************************** 7. row ***************************\n Name: Kristian Nielsen\nLocation: Copenhagen, Denmark\n Comment: Replication, Async client prototocol, General buildbot stuff\n*************************** 8. row ***************************\n Name: Alexander (Bar) Barkov\nLocation: Izhevsk, Russia\n Comment: Unicode and character sets\n*************************** 9. row ***************************\n Name: Alexey Botchkov (Holyfoot)\nLocation: Izhevsk, Russia\n Comment: GIS extensions, embedded server, precision math\n*************************** 10. row ***************************\n Name: Daniel Bartholomew\nLocation: Raleigh, USA\n Comment: MariaDB documentation, Buildbot, releases\n*************************** 11. row ***************************\n Name: Colin Charles\nLocation: Selangor, Malesia\n Comment: MariaDB documentation, talks at a LOT of conferences\n*************************** 12. row ***************************\n Name: Sergey Vojtovich\nLocation: Izhevsk, Russia\n Comment: initial implementation of plugin architecture, maintained native\nstorage engines (MyISAM, MEMORY, ARCHIVE, etc), rewrite of table cache\n*************************** 13. row ***************************\n Name: Vladislav Vaintroub\nLocation: Mannheim, Germany\n Comment: MariaDB Java connector, new thread pool, Windows optimizations\n*************************** 14. row ***************************\n Name: Elena Stepanova\nLocation: Sankt Petersburg, Russia\n Comment: QA, test cases\n*************************** 15. row ***************************\n Name: Georg Richter\nLocation: Heidelberg, Germany\n Comment: New LGPL C connector, PHP connector\n*************************** 16. row ***************************\n Name: Jan Lindström\nLocation: Ylämylly, Finland\n Comment: Working on InnoDB\n*************************** 17. row ***************************\n Name: Lixun Peng\nLocation: Hangzhou, China\n Comment: Multi Source replication\n*************************** 18. row ***************************\n Name: Olivier Bertrand\nLocation: Paris, France\n Comment: CONNECT storage engine\n*************************** 19. row ***************************\n Name: Kentoku Shiba\nLocation: Tokyo, Japan\n Comment: Spider storage engine, metadata_lock_info Information schema\n*************************** 20. row ***************************\n Name: Percona\nLocation: CA, USA\n Comment: XtraDB, microslow patches, extensions to slow log\n*************************** 21. row ***************************\n Name: Vicentiu Ciorbaru\nLocation: Bucharest, Romania\n Comment: Roles\n*************************** 22. row ***************************\n Name: Sudheera Palihakkara\nLocation: \n Comment: PCRE Regular Expressions\n*************************** 23. row ***************************\n Name: Pavel Ivanov\nLocation: USA\n Comment: Some patches and bug fixes\n*************************** 24. row ***************************\n Name: Konstantin Osipov\nLocation: Moscow, Russia\n Comment: Prepared statements (4.1), Cursors (5.0), GET_LOCK (10.0)\n*************************** 25. row ***************************\n Name: Ian Gilfillan\nLocation: South Africa\n Comment: MariaDB documentation\n*************************** 26. row ***************************\n Name: Federico Razolli\nLocation: Italy\n Comment: MariaDB documentation Italian translation\n*************************** 27. row ***************************\n Name: Guilhem Bichot\nLocation: Bordeaux, France\n Comment: Replication (since 4.0)\n*************************** 28. row ***************************\n Name: Andrei Elkin\nLocation: Espoo, Finland\n Comment: Replication\n*************************** 29. row ***************************\n Name: Dmitri Lenev\nLocation: Moscow, Russia\n Comment: Time zones support (4.1), Triggers (5.0)\n*************************** 30. row ***************************\n Name: Marc Alff\nLocation: Denver, CO, USA\n Comment: Signal, Resignal, Performance schema\n*************************** 31. row ***************************\n Name: Mikael Ronström\nLocation: Stockholm, Sweden\n Comment: NDB Cluster, Partitioning, online alter table\n*************************** 32. row ***************************\n Name: Ingo Strüwing\nLocation: Berlin, Germany\n Comment: Bug fixing in MyISAM, Merge tables etc\n*************************** 33. row ***************************\n Name: Marko Mäkelä\nLocation: Helsinki, Finland\n Comment: InnoDB core developer\n...\n\n\n\nURL: mariadb.com/kb/en/show-authors/','','https://mariadb.com/kb/en/show-authors/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (350,26,'SHOW BINARY LOGS','Syntax\n------\n\nSHOW BINARY LOGS\nSHOW MASTER LOGS\n\nDescription\n-----------\n\nLists the binary log files on the server. This statement is used as part of\nthe procedure described in PURGE BINARY LOGS, that shows how to determine\nwhich logs can be purged.\n\nThis statement requires the SUPER privilege, the REPLICATION_CLIENT privilege,\nor, from MariaDB 10.5.2, the BINLOG MONITOR privilege.\n\nExamples\n--------\n\nSHOW BINARY LOGS;\n+--------------------+-----------+\n| Log_name | File_size |\n+--------------------+-----------+\n| mariadb-bin.000001 | 19039 |\n| mariadb-bin.000002 | 717389 |\n| mariadb-bin.000003 | 300 |\n| mariadb-bin.000004 | 333 |\n| mariadb-bin.000005 | 899 |\n| mariadb-bin.000006 | 125 |\n| mariadb-bin.000007 | 18907 |\n| mariadb-bin.000008 | 19530 |\n| mariadb-bin.000009 | 151 |\n| mariadb-bin.000010 | 151 |\n| mariadb-bin.000011 | 125 |\n| mariadb-bin.000012 | 151 |\n| mariadb-bin.000013 | 151 |\n| mariadb-bin.000014 | 125 |\n| mariadb-bin.000015 | 151 |\n| mariadb-bin.000016 | 314 |\n+--------------------+-----------+\n\n\n\nURL: mariadb.com/kb/en/show-binary-logs/','','https://mariadb.com/kb/en/show-binary-logs/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (351,26,'SHOW BINLOG EVENTS','Syntax\n------\n\nSHOW BINLOG EVENTS\n [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\n\nDescription\n-----------\n\nShows the events in the binary log. If you do not specify \'log_name\', the\nfirst binary log is displayed.\n\nRequires the BINLOG MONITOR privilege (>= MariaDB 10.5.2) or the REPLICATION\nSLAVE privilege (<= MariaDB 10.5.1).\n\nExample\n-------\n\nSHOW BINLOG EVENTS IN \'mysql_sandbox10019-bin.000002\';\n+-------------------------------+-----+-------------------+-----------+--------\n----+------------------------------------------------+\n| Log_name | Pos | Event_type | Server_id |\nEnd_log_pos | Info |\n+-------------------------------+-----+-------------------+-----------+--------\n----+------------------------------------------------+\n| mysql_sandbox10019-bin.000002 | 4 | Format_desc | 1 | \n 248 | Server ver: 10.0.19-MariaDB-log, Binlog ver: 4 |\n| mysql_sandbox10019-bin.000002 | 248 | Gtid_list | 1 | \n 273 | [] |\n| mysql_sandbox10019-bin.000002 | 273 | Binlog_checkpoint | 1 | \n 325 | mysql_sandbox10019-bin.000002 |\n| mysql_sandbox10019-bin.000002 | 325 | Gtid | 1 | \n 363 | GTID 0-1-1 |\n| mysql_sandbox10019-bin.000002 | 363 | Query | 1 | \n 446 | CREATE DATABASE blog |\n| mysql_sandbox10019-bin.000002 | 446 | Gtid | 1 | \n 484 | GTID 0-1-2 |\n| mysql_sandbox10019-bin.000002 | 484 | Query | 1 | \n 571 | use `blog`; CREATE TABLE bb (id INT) |\n+-------------------------------+-----+-------------------+-----------+--------\n----+------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/show-binlog-events/','','https://mariadb.com/kb/en/show-binlog-events/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (352,26,'SHOW CHARACTER SET','Syntax\n------\n\nSHOW CHARACTER SET\n [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThe SHOW CHARACTER SET statement shows all available character sets. The LIKE\nclause, if present on its own, indicates which character set names to match.\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nThe same information can be queried from the Information Schema CHARACTER_SETS\ntable.\n\nSee Setting Character Sets and Collations for details on specifying the\ncharacter set at the server, database, table and column levels.\n\nExamples\n--------\n\nSHOW CHARACTER SET LIKE \'latin%\';\n+---------+-----------------------------+-------------------+--------+\n| Charset | Description | Default collation | Maxlen |\n+---------+-----------------------------+-------------------+--------+\n| latin1 | cp1252 West European | latin1_swedish_ci | 1 |\n| latin2 | ISO 8859-2 Central European | latin2_general_ci | 1 |\n| latin5 | ISO 8859-9 Turkish | latin5_turkish_ci | 1 |\n| latin7 | ISO 8859-13 Baltic | latin7_general_ci | 1 |\n+---------+-----------------------------+-------------------+--------+\n\nSHOW CHARACTER SET WHERE Maxlen LIKE \'2\';\n+---------+---------------------------+-------------------+--------+\n| Charset | Description | Default collation | Maxlen |\n+---------+---------------------------+-------------------+--------+\n| big5 | Big5 Traditional Chinese | big5_chinese_ci | 2 |\n| sjis | Shift-JIS Japanese | sjis_japanese_ci | 2 |\n| euckr | EUC-KR Korean | euckr_korean_ci | 2 |\n| gb2312 | GB2312 Simplified Chinese | gb2312_chinese_ci | 2 |\n| gbk | GBK Simplified Chinese | gbk_chinese_ci | 2 |\n| ucs2 | UCS-2 Unicode | ucs2_general_ci | 2 |\n| cp932 | SJIS for Windows Japanese | cp932_japanese_ci | 2 |\n+---------+---------------------------+-------------------+--------+\n\n\n\nURL: mariadb.com/kb/en/show-character-set/','','https://mariadb.com/kb/en/show-character-set/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (353,26,'SHOW CLIENT_STATISTICS','Syntax\n------\n\nSHOW CLIENT_STATISTICS\n\nDescription\n-----------\n\nThe SHOW CLIENT_STATISTICS statement is part of the User Statistics feature.\nIt was removed as a separate statement in MariaDB 10.1.1, but effectively\nreplaced by the generic SHOW information_schema_table statement. The\ninformation_schema.CLIENT_STATISTICS table holds statistics about client\nconnections.\n\nThe userstat system variable must be set to 1 to activate this feature. See\nthe User Statistics and information_schema.CLIENT_STATISTICS articles for more\ninformation.\n\nExample\n-------\n\nSHOW CLIENT_STATISTICS\G\n*************************** 1. row ***************************\n Client: localhost\n Total_connections: 35\nConcurrent_connections: 0\n Connected_time: 708\n Busy_time: 2.5557979999999985\n Cpu_time: 0.04123740000000002\n Bytes_received: 3883\n Bytes_sent: 21595\n Binlog_bytes_written: 0\n Rows_read: 18\n Rows_sent: 115\n Rows_deleted: 0\n Rows_inserted: 0\n Rows_updated: 0\n Select_commands: 70\n Update_commands: 0\n Other_commands: 0\n Commit_transactions: 1\n Rollback_transactions: 0\n Denied_connections: 0\n Lost_connections: 0\n Access_denied: 0\n Empty_queries: 35\n\n\n\nURL: mariadb.com/kb/en/show-client-statistics/','','https://mariadb.com/kb/en/show-client-statistics/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (354,26,'SHOW COLLATION','Syntax\n------\n\nSHOW COLLATION\n [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThe output from SHOW COLLATION includes all available collations. The LIKE\nclause, if present on its own, indicates which collation names to match. The\nWHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nThe same information can be queried from the Information Schema COLLATIONS\ntable.\n\nSee Setting Character Sets and Collations for details on specifying the\ncollation at the server, database, table and column levels.\n\nExamples\n--------\n\nSHOW COLLATION LIKE \'latin1%\';\n+-------------------+---------+----+---------+----------+---------+\n| Collation | Charset | Id | Default | Compiled | Sortlen |\n+-------------------+---------+----+---------+----------+---------+\n| latin1_german1_ci | latin1 | 5 | | Yes | 1 |\n| latin1_swedish_ci | latin1 | 8 | Yes | Yes | 1 |\n| latin1_danish_ci | latin1 | 15 | | Yes | 1 |\n| latin1_german2_ci | latin1 | 31 | | Yes | 2 |\n| latin1_bin | latin1 | 47 | | Yes | 1 |\n| latin1_general_ci | latin1 | 48 | | Yes | 1 |\n| latin1_general_cs | latin1 | 49 | | Yes | 1 |\n| latin1_spanish_ci | latin1 | 94 | | Yes | 1 |\n+-------------------+---------+----+---------+----------+---------+\n\nSHOW COLLATION WHERE Sortlen LIKE \'8\' AND Charset LIKE \'utf8\';\n+--------------------+---------+-----+---------+----------+---------+\n| Collation | Charset | Id | Default | Compiled | Sortlen |\n+--------------------+---------+-----+---------+----------+---------+\n| utf8_unicode_ci | utf8 | 192 | | Yes | 8 |\n| utf8_icelandic_ci | utf8 | 193 | | Yes | 8 |\n| utf8_latvian_ci | utf8 | 194 | | Yes | 8 |\n| utf8_romanian_ci | utf8 | 195 | | Yes | 8 |\n| utf8_slovenian_ci | utf8 | 196 | | Yes | 8 |\n| utf8_polish_ci | utf8 | 197 | | Yes | 8 |\n| utf8_estonian_ci | utf8 | 198 | | Yes | 8 |\n| utf8_spanish_ci | utf8 | 199 | | Yes | 8 |\n| utf8_swedish_ci | utf8 | 200 | | Yes | 8 |\n| utf8_turkish_ci | utf8 | 201 | | Yes | 8 |\n| utf8_czech_ci | utf8 | 202 | | Yes | 8 |\n| utf8_danish_ci | utf8 | 203 | | Yes | 8 |\n| utf8_lithuanian_ci | utf8 | 204 | | Yes | 8 |\n| utf8_slovak_ci | utf8 | 205 | | Yes | 8 |\n| utf8_spanish2_ci | utf8 | 206 | | Yes | 8 |\n| utf8_roman_ci | utf8 | 207 | | Yes | 8 |\n| utf8_persian_ci | utf8 | 208 | | Yes | 8 |\n| utf8_esperanto_ci | utf8 | 209 | | Yes | 8 |\n| utf8_hungarian_ci | utf8 | 210 | | Yes | 8 |\n| utf8_sinhala_ci | utf8 | 211 | | Yes | 8 |\n| utf8_croatian_ci | utf8 | 213 | | Yes | 8 |\n+--------------------+---------+-----+---------+----------+---------+\n\n\n\nURL: mariadb.com/kb/en/show-collation/','','https://mariadb.com/kb/en/show-collation/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (355,26,'SHOW COLUMNS','Syntax\n------\n\nSHOW [FULL] {COLUMNS | FIELDS} FROM tbl_name [FROM db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW COLUMNS displays information about the columns in a given table. It also\nworks for views. The LIKE clause, if present on its own, indicates which\ncolumn names to match. The WHERE and LIKE clauses can be given to select rows\nusing more general conditions, as discussed in Extended SHOW.\n\nIf the data types differ from what you expect them to be based on a CREATE\nTABLE statement, note that MariaDB sometimes changes data types when you\ncreate or alter a table. The conditions under which this occurs are described\nin the Silent Column Changes article.\n\nThe FULL keyword causes the output to include the column collation and\ncomments, as well as the privileges you have for each column.\n\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM db_name\nsyntax. In other words, these two statements are equivalent:\n\nSHOW COLUMNS FROM mytable FROM mydb;\nSHOW COLUMNS FROM mydb.mytable;\n\nSHOW COLUMNS displays the following values for each table column:\n\nField indicates the column name.\n\nType indicates the column data type.\n\nCollation indicates the collation for non-binary string columns, or NULL for\nother columns. This value is displayed only if you use the FULL keyword.\n\nThe Null field contains YES if NULL values can be stored in the column, NO if\nnot.\n\nThe Key field indicates whether the column is indexed:\n\n* If Key is empty, the column either is not indexed or is indexed only as a\n secondary column in a multiple-column, non-unique index.\n* If Key is PRI, the column is a PRIMARY KEY or\n is one of the columns in a multiple-column PRIMARY KEY.\n* If Key is UNI, the column is the first column of a unique-valued\n index that cannot contain NULL values.\n* If Key is MUL, multiple occurrences of a given value are allowed\n within the column. The column is the first column of a non-unique index or a\n unique-valued index that can contain NULL values.\n\nIf more than one of the Key values applies to a given column of a table, Key\ndisplays the one with the highest priority, in the order PRI, UNI, MUL.\n\nA UNIQUE index may be displayed as PRI if it cannot contain NULL values and\nthere is no PRIMARY KEY in the table. A UNIQUE index may display as MUL if\nseveral columns form a composite UNIQUE index; although the combination of the\ncolumns is unique, each column can still hold multiple occurrences of a given\nvalue.\n\nThe Default field indicates the default value that is assigned to the column.\n\nThe Extra field contains any additional information that is available about a\ngiven column.\n\n+------------------------+----------------------------------------------------+\n| Value | Description |\n+------------------------+----------------------------------------------------+\n| AUTO_INCREMENT | The column was created with the AUTO_INCREMENT |\n| | keyword. |\n+------------------------+----------------------------------------------------+\n| PERSISTENT | The column was created with the PERSISTENT |\n| | keyword. (New in 5.3) |\n+------------------------+----------------------------------------------------+\n| VIRTUAL | The column was created with the VIRTUAL keyword. |\n| | (New in 5.3) |\n+------------------------+----------------------------------------------------+\n| on update | The column is a TIMESTAMP column that is |\n| CURRENT_TIMESTAMP | automatically updated on INSERT and UPDATE. |\n+------------------------+----------------------------------------------------+\n\nPrivileges indicates the privileges you have for the column. This value is\ndisplayed only if you use the FULL keyword.\n\nComment indicates any comment the column has. This value is displayed only if\nyou use the FULL keyword.\n\nSHOW FIELDS is a synonym for SHOW COLUMNS. Also DESCRIBE and EXPLAIN can be\nused as shortcuts.\n\nYou can also list a table\'s columns with:\n\nmysqlshow db_name tbl_name\n\nSee the mysqlshow command for more details.\n\nThe DESCRIBE statement provides information similar to SHOW COLUMNS. The\ninformation_schema.COLUMNS table provides similar, but more complete,\ninformation.\n\nThe SHOW CREATE TABLE, SHOW TABLE STATUS, and SHOW INDEX statements also\nprovide information about tables.\n\nExamples\n--------\n\nSHOW COLUMNS FROM city;\n+------------+----------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+------------+----------+------+-----+---------+----------------+\n| Id | int(11) | NO | PRI | NULL | auto_increment |\n| Name | char(35) | NO | | | |\n| Country | char(3) | NO | UNI | | |\n| District | char(20) | YES | MUL | | |\n| Population | int(11) | NO | | 0 | |\n+------------+----------+------+-----+---------+----------------+\n\nSHOW COLUMNS FROM employees WHERE Type LIKE \'Varchar%\';\n+---------------+-------------+------+-----+---------+-------+\n| Field | Type | Null | Key | Default | Extra |\n+---------------+-------------+------+-----+---------+-------+\n| first_name | varchar(30) | NO | MUL | NULL | |\n| last_name | varchar(40) | NO | | NULL | |\n| position | varchar(25) | NO | | NULL | |\n| home_address | varchar(50) | NO | | NULL | |\n| home_phone | varchar(12) | NO | | NULL | |\n| employee_code | varchar(25) | NO | UNI | NULL | |\n+---------------+-------------+------+-----+---------+-------+\n\n\n\nURL: mariadb.com/kb/en/show-columns/','','https://mariadb.com/kb/en/show-columns/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (356,26,'SHOW CONTRIBUTORS','Syntax\n------\n\nSHOW CONTRIBUTORS\n\nDescription\n-----------\n\nThe SHOW CONTRIBUTORS statement displays information about the companies and\npeople who financially contribute to MariaDB. For each contributor, it\ndisplays Name, Location, and Comment values. All columns are encoded as latin1.\n\nIt displays all members and sponsors of the MariaDB Foundation as well as\nother financial contributors.\n\nExample\n-------\n\nSHOW CONTRIBUTORS;\n+---------------------+-------------------------------+------------------------\n------------------------------------+\n| Name | Location | Comment \n |\n+---------------------+-------------------------------+------------------------\n------------------------------------+\n| Booking.com | https://www.booking.com | Founding member,\nPlatinum Sponsor of the MariaDB Foundation |\n| Alibaba Cloud | https://www.alibabacloud.com/ | Platinum Sponsor of\nthe MariaDB Foundation |\n| Tencent Cloud | https://cloud.tencent.com | Platinum Sponsor of\nthe MariaDB Foundation |\n| Microsoft | https://microsoft.com/ | Platinum Sponsor of\nthe MariaDB Foundation |\n| MariaDB Corporation | https://mariadb.com | Founding member,\nPlatinum Sponsor of the MariaDB Foundation |\n| Visma | https://visma.com | Gold Sponsor of the\nMariaDB Foundation |\n| DBS | https://dbs.com | Gold Sponsor of the\nMariaDB Foundation |\n| IBM | https://www.ibm.com | Gold Sponsor of the\nMariaDB Foundation |\n| Tencent Games | http://game.qq.com/ | Gold Sponsor of the\nMariaDB Foundation |\n| Nexedi | https://www.nexedi.com | Silver Sponsor of the\nMariaDB Foundation |\n| Acronis | https://www.acronis.com | Silver Sponsor of the\nMariaDB Foundation |\n| Verkkokauppa.com | https://www.verkkokauppa.com | Bronze Sponsor of the\nMariaDB Foundation |\n| Virtuozzo | https://virtuozzo.com | Bronze Sponsor of the\nMariaDB Foundation |\n| Tencent Game DBA | http://tencentdba.com/about | Bronze Sponsor of the\nMariaDB Foundation |\n| Tencent TDSQL | http://tdsql.org | Bronze Sponsor of the\nMariaDB Foundation |\n| Percona | https://www.percona.com/ | Bronze Sponsor of the\nMariaDB Foundation |\n| Google | USA | Sponsoring encryption,\nparallel replication and GTID |\n| Facebook | USA | Sponsoring\nnon-blocking API, LIMIT ROWS EXAMINED etc |\n| Ronald Bradford | Brisbane, Australia | EFF contribution for\nUC2006 Auction |\n| Sheeri Kritzer | Boston, Mass. USA | EFF contribution for\nUC2006 Auction |\n| Mark Shuttleworth | London, UK. | EFF contribution for\nUC2006 Auction |\n+---------------------+-------------------------------+------------------------\n------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/show-contributors/','','https://mariadb.com/kb/en/show-contributors/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (357,26,'SHOW CREATE DATABASE','Syntax\n------\n\nSHOW CREATE {DATABASE | SCHEMA} db_name\n\nDescription\n-----------\n\nShows the CREATE DATABASE statement that creates the given database. SHOW\nCREATE SCHEMA is a synonym for SHOW CREATE DATABASE. SHOW CREATE DATABASE\nquotes database names according to the value of the sql_quote_show_create\nserver system variable.\n\nExamples\n--------\n\nSHOW CREATE DATABASE test;\n+----------+-----------------------------------------------------------------+\n| Database | Create Database |\n+----------+-----------------------------------------------------------------+\n| test | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ |\n+----------+-----------------------------------------------------------------+\n\nSHOW CREATE SCHEMA test;\n+----------+-----------------------------------------------------------------+\n| Database | Create Database |\n+----------+-----------------------------------------------------------------+\n| test | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ |\n+----------+-----------------------------------------------------------------+\n\nWith sql_quote_show_create off:\n\nSHOW CREATE DATABASE test;\n+----------+---------------------------------------------------------------+\n| Database | Create Database |\n+----------+---------------------------------------------------------------+\n| test | CREATE DATABASE test /*!40100 DEFAULT CHARACTER SET latin1 */ |\n+----------+---------------------------------------------------------------+\n\nWith a comment, from MariaDB 10.5:\n\nSHOW CREATE DATABASE p;\n+----------+-------------------------------------------------------------------\n------------------+\n| Database | Create Database \n |\n+----------+-------------------------------------------------------------------\n------------------+\n| p | CREATE DATABASE `p` /*!40100 DEFAULT CHARACTER SET latin1 */\nCOMMENT \'presentations\' |\n+----------+-------------------------------------------------------------------\n------------------+\n\n\n\nURL: mariadb.com/kb/en/show-create-database/','','https://mariadb.com/kb/en/show-create-database/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (358,26,'SHOW CREATE EVENT','Syntax\n------\n\nSHOW CREATE EVENT event_name\n\nDescription\n-----------\n\nThis statement displays the CREATE EVENT statement needed to re-create a given\nevent, as well as the SQL_MODE that was used when the trigger has been created\nand the character set used by the connection. To find out which events are\npresent, use SHOW EVENTS.\n\nThe output of this statement is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n\nThe information_schema.EVENTS table provides similar, but more complete,\ninformation.\n\nExamples\n--------\n\nSHOW CREATE EVENT test.e_daily\G\n*************************** 1. row ***************************\n Event: e_daily\n sql_mode:\n time_zone: SYSTEM\n Create Event: CREATE EVENT `e_daily`\n ON SCHEDULE EVERY 1 DAY\n STARTS CURRENT_TIMESTAMP + INTERVAL 6 HOUR\n ON COMPLETION NOT PRESERVE\n ENABLE\n COMMENT \'Saves total number of sessions then\n clears the table each day\'\n DO BEGIN\n INSERT INTO site_activity.totals (time, total)\n SELECT CURRENT_TIMESTAMP, COUNT(*)\n FROM site_activity.sessions;\n DELETE FROM site_activity.sessions;\n END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\n\n\nURL: mariadb.com/kb/en/show-create-event/','','https://mariadb.com/kb/en/show-create-event/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (359,26,'SHOW CREATE FUNCTION','Syntax\n------\n\nSHOW CREATE FUNCTION func_name\n\nDescription\n-----------\n\nThis statement is similar to SHOW CREATE PROCEDURE but for stored functions.\n\nThe output of this statement is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n\nExample\n-------\n\nSHOW CREATE FUNCTION VatCents\G\n*************************** 1. row ***************************\n Function: VatCents\n sql_mode:\n Create Function: CREATE DEFINER=`root`@`localhost` FUNCTION\n`VatCents`(price DECIMAL(10,2)) RETURNS int(11)\n DETERMINISTIC\nBEGIN\n DECLARE x INT;\n SET x = price * 114;\n RETURN x;\nEND\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\n\n\nURL: mariadb.com/kb/en/show-create-function/','','https://mariadb.com/kb/en/show-create-function/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (360,26,'SHOW CREATE PACKAGE','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nSHOW CREATE PACKAGE [ db_name . ] package_name\n\nDescription\n-----------\n\nThe SHOW CREATE PACKAGE statement can be used when Oracle SQL_MODE is set.\n\nShows the CREATE statement that creates the given package specification.\n\nExamples\n--------\n\nSHOW CREATE PACKAGE employee_tools\G\n*************************** 1. row ***************************\n Package: employee_tools\n sql_mode:\nPIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS\nNO_FIELD_OPTIONS,NO_AUTO_CREATE_USER\n Create Package: CREATE DEFINER="root"@"localhost" PACKAGE\n"employee_tools" AS\n FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);\n PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));\n PROCEDURE raiseSalaryStd(eid INT);\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));\nEND\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\n\n\nURL: mariadb.com/kb/en/show-create-package/','','https://mariadb.com/kb/en/show-create-package/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (361,26,'SHOW CREATE PACKAGE BODY','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nSHOW CREATE PACKAGE BODY [ db_name . ] package_name\n\nDescription\n-----------\n\nThe SHOW CREATE PACKAGE BODY statement can be used when Oracle SQL_MODE is set.\n\nShows the CREATE statement that creates the given package body (i.e. the\nimplementation).\n\nExamples\n--------\n\nSHOW CREATE PACKAGE BODY employee_tools\G\n*************************** 1. row ***************************\n Package body: employee_tools\n sql_mode:\nPIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS\nNO_FIELD_OPTIONS,NO_AUTO_CREATE_USER\n Create Package Body: CREATE DEFINER="root"@"localhost" PACKAGE BODY\n"employee_tools" AS\n\nstdRaiseAmount DECIMAL(10,2):=500;\n\nPROCEDURE log (eid INT, ecmnt TEXT) AS\n BEGIN\n INSERT INTO employee_log (id, cmnt) VALUES (eid, ecmnt);\n END;\n\nPROCEDURE hire(ename TEXT, esalary DECIMAL(10,2)) AS\n eid INT;\n BEGIN\n INSERT INTO employee (name, salary) VALUES (ename, esalary);\n eid:= last_insert_id();\n log(eid, \'hire \' || ename);\n END;\n\nFUNCTION getSalary(eid INT) RETURN DECIMAL(10,2) AS\n nSalary DECIMAL(10,2);\n BEGIN\n SELECT salary INTO nSalary FROM employee WHERE id=eid;\n log(eid, \'getSalary id=\' || eid || \' salary=\' || nSalary);\n RETURN nSalary;\n END;\n\nPROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2)) AS\n BEGIN\n UPDATE employee SET salary=salary+amount WHERE id=eid;\n log(eid, \'raiseSalary id=\' || eid || \' amount=\' || amount);\n END;\n\nPROCEDURE raiseSalaryStd(eid INT) AS\n BEGIN\n raiseSalary(eid, stdRaiseAmount);\n log(eid, \'raiseSalaryStd id=\' || eid);\n END;\n\nBEGIN \n log(0, \'Session \' || connection_id() || \' \' || current_user || \' started\');\nEND\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\n\n\nURL: mariadb.com/kb/en/show-create-package-body/','','https://mariadb.com/kb/en/show-create-package-body/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (362,26,'SHOW CREATE PROCEDURE','Syntax\n------\n\nSHOW CREATE PROCEDURE proc_name\n\nDescription\n-----------\n\nThis statement is a MariaDB extension. It returns the exact string that can be\nused to re-create the named stored procedure, as well as the SQL_MODE that was\nused when the trigger has been created and the character set used by the\nconnection.. A similar statement, SHOW CREATE FUNCTION, displays information\nabout stored functions.\n\nBoth statements require that you are the owner of the routine or have the\nSELECT privilege on the mysql.proc table. When neither is true, the statements\ndisplay NULL for the Create Procedure or Create Function field.\n\nWarning Users with SELECT privileges on mysql.proc or USAGE privileges on *.*\ncan view the text of routines, even when they do not have privileges for the\nfunction or procedure itself.\n\nThe output of these statements is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n\nExamples\n--------\n\nHere\'s a comparison of the SHOW CREATE PROCEDURE and SHOW CREATE FUNCTION\nstatements.\n\nSHOW CREATE PROCEDURE test.simpleproc\G\n*************************** 1. row ***************************\n Procedure: simpleproc\n sql_mode:\n Create Procedure: CREATE PROCEDURE `simpleproc`(OUT param1 INT)\n BEGIN\n SELECT COUNT(*) INTO param1 FROM t;\n END\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nSHOW CREATE FUNCTION test.hello\G\n*************************** 1. row ***************************\n Function: hello\n sql_mode:\n Create Function: CREATE FUNCTION `hello`(s CHAR(20))\n RETURNS CHAR(50)\n RETURN CONCAT(\'Hello, \',s,\'!\')\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nWhen the user issuing the statement does not have privileges on the routine,\nattempting to CALL the procedure raises Error 1370.\n\nCALL test.prc1();\nError 1370 (42000): execute command denieed to user \'test_user\'@\'localhost\'\nfor routine \'test\'.\'prc1\'\n\nIf the user neither has privilege to the routine nor the SELECT privilege on\nmysql.proc table, it raises Error 1305, informing them that the procedure does\nnot exist.\n\nSHOW CREATE TABLES test.prc1\G\nError 1305 (42000): PROCEDURE prc1 does not exist\n\n\n\nURL: mariadb.com/kb/en/show-create-procedure/','','https://mariadb.com/kb/en/show-create-procedure/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (363,26,'SHOW CREATE SEQUENCE','MariaDB starting with 10.3.1\n----------------------------\nSequences were introduced in MariaDB 10.3.\n\nSyntax\n------\n\nSHOW CREATE SEQUENCE sequence_name;\n\nDescription\n-----------\n\nShows the CREATE SEQUENCE statement that created the given sequence. The\nstatement requires the SELECT privilege for the table.\n\nExample\n-------\n\nCREATE SEQUENCE s1 START WITH 50;\nSHOW CREATE SEQUENCE s1\G;\n*************************** 1. row ***************************\n Table: s1\nCreate Table: CREATE SEQUENCE `s1` start with 50 minvalue 1 maxvalue\n9223372036854775806 \n increment by 1 cache 1000 nocycle ENGINE=InnoDB\n\nNotes\n-----\n\nIf you want to see the underlying table structure used for the SEQUENCE you\ncan use SHOW CREATE TABLE on the SEQUENCE. You can also use SELECT to read the\ncurrent recorded state of the SEQUENCE:\n\nSHOW CREATE TABLE s1\G\n*************************** 1. row ***************************\n Table: s1\nCreate Table: CREATE TABLE `s1` (\n `next_not_cached_value` bigint(21) NOT NULL,\n `minimum_value` bigint(21) NOT NULL,\n `maximum_value` bigint(21) NOT NULL,\n `start_value` bigint(21) NOT NULL COMMENT \'start value when sequences is\ncreated \n or value if RESTART is used\',\n `increment` bigint(21) NOT NULL COMMENT \'increment value\',\n `cache_size` bigint(21) unsigned NOT NULL,\n `cycle_option` tinyint(1) unsigned NOT NULL COMMENT \'0 if no cycles are\nallowed, \n 1 if the sequence should begin a new cycle when maximum_value is passed\',\n `cycle_count` bigint(21) NOT NULL COMMENT \'How many cycles have been done\'\n) ENGINE=InnoDB SEQUENCE=1\n\nSELECT * FROM s1\G\n*************************** 1. row ***************************\nnext_not_cached_value: 50\n minimum_value: 1\n maximum_value: 9223372036854775806\n start_value: 50\n increment: 1\n cache_size: 1000\n cycle_option: 0\n cycle_count: 0\n\n\n\nURL: mariadb.com/kb/en/show-create-sequence/','','https://mariadb.com/kb/en/show-create-sequence/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (364,26,'SHOW CREATE TABLE','Syntax\n------\n\nSHOW CREATE TABLE tbl_name\n\nDescription\n-----------\n\nShows the CREATE TABLE statement that created the given table. The statement\nrequires the SELECT privilege for the table. This statement also works with\nviews and SEQUENCE.\n\nSHOW CREATE TABLE quotes table and column names according to the value of the\nsql_quote_show_create server system variable.\n\nCertain SQL_MODE values can result in parts of the original CREATE statement\nnot being included in the output. MariaDB-specific table options, column\noptions, and index options are not included in the output of this statement if\nthe NO_TABLE_OPTIONS, NO_FIELD_OPTIONS and NO_KEY_OPTIONS SQL_MODE flags are\nused. All MariaDB-specific table attributes are also not shown when a\nnon-MariaDB/MySQL emulation mode is used, which includes ANSI, DB2,\nPOSTGRESQL, MSSQL, MAXDB or ORACLE.\n\nInvalid table options, column options and index options are normally commented\nout (note, that it is possible to create a table with invalid options, by\naltering a table of a different engine, where these options were valid). To\nhave them uncommented, enable the IGNORE_BAD_TABLE_OPTIONS SQL_MODE. Remember\nthat replaying a CREATE TABLE statement with uncommented invalid options will\nfail with an error, unless the IGNORE_BAD_TABLE_OPTIONS SQL_MODE is in effect.\n\nNote that SHOW CREATE TABLE is not meant to provide metadata about a table. It\nprovides information about how the table was declared, but the real table\nstructure could differ a bit. For example, if an index has been declared as\nHASH, the CREATE TABLE statement returned by SHOW CREATE TABLE will declare\nthat index as HASH; however, it is possible that the index is in fact a BTREE,\nbecause the storage engine does not support HASH.\n\nMariaDB starting with 10.2.1\n----------------------------\nMariaDB 10.2.1 permits TEXT and BLOB data types to be assigned a DEFAULT\nvalue. As a result, from MariaDB 10.2.1, SHOW CREATE TABLE will append a\nDEFAULT NULL to nullable TEXT or BLOB fields if no specific default is\nprovided.\n\nMariaDB starting with 10.2.2\n----------------------------\nFrom MariaDB 10.2.2, numbers are no longer quoted in the DEFAULT clause in\nSHOW CREATE statement. Previously, MariaDB quoted numbers.\n\nExamples\n--------\n\nSHOW CREATE TABLE t\G\n*************************** 1. row ***************************\n Table: t\nCreate Table: CREATE TABLE `t` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `s` char(60) DEFAULT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nWith sql_quote_show_create off:\n\nSHOW CREATE TABLE t\G\n*************************** 1. row ***************************\n Table: t\nCreate Table: CREATE TABLE t (\n id int(11) NOT NULL AUTO_INCREMENT,\n s char(60) DEFAULT NULL,\n PRIMARY KEY (id)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nUnquoted numeric DEFAULTs, from MariaDB 10.2.2:\n\nCREATE TABLE td (link TINYINT DEFAULT 1);\n\nSHOW CREATE TABLE td\G\n*************************** 1. row ***************************\n Table: td\nCreate Table: CREATE TABLE `td` (\n `link` tinyint(4) DEFAULT 1\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nQuoted numeric DEFAULTs, until MariaDB 10.2.1:\n\nCREATE TABLE td (link TINYINT DEFAULT 1);\n\nSHOW CREATE TABLE td\G\n*************************** 1. row ***************************\n Table: td\nCreate Table: CREATE TABLE `td` (\n `link` tinyint(4) DEFAULT \'1\'\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nSQL_MODE impacting the output:\n\nSELECT @@sql_mode;\n+------------------------------------------------------------------------------\n------------+\n| @@sql_mode \n |\n+------------------------------------------------------------------------------\n------------+\n|\nSTRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SU\nSTITUTION |\n+------------------------------------------------------------------------------\n------------+\n\nCREATE TABLE `t1` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `msg` varchar(100) DEFAULT NULL,\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=latin1\n;\n\nSHOW CREATE TABLE t1\G\n*************************** 1. row ***************************\n Table: t1\nCreate Table: CREATE TABLE `t1` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `msg` varchar(100) DEFAULT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\n\nSET SQL_MODE=ORACLE;\n\nSHOW CREATE TABLE t1\G\n*************************** 1. row ***************************\n Table: t1\nCreate Table: CREATE TABLE "t1" (\n "id" int(11) NOT NULL,\n "msg" varchar(100) DEFAULT NULL,\n PRIMARY KEY ("id")\n\n\n\nURL: mariadb.com/kb/en/show-create-table/','','https://mariadb.com/kb/en/show-create-table/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (365,26,'SHOW CREATE TRIGGER','Syntax\n------\n\nSHOW CREATE TRIGGER trigger_name\n\nDescription\n-----------\n\nThis statement shows a CREATE TRIGGER statement that creates the given\ntrigger, as well as the SQL_MODE that was used when the trigger has been\ncreated and the character set used by the connection.\n\nThe output of this statement is unreliably affected by the\nsql_quote_show_create server system variable - see\nhttp://bugs.mysql.com/bug.php?id=12719\n\nExamples\n--------\n\nSHOW CREATE TRIGGER example\G\n*************************** 1. row ***************************\n Trigger: example\n sql_mode:\nONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,STRICT_ALL_TABLES\n,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO\n\nENGINE_SUBSTITUTION\nSQL Original Statement: CREATE DEFINER=`root`@`localhost` TRIGGER example\nBEFORE\n INSERT ON t FOR EACH ROW\nBEGIN\n SET NEW.c = NEW.c * 2;\nEND\n character_set_client: cp850\n collation_connection: cp850_general_ci\n Database Collation: utf8_general_ci\n Created: 2016-09-29 13:53:34.35\n\nMariaDB starting with 10.2.3\n----------------------------\nThe Created column was added in MySQL 5.7 and MariaDB 10.2.3 as part of\nintroducing multiple trigger events per action.\n\n\n\nURL: mariadb.com/kb/en/show-create-trigger/','','https://mariadb.com/kb/en/show-create-trigger/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (366,26,'SHOW CREATE USER','MariaDB starting with 10.2.0\n----------------------------\nSHOW CREATE USER was introduced in MariaDB 10.2.0\n\nSyntax\n------\n\nSHOW CREATE USER user_name\n\nDescription\n-----------\n\nShows the CREATE USER statement that created the given user. The statement\nrequires the SELECT privilege for the mysql database, except for the current\nuser.\n\nExamples\n--------\n\nCREATE USER foo4@test require cipher \'text\' \n issuer \'foo_issuer\' subject \'foo_subject\';\n\nSHOW CREATE USER foo4@test\G\n*************************** 1. row ***************************\nCREATE USER \'foo4\'@\'test\' \n REQUIRE ISSUER \'foo_issuer\'\n SUBJECT \'foo_subject\'\n CIPHER \'text\'\n\nUser Password Expiry:\n\nCREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY;\n\nSHOW CREATE USER \'monty\'@\'localhost\';\n+------------------------------------------------------------------+\n| CREATE USER for monty@localhost |\n+------------------------------------------------------------------+\n| CREATE USER \'monty\'@\'localhost\' PASSWORD EXPIRE INTERVAL 120 DAY |\n+------------------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/show-create-user/','','https://mariadb.com/kb/en/show-create-user/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (367,26,'SHOW CREATE VIEW','Syntax\n------\n\nSHOW CREATE VIEW view_name\n\nDescription\n-----------\n\nThis statement shows a CREATE VIEW statement that creates the given view, as\nwell as the character set used by the connection when the view was created.\nThis statement also works with views.\n\nSHOW CREATE VIEW quotes table, column and stored function names according to\nthe value of the sql_quote_show_create server system variable.\n\nExamples\n--------\n\nSHOW CREATE VIEW example\G\n*************************** 1. row ***************************\n View: example\n Create View: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL\nSECURITY DEFINER VIEW `example` AS (select `t`.`id` AS `id`,`t`.`s` AS `s` from\n`t`)\ncharacter_set_client: cp850\ncollation_connection: cp850_general_ci\n\nWith sql_quote_show_create off:\n\nSHOW CREATE VIEW example\G\n*************************** 1. row ***************************\n View: example\n Create View: CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost SQL\nSECU\nRITY DEFINER VIEW example AS (select t.id AS id,t.s AS s from t)\ncharacter_set_client: cp850\ncollation_connection: cp850_general_ci\n\nGrants\n------\n\nTo be able to see a view, you need to have the SHOW VIEW and the SELECT\nprivilege on the view:\n\nGRANT SHOW VIEW,SELECT ON test_database.test_view TO \'test\'@\'localhost\';\n\n\n\nURL: mariadb.com/kb/en/show-create-view/','','https://mariadb.com/kb/en/show-create-view/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (368,26,'SHOW DATABASES','Syntax\n------\n\nSHOW {DATABASES | SCHEMAS}\n [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW DATABASES lists the databases on the MariaDB server host. SHOW SCHEMAS is\na synonym for SHOW DATABASES. The LIKE clause, if present on its own,\nindicates which database names to match. The WHERE and LIKE clauses can be\ngiven to select rows using more general conditions, as discussed in Extended\nSHOW.\n\nYou see only those databases for which you have some kind of privilege, unless\nyou have the global SHOW DATABASES privilege. You can also get this list using\nthe mysqlshow command.\n\nIf the server was started with the --skip-show-database option, you cannot use\nthis statement at all unless you have the SHOW DATABASES privilege.\n\nThe list of results returned by SHOW DATABASES is based on directories in the\ndata directory, which is how MariaDB implements databases. It\'s possible that\noutput includes directories that do not correspond to actual databases.\n\nThe Information Schema SCHEMATA table also contains database information.\n\nExamples\n--------\n\nSHOW DATABASES;\n+--------------------+\n| Database |\n+--------------------+\n| information_schema |\n| mysql |\n| performance_schema |\n| test |\n+--------------------+\n\nSHOW DATABASES LIKE \'m%\';\n+---------------+\n| Database (m%) |\n+---------------+\n| mysql |\n+---------------+\n\n\n\nURL: mariadb.com/kb/en/show-databases/','','https://mariadb.com/kb/en/show-databases/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (369,26,'SHOW ENGINE','Syntax\n------\n\nSHOW ENGINE engine_name {STATUS | MUTEX}\n\nDescription\n-----------\n\nSHOW ENGINE displays operational information about a storage engine. The\nfollowing statements currently are supported:\n\nSHOW ENGINE INNODB STATUS\nSHOW ENGINE INNODB MUTEX\nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\nSHOW ENGINE ROCKSDB STATUS\n\nIf the Sphinx Storage Engine is installed, the following is also supported:\n\nSHOW ENGINE SPHINX STATUS\n\nSee SHOW ENGINE SPHINX STATUS.\n\nOlder (and now removed) synonyms were SHOW INNODB STATUS for SHOW ENGINE\nINNODB STATUS and SHOW MUTEX STATUS for SHOW ENGINE INNODB MUTEX.\n\nSHOW ENGINE INNODB STATUS\n-------------------------\n\nSHOW ENGINE INNODB STATUS displays extensive information from the standard\nInnoDB Monitor about the state of the InnoDB storage engine. See SHOW ENGINE\nINNODB STATUS for more.\n\nSHOW ENGINE INNODB MUTEX\n------------------------\n\nSHOW ENGINE INNODB MUTEX displays InnoDB mutex statistics.\n\nThe statement displays the following output fields:\n\n* Type: Always InnoDB.\n* Name: The source file where the mutex is implemented, and the line number\n in the file where the mutex is created. The line number is dependent on the\nMariaDB version.\n* Status: This field displays the following values if UNIV_DEBUG was defined\nat compilation time (for example, in include/univ.h in the InnoDB part of the\nsource tree). Only the os_waits value is displayed if UNIV_DEBUG was not\ndefined. Without UNIV_DEBUG, the information on which the output is based is\ninsufficient to distinguish regular mutexes and mutexes that protect\n rw-locks (which allow multiple readers or a single writer). Consequently, the\n output may appear to contain multiple rows for the same mutex.\ncount indicates how many times the mutex was requested.\nspin_waits indicates how many times the spinlock had to run.\nspin_rounds indicates the number of spinlock rounds. (spin_rounds divided by\n spin_waits provides the average round count.)\nos_waits indicates the number of operating system waits. This occurs when\n the spinlock did not work (the mutex was not locked during the spinlock and\n it was necessary to yield to the operating system and wait).\nos_yields indicates the number of times a the thread trying to lock a mutex\n gave up its timeslice and yielded to the operating system (on the\n presumption that allowing other threads to run will free the mutex so that\n it can be locked).\nos_wait_times indicates the amount of time (in ms) spent in operating system\n waits, if the timed_mutexes system variable is 1 (ON). If timed_mutexes is 0\n (OFF), timing is disabled, so os_wait_times is 0. timed_mutexes is off by\n default.\n\nInformation from this statement can be used to diagnose system problems. For\nexample, large values of spin_waits and spin_rounds may indicate scalability\nproblems.\n\nThe information_schema.INNODB_MUTEXES table provides similar information.\n\nSHOW ENGINE PERFORMANCE_SCHEMA STATUS\n-------------------------------------\n\nThis statement shows how much memory is used for performance_schema tables and\ninternal buffers.\n\nThe output contains the following fields:\n\n* Type: Always performance_schema.\n* Name: The name of a table, the name of an internal buffer, or the\nperformance_schema word, followed by a dot and an attribute. Internal buffers\nnames are enclosed by parenthesis. performance_schema means that the attribute\nrefers to the whole database (it is a total). \n* Status: The value for the attribute.\n\nThe following attributes are shown, in this order, for all tables:\n\n* row_size: The memory used for an individual record. This value will never\nchange.\n* row_count: The number of rows in the table or buffer. For some tables, this\nvalue depends on a server system variable.\n* memory: For tables and performance_schema, this is the result of row_size *\nrow_count.\n\nFor internal buffers, the attributes are:\n\n* count\n* size\n\nSHOW ENGINE ROCKSDB STATUS\n--------------------------\n\nSee also MyRocks Performance Troubleshooting\n\n\n\nURL: mariadb.com/kb/en/show-engine/','','https://mariadb.com/kb/en/show-engine/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (370,26,'SHOW ENGINE INNODB STATUS','SHOW ENGINE INNODB STATUS is a specific form of the SHOW ENGINE\nstatement that displays the InnoDB Monitor output, which is extensive InnoDB\ninformation which can be useful in diagnosing problems.\n\nThe following sections are displayed\n\n* Status: Shows the timestamp, monitor name and the number of seconds, or the\nelapsed time between the current time and the time the InnoDB Monitor output\nwas last displayed. The per-second averages are based upon this time.\n* BACKGROUND THREAD: srv_master_thread lines show work performed by the main\nbackground thread.\n* SEMAPHORES: Threads waiting for a semaphore and stats on how the number of\ntimes threads have needed a spin or a wait on a mutex or rw-lock semaphore. If\nthis number of threads is large, there may be I/O or contention issues.\nReducing the size of the innodb_thread_concurrency system variable may help if\ncontention is related to thread scheduling. Spin rounds per wait shows the\nnumber of spinlock rounds per OS wait for a mutex. \n* LATEST FOREIGN KEY ERROR: Only shown if there has been a foreign key\nconstraint error, it displays the failed statement and information about the\nconstraint and the related tables.\n* LATEST DETECTED DEADLOCK: Only shown if there has been a deadlock, it\ndisplays the transactions involved in the deadlock and the statements being\nexecuted, held and required locked and the transaction rolled back to.\n* TRANSACTIONS: The output of this section can help identify lock contention,\nas well as reasons for the deadlocks.\n* FILE I/O: InnoDB thread information as well as pending I/O operations and\nI/O performance statistics.\n* INSERT BUFFER AND ADAPTIVE HASH INDEX: InnoDB insert buffer (old name for\nthe change buffer) and adaptive hash index status information, including the\nnumber of each type of operation performed, and adaptive hash index\nperformance.\n* LOG: InnoDB log information, including current log sequence number, how far\nthe log has been flushed to disk, the position at which InnoDB last took a\ncheckpoint, pending writes and write performance statistics.\n* BUFFER POOL AND MEMORY: Information on buffer pool pages read and written,\nwhich allows you to see the number of data file I/O operations performed by\nyour queries. See InnoDB Buffer Pool for more. Similar information is also\navailable from the INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS table.\n* ROW OPERATIONS:Information about the main thread, including the number and\nperformance rate for each type of row operation.\n\nIf the innodb_status_output_locks system variable is set to 1, extended lock\ninformation will be displayed.\n\nExample output:\n\n=====================================\n2019-09-06 12:44:13 0x7f93cc236700 INNODB MONITOR OUTPUT\n=====================================\nPer second averages calculated from the last 4 seconds\n-----------------\nBACKGROUND THREAD\n-----------------\nsrv_master_thread loops: 2 srv_active, 0 srv_shutdown, 83698 srv_idle\nsrv_master_thread log flush and writes: 83682\n----------\nSEMAPHORES\n----------\nOS WAIT ARRAY INFO: reservation count 15\nOS WAIT ARRAY INFO: signal count 8\nRW-shared spins 0, rounds 20, OS waits 7\nRW-excl spins 0, rounds 0, OS waits 0\nRW-sx spins 0, rounds 0, OS waits 0\nSpin rounds per wait: 20.00 RW-shared, 0.00 RW-excl, 0.00 RW-sx\n------------\nTRANSACTIONS\n------------\nTrx id counter 236\nPurge done for trx\'s n:o < 236 undo n:o < 0 state: running\nHistory list length 22\nLIST OF TRANSACTIONS FOR EACH SESSION:\n---TRANSACTION 421747401994584, not started\n0 lock struct(s), heap size 1136, 0 row lock(s)\n---TRANSACTION 421747401990328, not started\n0 lock struct(s), heap size 1136, 0 row lock(s)\n--------\nFILE I/O\n--------\nI/O thread 0 state: waiting for completed aio requests (insert buffer thread)\nI/O thread 1 state: waiting for completed aio requests (log thread)\nI/O thread 2 state: waiting for completed aio requests (read thread)\nI/O thread 3 state: waiting for completed aio requests (read thread)\nI/O thread 4 state: waiting for completed aio requests (read thread)\nI/O thread 5 state: waiting for completed aio requests (read thread)\nI/O thread 6 state: waiting for completed aio requests (write thread)\nI/O thread 7 state: waiting for completed aio requests (write thread)\nI/O thread 8 state: waiting for completed aio requests (write thread)\nI/O thread 9 state: waiting for completed aio requests (write thread)\nPending normal aio reads: [0, 0, 0, 0] , aio writes: [0, 0, 0, 0] ,\n ibuf aio reads:, log i/o\'s:, sync i/o\'s:\nPending flushes (fsync) log: 0; buffer pool: 0\n286 OS file reads, 171 OS file writes, 22 OS fsyncs\n0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s\n-------------------------------------\nINSERT BUFFER AND ADAPTIVE HASH INDEX\n-------------------------------------\nIbuf: size 1, free list len 0, seg size 2, 0 merges\nmerged operations:\n insert 0, delete mark 0, delete 0\ndiscarded operations:\n insert 0, delete mark 0, delete 0\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\nHash table size 34679, node heap has 0 buffer(s)\n0.00 hash searches/s, 0.00 non-hash searches/s\n---\nLOG\n---\nLog sequence number 445926\nLog flushed up to 445926\nPages flushed up to 445926\nLast checkpoint at 445917\n0 pending log flushes, 0 pending chkp writes\n18 log i/o\'s done, 0.00 log i/o\'s/second\n----------------------\nBUFFER POOL AND MEMORY\n----------------------\nTotal large memory allocated 167772160\nDictionary memory allocated 50768\nBuffer pool size 8012\nFree buffers 7611\nDatabase pages 401\nOld database pages 0\nModified db pages 0\nPercent of dirty pages(LRU & free pages): 0.000\nMax dirty pages percent: 75.000\nPending reads 0\nPending writes: LRU 0, flush list 0, single page 0\nPages made young 0, not young 0\n0.00 youngs/s, 0.00 non-youngs/s\nPages read 264, created 137, written 156\n0.00 reads/s, 0.00 creates/s, 0.00 writes/s\nNo buffer pool page gets since the last printout\nPages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead\n0.00/s\nLRU len: 401, unzip_LRU len: 0\nI/O sum[0]:cur[0], unzip sum[0]:cur[0]\n--------------\nROW OPERATIONS\n--------------\n0 queries inside InnoDB, 0 queries in queue\n0 read views open inside InnoDB\nProcess ID=4267, Main thread ID=140272021272320, state: sleeping\nNumber of rows inserted 1, updated 0, deleted 0, read 1\n0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s\nNumber of system rows inserted 0, updated 0, deleted 0, read 0\n0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s\n----------------------------\nEND OF INNODB MONITOR OUTPUT\n============================\n\n\n\nURL: mariadb.com/kb/en/show-engine-innodb-status/','','https://mariadb.com/kb/en/show-engine-innodb-status/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (371,26,'SHOW ENGINES','Syntax\n------\n\nSHOW [STORAGE] ENGINES\n\nDescription\n-----------\n\nSHOW ENGINES displays status information about the server\'s storage engines.\nThis is particularly useful for checking whether a storage engine is\nsupported, or to see what the default engine is. SHOW TABLE TYPES is a\ndeprecated synonym.\n\nThe information_schema.ENGINES table provides the same information.\n\nSince storage engines are plugins, different information about them is also\nshown in the information_schema.PLUGINS table and by the SHOW PLUGINS\nstatement.\n\nNote that both MySQL\'s InnoDB and Percona\'s XtraDB replacement are labeled as\nInnoDB. However, if XtraDB is in use, it will be specified in the COMMENT\nfield. See XtraDB and InnoDB. The same applies to FederatedX.\n\nThe output consists of the following columns:\n\n* Engine indicates the engine\'s name.\n* Support indicates whether the engine is installed, and whether it is the\ndefault engine for the current session.\n* Comment is a brief description.\n* Transactions, XA and Savepoints indicate whether transactions, XA\ntransactions and transaction savepoints are supported by the engine.\n\nExamples\n--------\n\nSHOW ENGINES\G\n*************************** 1. row ***************************\n Engine: InnoDB\n Support: DEFAULT\n Comment: Supports transactions, row-level locking, and foreign keys\nTransactions: YES\n XA: YES\n Savepoints: YES\n*************************** 2. row ***************************\n Engine: CSV\n Support: YES\n Comment: CSV storage engine\nTransactions: NO\n XA: NO\n Savepoints: NO\n*************************** 3. row ***************************\n Engine: MyISAM\n Support: YES\n Comment: MyISAM storage engine\nTransactions: NO\n XA: NO\n Savepoints: NO\n*************************** 4. row ***************************\n Engine: BLACKHOLE\n Support: YES\n Comment: /dev/null storage engine (anything you write to it disappears)\nTransactions: NO\n XA: NO\n Savepoints: NO\n*************************** 5. row ***************************\n Engine: FEDERATED\n Support: YES\n Comment: FederatedX pluggable storage engine\nTransactions: YES\n XA: NO\n Savepoints: YES\n*************************** 6. row ***************************\n Engine: MRG_MyISAM\n Support: YES\n Comment: Collection of identical MyISAM tables\nTransactions: NO\n XA: NO\n Savepoints: NO\n*************************** 7. row ***************************\n Engine: ARCHIVE\n Support: YES\n Comment: Archive storage engine\nTransactions: NO\n XA: NO\n Savepoints: NO\n*************************** 8. row ***************************\n Engine: MEMORY\n Support: YES\n Comment: Hash based, stored in memory, useful for temporary tables\nTransactions: NO\n XA: NO\n Savepoints: NO\n*************************** 9. row ***************************\n Engine: PERFORMANCE_SCHEMA\n Support: YES\n Comment: Performance Schema\nTransactions: NO\n XA: NO\n Savepoints: NO\n*************************** 10. row ***************************\n Engine: Aria\n Support: YES\n Comment: Crash-safe tables with MyISAM heritage\nTransactions: NO\n XA: NO\n Savepoints: NO\n10 rows in set (0.00 sec)\n\n\n\nURL: mariadb.com/kb/en/show-engines/','','https://mariadb.com/kb/en/show-engines/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (372,26,'SHOW ERRORS','Syntax\n------\n\nSHOW ERRORS [LIMIT [offset,] row_count]\nSHOW ERRORS [LIMIT row_count OFFSET offset]\nSHOW COUNT(*) ERRORS\n\nDescription\n-----------\n\nThis statement is similar to SHOW WARNINGS, except that instead of displaying\nerrors, warnings, and notes, it displays only errors.\n\nThe LIMIT clause has the same syntax as for the SELECT statement.\n\nThe SHOW COUNT(*) ERRORS statement displays the number of errors. You can also\nretrieve this number from the error_count variable.\n\nSHOW COUNT(*) ERRORS;\nSELECT @@error_count;\n\nThe value of error_count might be greater than the number of messages\ndisplayed by SHOW WARNINGS if the max_error_count system variable is set so\nlow that not all messages are stored.\n\nFor a list of MariaDB error codes, see MariaDB Error Codes.\n\nExamples\n--------\n\nSELECT f();\nERROR 1305 (42000): FUNCTION f does not exist\n\nSHOW COUNT(*) ERRORS;\n+-----------------------+\n| @@session.error_count |\n+-----------------------+\n| 1 |\n+-----------------------+\n\nSHOW ERRORS;\n+-------+------+---------------------------+\n| Level | Code | Message |\n+-------+------+---------------------------+\n| Error | 1305 | FUNCTION f does not exist |\n+-------+------+---------------------------+\n\n\n\nURL: mariadb.com/kb/en/show-errors/','','https://mariadb.com/kb/en/show-errors/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (373,26,'SHOW EVENTS','Syntax\n------\n\nSHOW EVENTS [{FROM | IN} schema_name]\n [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nShows information about Event Manager events (created with CREATE EVENT).\nRequires the EVENT privilege. Without any arguments, SHOW EVENTS lists all of\nthe events in the current schema:\n\nSELECT CURRENT_USER(), SCHEMA();\n+----------------+----------+\n| CURRENT_USER() | SCHEMA() |\n+----------------+----------+\n| jon@ghidora | myschema |\n+----------------+----------+\n\nSHOW EVENTS\G\n*************************** 1. row ***************************\n Db: myschema\n Name: e_daily\n Definer: jon@ghidora\n Time zone: SYSTEM\n Type: RECURRING\n Execute at: NULL\n Interval value: 10\n Interval field: SECOND\n Starts: 2006-02-09 10:41:23\n Ends: NULL\n Status: ENABLED\n Originator: 0\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\nTo see the event action, use SHOW CREATE EVENT instead, or look at the\ninformation_schema.EVENTS table.\n\nTo see events for a specific schema, use the FROM clause. For example, to see\nevents for the test schema, use the following statement:\n\nSHOW EVENTS FROM test;\n\nThe LIKE clause, if present, indicates which event names to match. The WHERE\nclause can be given to select rows using more general conditions, as discussed\nin Extended Show.\n\n\n\nURL: mariadb.com/kb/en/show-events/','','https://mariadb.com/kb/en/show-events/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (374,26,'SHOW EXPLAIN','Syntax\n------\n\nSHOW EXPLAIN FOR <thread_id>;\n\nDescription\n-----------\n\nThe SHOW EXPLAIN command allows one to get an EXPLAIN (that is, a description\nof a query plan) of a query running in a certain thread.\n\nSHOW EXPLAIN FOR <thread_id>;\n\nwill produce an EXPLAIN output for the query that thread number thread_id is\nrunning. The thread id can be obtained with SHOW PROCESSLIST.\n\nSHOW EXPLAIN FOR 1;\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n| id | select_type | table | type | possible_keys | key | key_len | ref |\nrows | Extra |\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n| 1 | SIMPLE | tbl | index | NULL | a | 5 | NULL |\n1000107 | Using index |\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n1 row in set, 1 warning (0.00 sec)\n\nThe output is always accompanied with a warning which shows the query the\ntarget thread is running (this shows what the EXPLAIN is for):\n\nSHOW WARNINGS;\n+-------+------+------------------------+\n| Level | Code | Message |\n+-------+------+------------------------+\n| Note | 1003 | select sum(a) from tbl |\n+-------+------+------------------------+\n1 row in set (0.00 sec)\n\nPossible Errors\n---------------\n\nThe output can be only produced if the target thread is currently running a\nquery, which has a ready query plan. If this is not the case, the output will\nbe:\n\nSHOW EXPLAIN FOR 2;\nERROR 1932 (HY000): Target is not running an EXPLAINable command\n\nYou will get this error when:\n\n* the target thread is not running a command for which one can run EXPLAIN\n* the target thread is running a command for which one can run EXPLAIN, but\nthere is no query plan yet (for example, tables are open and locks are\n acquired before the query plan is produced)\n\nDifferences Between SHOW EXPLAIN and EXPLAIN Outputs\n----------------------------------------------------\n\nBackground\n----------\n\nIn MySQL, EXPLAIN execution takes a slightly different route from the way the\nreal query (typically the SELECT) is optimized. This is unfortunate, and has\ncaused a number of bugs in EXPLAIN. (For example, see MDEV-326, MDEV-410, and\nlp:1013343. lp:992942 is not directly about EXPLAIN, but it also would not\nhave existed if MySQL didn\'t try to delete parts of a query plan in the middle\nof the query)\n\nSHOW EXPLAIN examines a running SELECT, and hence its output may be slightly\ndifferent from what EXPLAIN SELECT would produce. We did our best to make sure\nthat either the difference is negligible, or SHOW EXPLAIN\'s output is closer\nto reality than EXPLAIN\'s output.\n\nList of Recorded Differences\n----------------------------\n\n* SHOW EXPLAIN may have Extra=\'no matching row in const table\', where EXPLAIN\nwould produce Extra=\'Impossible WHERE ...\'\n* For queries with subqueries, SHOW EXPLAIN may print select_type==PRIMARY\nwhere regular EXPLAIN used to print select_type==SIMPLE, or vice versa.\n\nRequired Permissions\n--------------------\n\nRunning SHOW EXPLAIN requires the same permissions as running SHOW PROCESSLIST\nwould.\n\n\n\nURL: mariadb.com/kb/en/show-explain/','','https://mariadb.com/kb/en/show-explain/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (375,26,'SHOW FUNCTION CODE','Syntax\n------\n\nSHOW FUNCTION CODE func_name\n\nDescription\n-----------\n\nSHOW FUNCTION CODE shows a representation of the internal implementation of\nthe stored function.\n\nIt is similar to SHOW PROCEDURE CODE but for stored functions.\n\n\n\nURL: mariadb.com/kb/en/show-function-code/','','https://mariadb.com/kb/en/show-function-code/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (376,26,'SHOW FUNCTION STATUS','Syntax\n------\n\nSHOW FUNCTION STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThis statement is similar to SHOW PROCEDURE STATUS but for stored functions.\n\nThe LIKE clause, if present on its own, indicates which function names to\nmatch.\n\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nThe information_schema.ROUTINES table contains more detailed information.\n\nExamples\n--------\n\nShowing all stored functions:\n\nSHOW FUNCTION STATUS\G\n*************************** 1. row ***************************\n Db: test\n Name: VatCents\n Type: FUNCTION\n Definer: root@localhost\n Modified: 2013-06-01 12:40:31\n Created: 2013-06-01 12:40:31\n Security_type: DEFINER\n Comment:\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nStored functions whose name starts with \'V\':\n\nSHOW FUNCTION STATUS LIKE \'V%\' \G\n*************************** 1. row ***************************\n Db: test\n Name: VatCents\n Type: FUNCTION\n Definer: root@localhost\n Modified: 2013-06-01 12:40:31\n Created: 2013-06-01 12:40:31\n Security_type: DEFINER\n Comment:\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nStored functions with a security type of \'DEFINER\':\n\nSHOW FUNCTION STATUS WHERE Security_type LIKE \'DEFINER\' \G\n*************************** 1. row ***************************\n Db: test\n Name: VatCents\n Type: FUNCTION\n Definer: root@localhost\n Modified: 2013-06-01 12:40:31\n Created: 2013-06-01 12:40:31\n Security_type: DEFINER\n Comment:\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\n\n\nURL: mariadb.com/kb/en/show-function-status/','','https://mariadb.com/kb/en/show-function-status/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (377,26,'SHOW GRANTS','Syntax\n------\n\nSHOW GRANTS [FOR user|role]\n\nDescription\n-----------\n\nThe SHOW GRANTS statement lists privileges granted to a particular user or\nrole.\n\nUsers\n-----\n\nThe statement lists the GRANT statement or statements that must be issued to\nduplicate the privileges that are granted to a MariaDB user account. The\naccount is named using the same format as for the GRANT statement; for\nexample, \'jeffrey\'@\'localhost\'. If you specify only the user name part of the\naccount name, a host name part of \'%\' is used. For additional information\nabout specifying account names, see GRANT.\n\nSHOW GRANTS FOR \'root\'@\'localhost\';\n+---------------------------------------------------------------------+\n| Grants for root@localhost |\n+---------------------------------------------------------------------+\n| GRANT ALL PRIVILEGES ON *.* TO \'root\'@\'localhost\' WITH GRANT OPTION |\n+---------------------------------------------------------------------+\n\nTo list the privileges granted to the account that you are using to connect to\nthe server, you can use any of the following statements:\n\nSHOW GRANTS;\nSHOW GRANTS FOR CURRENT_USER;\nSHOW GRANTS FOR CURRENT_USER();\n\nIf SHOW GRANTS FOR CURRENT_USER (or any of the equivalent syntaxes) is used in\nDEFINER context (such as within a stored procedure that is defined with SQL\nSECURITY DEFINER), the grants displayed are those of the definer and not the\ninvoker.\n\nNote that the DELETE HISTORY privilege, introduced in MariaDB 10.3.4, was\ndisplayed as DELETE VERSIONING ROWS when running SHOW GRANTS until MariaDB\n10.3.15 (MDEV-17655).\n\nRoles\n-----\n\nSHOW GRANTS can also be used to view the privileges granted to a role.\n\nExample\n-------\n\nSHOW GRANTS FOR journalist;\n+------------------------------------------+\n| Grants for journalist |\n+------------------------------------------+\n| GRANT USAGE ON *.* TO \'journalist\' |\n| GRANT DELETE ON `test`.* TO \'journalist\' |\n+------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/show-grants/','','https://mariadb.com/kb/en/show-grants/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (378,26,'SHOW INDEX','Syntax\n------\n\nSHOW {INDEX | INDEXES | KEYS} \n FROM tbl_name [FROM db_name]\n [WHERE expr]\n\nDescription\n-----------\n\nSHOW INDEX returns table index information. The format resembles that of the\nSQLStatistics call in ODBC.\n\nYou can use db_name.tbl_name as an alternative to the tbl_name FROM db_name\nsyntax. These two statements are equivalent:\n\nSHOW INDEX FROM mytable FROM mydb;\nSHOW INDEX FROM mydb.mytable;\n\nSHOW KEYS and SHOW INDEXES are synonyms for SHOW INDEX.\n\nYou can also list a table\'s indexes with the mariadb-show/mysqlshow command:\n\nmysqlshow -k db_name tbl_name\n\nThe information_schema.STATISTICS table stores similar information.\n\nThe following fields are returned by SHOW INDEX.\n\n+------------------------+----------------------------------------------------+\n| Field | Description |\n+------------------------+----------------------------------------------------+\n| Table | Table name |\n+------------------------+----------------------------------------------------+\n| Non_unique | 1 if the index permits duplicate values, 0 if |\n| | values must be unique. |\n+------------------------+----------------------------------------------------+\n| Key_name | Index name. The primary key is always named |\n| | PRIMARY. |\n+------------------------+----------------------------------------------------+\n| Seq_in_index | The column\'s sequence in the index, beginning |\n| | with 1. |\n+------------------------+----------------------------------------------------+\n| Column_name | Column name. |\n+------------------------+----------------------------------------------------+\n| Collation | Either A, if the column is sorted in ascending |\n| | order in the index, or NULL if it\'s not sorted. |\n+------------------------+----------------------------------------------------+\n| Cardinality | Estimated number of unique values in the index. |\n| | The cardinality statistics are calculated at |\n| | various times, and can help the optimizer make |\n| | improved decisions. |\n+------------------------+----------------------------------------------------+\n| Sub_part | NULL if the entire column is included in the |\n| | index, or the number of included characters if |\n| | not. |\n+------------------------+----------------------------------------------------+\n| Packed | NULL if the index is not packed, otherwise how |\n| | the index is packed. |\n+------------------------+----------------------------------------------------+\n| Null | NULL if NULL values are permitted in the column, |\n| | an empty string if NULLs are not permitted. |\n+------------------------+----------------------------------------------------+\n| Index_type | The index type, which can be BTREE, FULLTEXT, |\n| | HASH or RTREE. See Storage Engine Index Types. |\n+------------------------+----------------------------------------------------+\n| Comment | Other information, such as whether the index is |\n| | disabled. |\n+------------------------+----------------------------------------------------+\n| Index_comment | Contents of the COMMENT attribute when the index |\n| | was created. |\n+------------------------+----------------------------------------------------+\n| Ignored | Whether or not an index will be ignored by the |\n| | optimizer. See Ignored Indexes. From MariaDB |\n| | 10.6.0. |\n+------------------------+----------------------------------------------------+\n\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nExamples\n--------\n\nCREATE TABLE IF NOT EXISTS `employees_example` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `first_name` varchar(30) NOT NULL,\n `last_name` varchar(40) NOT NULL,\n `position` varchar(25) NOT NULL,\n `home_address` varchar(50) NOT NULL,\n `home_phone` varchar(12) NOT NULL,\n `employee_code` varchar(25) NOT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `employee_code` (`employee_code`),\n KEY `first_name` (`first_name`,`last_name`)\n) ENGINE=Aria;\n\nINSERT INTO `employees_example` (`first_name`, `last_name`, `position`,\n`home_address`, `home_phone`, `employee_code`)\n VALUES\n (\'Mustapha\', \'Mond\', \'Chief Executive Officer\', \'692 Promiscuous Plaza\',\n\'326-555-3492\', \'MM1\'),\n (\'Henry\', \'Foster\', \'Store Manager\', \'314 Savage Circle\', \'326-555-3847\',\n\'HF1\'),\n (\'Bernard\', \'Marx\', \'Cashier\', \'1240 Ambient Avenue\', \'326-555-8456\', \'BM1\'),\n (\'Lenina\', \'Crowne\', \'Cashier\', \'281 Bumblepuppy Boulevard\', \'328-555-2349\',\n\'LC1\'),\n (\'Fanny\', \'Crowne\', \'Restocker\', \'1023 Bokanovsky Lane\', \'326-555-6329\',\n\'FC1\'),\n (\'Helmholtz\', \'Watson\', \'Janitor\', \'944 Soma Court\', \'329-555-2478\', \'HW1\');\n\nSHOW INDEXES FROM employees_example\G\n*************************** 1. row ***************************\n Table: employees_example\n Non_unique: 0\n Key_name: PRIMARY\n Seq_in_index: 1\n Column_name: id\n Collation: A\n Cardinality: 6\n Sub_part: NULL\n Packed: NULL\n Null:\n Index_type: BTREE\n Comment:\nIndex_comment: \n Ignored: NO\n*************************** 2. row ***************************\n Table: employees_example\n Non_unique: 0\n Key_name: employee_code\n Seq_in_index: 1\n Column_name: employee_code\n Collation: A\n Cardinality: 6\n Sub_part: NULL\n Packed: NULL\n Null:\n Index_type: BTREE\n Comment:\nIndex_comment: \n Ignored: NO\n*************************** 3. row ***************************\n Table: employees_example\n Non_unique: 1\n Key_name: first_name\n Seq_in_index: 1\n Column_name: first_name\n Collation: A\n Cardinality: NULL\n Sub_part: NULL\n Packed: NULL\n Null:\n Index_type: BTREE\n Comment:\nIndex_comment: \n Ignored: NO\n*************************** 4. row ***************************\n Table: employees_example\n Non_unique: 1\n Key_name: first_name\n Seq_in_index: 2\n Column_name: last_name\n Collation: A\n Cardinality: NULL\n Sub_part: NULL\n Packed: NULL\n Null:\n Index_type: BTREE\n Comment:\nIndex_comment: \n Ignored: NO\n\n\n\nURL: mariadb.com/kb/en/show-index/','','https://mariadb.com/kb/en/show-index/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (379,26,'SHOW LOCALES','SHOW LOCALES was introduced as part of the Information Schema plugin\nextension.\n\nSHOW LOCALES is used to return locales information as part of the Locales\nplugin. While the information_schema.LOCALES table has 8 columns, the SHOW\nLOCALES statement will only display 4 of them:\n\nExample\n-------\n\nSHOW LOCALES;\n+-----+-------+-------------------------------------+------------------------+\n| Id | Name | Description | Error_Message_Language |\n+-----+-------+-------------------------------------+------------------------+\n| 0 | en_US | English - United States | english |\n| 1 | en_GB | English - United Kingdom | english |\n| 2 | ja_JP | Japanese - Japan | japanese |\n| 3 | sv_SE | Swedish - Sweden | swedish |\n...\n\n\n\nURL: mariadb.com/kb/en/show-locales/','','https://mariadb.com/kb/en/show-locales/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (380,26,'SHOW MASTER STATUS','Syntax\n------\n\nSHOW MASTER STATUS\nSHOW BINLOG STATUS -- From MariaDB 10.5.2\n\nDescription\n-----------\n\nProvides status information about the binary log files of the primary.\n\nThis statement requires the SUPER privilege, the REPLICATION_CLIENT privilege,\nor, from MariaDB 10.5.2, the BINLOG MONITOR privilege.\n\nTo see information about the current GTIDs in the binary log, use the\ngtid_binlog_pos variable.\n\nSHOW MASTER STATUS was renamed to SHOW BINLOG STATUS in MariaDB 10.5.2, but\nthe old name remains an alias for compatibility purposes.\n\nExample\n-------\n\nSHOW MASTER STATUS;\n+--------------------+----------+--------------+------------------+\n| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |\n+--------------------+----------+--------------+------------------+\n| mariadb-bin.000016 | 475 | | |\n+--------------------+----------+--------------+------------------+\nSELECT @@global.gtid_binlog_pos;\n+--------------------------+\n| @@global.gtid_binlog_pos |\n+--------------------------+\n| 0-1-2 |\n+--------------------------+\n\n\n\nURL: mariadb.com/kb/en/show-master-status/','','https://mariadb.com/kb/en/show-master-status/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (381,26,'SHOW OPEN TABLES','Syntax\n------\n\nSHOW OPEN TABLES [FROM db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW OPEN TABLES lists the non-TEMPORARY tables that are currently open in the\ntable cache. See http://dev.mysql.com/doc/refman/5.1/en/table-cache.html.\n\nThe FROM and LIKE clauses may be used.\n\nThe FROM clause, if present, restricts the tables shown to those present in\nthe db_name database.\n\nThe LIKE clause, if present on its own, indicates which table names to match.\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nThe following information is returned:\n\n+---------------------------+-------------------------------------------------+\n| Column | Description |\n+---------------------------+-------------------------------------------------+\n| Database | Database name. |\n+---------------------------+-------------------------------------------------+\n| Name | Table name. |\n+---------------------------+-------------------------------------------------+\n| In_use | Number of table instances being used. |\n+---------------------------+-------------------------------------------------+\n| Name_locked | 1 if the table is name-locked, e.g. if it is |\n| | being dropped or renamed, otherwise 0. |\n+---------------------------+-------------------------------------------------+\n\nBefore MariaDB 5.5, each use of, for example, LOCK TABLE ... WRITE would\nincrement In_use for that table. With the implementation of the metadata\nlocking improvements in MariaDB 5.5, LOCK TABLE... WRITE acquires a strong MDL\nlock, and concurrent connections will wait on this MDL lock, so any subsequent\nLOCK TABLE... WRITE will not increment In_use.\n\nExample\n-------\n\nSHOW OPEN TABLES;\n+----------+---------------------------+--------+-------------+\n| Database | Table | In_use | Name_locked |\n+----------+---------------------------+--------+-------------+\n...\n| test | xjson | 0 | 0 |\n| test | jauthor | 0 | 0 |\n| test | locks | 1 | 0 |\n...\n+----------+---------------------------+--------+-------------+\n\n\n\nURL: mariadb.com/kb/en/show-open-tables/','','https://mariadb.com/kb/en/show-open-tables/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (382,26,'SHOW PACKAGE BODY STATUS','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nSHOW PACKAGE BODY STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThe SHOW PACKAGE BODY STATUS statement returns characteristics of stored\npackage bodies (implementations), such as the database, name, type, creator,\ncreation and modification dates, and character set information. A similar\nstatement, SHOW PACKAGE STATUS, displays information about stored package\nspecifications.\n\nThe LIKE clause, if present, indicates which package names to match. The WHERE\nand LIKE clauses can be given to select rows using more general conditions, as\ndiscussed in Extended SHOW.\n\nThe ROUTINES table in the INFORMATION_SCHEMA database contains more detailed\ninformation.\n\nExamples\n--------\n\nSHOW PACKAGE BODY STATUS LIKE \'pkg1\'\G\n*************************** 1. row ***************************\n Db: test\n Name: pkg1\n Type: PACKAGE BODY\n Definer: root@localhost\n Modified: 2018-02-27 14:44:14\n Created: 2018-02-27 14:44:14\n Security_type: DEFINER\n Comment: This is my first package body\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\n\n\nURL: mariadb.com/kb/en/show-package-body-status/','','https://mariadb.com/kb/en/show-package-body-status/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (383,26,'SHOW PACKAGE STATUS','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nSHOW PACKAGE STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThe SHOW PACKAGE STATUS statement returns characteristics of stored package\nspecifications, such as the database, name, type, creator, creation and\nmodification dates, and character set information. A similar statement, SHOW\nPACKAGE BODY STATUS, displays information about stored package bodies (i.e.\nimplementations).\n\nThe LIKE clause, if present, indicates which package names to match. The WHERE\nand LIKE clauses can be given to select rows using more general conditions, as\ndiscussed in Extended SHOW.\n\nThe ROUTINES table in the INFORMATION_SCHEMA database contains more detailed\ninformation.\n\nExamples\n--------\n\nSHOW PACKAGE STATUS LIKE \'pkg1\'\G\n*************************** 1. row ***************************\n Db: test\n Name: pkg1\n Type: PACKAGE\n Definer: root@localhost\n Modified: 2018-02-27 14:38:15\n Created: 2018-02-27 14:38:15\n Security_type: DEFINER\n Comment: This is my first package\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\n\n\nURL: mariadb.com/kb/en/show-package-status/','','https://mariadb.com/kb/en/show-package-status/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (384,26,'SHOW PLUGINS','Syntax\n------\n\nSHOW PLUGINS;\n\nDescription\n-----------\n\nSHOW PLUGINS displays information about installed plugins. The Library column\nindicates the plugin library - if it is NULL, the plugin is built-in and\ncannot be uninstalled.\n\nThe PLUGINS table in the information_schema database contains more detailed\ninformation.\n\nFor specific information about storage engines (a particular type of plugin),\nsee the information_schema.ENGINES table and the SHOW ENGINES statement.\n\nExamples\n--------\n\nSHOW PLUGINS;\n+----------------------------+----------+--------------------+-------------+---\n-----+\n| Name | Status | Type | Library |\nLicense |\n+----------------------------+----------+--------------------+-------------+---\n-----+\n| binlog | ACTIVE | STORAGE ENGINE | NULL |\nGPL |\n| mysql_native_password | ACTIVE | AUTHENTICATION | NULL |\nGPL |\n| mysql_old_password | ACTIVE | AUTHENTICATION | NULL |\nGPL |\n| MRG_MyISAM | ACTIVE | STORAGE ENGINE | NULL |\nGPL |\n| MyISAM | ACTIVE | STORAGE ENGINE | NULL |\nGPL |\n| CSV | ACTIVE | STORAGE ENGINE | NULL |\nGPL |\n| MEMORY | ACTIVE | STORAGE ENGINE | NULL |\nGPL |\n| FEDERATED | ACTIVE | STORAGE ENGINE | NULL |\nGPL |\n| PERFORMANCE_SCHEMA | ACTIVE | STORAGE ENGINE | NULL |\nGPL |\n| Aria | ACTIVE | STORAGE ENGINE | NULL |\nGPL |\n| InnoDB | ACTIVE | STORAGE ENGINE | NULL |\nGPL |\n| INNODB_TRX | ACTIVE | INFORMATION SCHEMA | NULL |\nGPL |\n...\n| INNODB_SYS_FOREIGN | ACTIVE | INFORMATION SCHEMA | NULL |\nGPL |\n| INNODB_SYS_FOREIGN_COLS | ACTIVE | INFORMATION SCHEMA | NULL |\nGPL |\n| SPHINX | ACTIVE | STORAGE ENGINE | NULL |\nGPL |\n| ARCHIVE | ACTIVE | STORAGE ENGINE | NULL |\nGPL |\n| BLACKHOLE | ACTIVE | STORAGE ENGINE | NULL |\nGPL |\n| FEEDBACK | DISABLED | INFORMATION SCHEMA | NULL |\nGPL |\n| partition | ACTIVE | STORAGE ENGINE | NULL |\nGPL |\n| pam | ACTIVE | AUTHENTICATION | auth_pam.so |\nGPL |\n+----------------------------+----------+--------------------+-------------+---\n-----+\n\n\n\nURL: mariadb.com/kb/en/show-plugins/','','https://mariadb.com/kb/en/show-plugins/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (385,26,'SHOW PLUGINS SONAME','Syntax\n------\n\nSHOW PLUGINS SONAME { library | LIKE \'pattern\' | WHERE expr };\n\nDescription\n-----------\n\nSHOW PLUGINS SONAME displays information about compiled-in and all server\nplugins in the plugin_dir directory, including plugins that haven\'t been\ninstalled.\n\nExamples\n--------\n\nSHOW PLUGINS SONAME \'ha_example.so\';\n+----------+---------------+----------------+---------------+---------+\n| Name | Status | Type | Library | License |\n+----------+---------------+----------------+---------------+---------+\n| EXAMPLE | NOT INSTALLED | STORAGE ENGINE | ha_example.so | GPL |\n| UNUSABLE | NOT INSTALLED | DAEMON | ha_example.so | GPL |\n+----------+---------------+----------------+---------------+---------+\n\nThere is also a corresponding information_schema table, called ALL_PLUGINS,\nwhich contains more complete information.\n\n\n\nURL: mariadb.com/kb/en/show-plugins-soname/','','https://mariadb.com/kb/en/show-plugins-soname/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (386,26,'SHOW PRIVILEGES','Syntax\n------\n\nSHOW PRIVILEGES\n\nDescription\n-----------\n\nSHOW PRIVILEGES shows the list of system privileges that the MariaDB server\nsupports. The exact list of privileges depends on the version of your server.\n\nNote that before MariaDB 10.3.23, MariaDB 10.4.13 and MariaDB 10.5.2 , the\nDelete history privilege displays as Delete versioning rows (MDEV-20382).\n\nExample\n-------\n\nFrom MariaDB 10.5.9\n\nSHOW PRIVILEGES;\n+--------------------------+---------------------------------------+-----------\n--------------------------------------------------------+\n| Privilege | Context | Comment \n |\n+--------------------------+---------------------------------------+-----------\n--------------------------------------------------------+\n| Alter | Tables | To alter\nthe table |\n| Alter routine | Functions,Procedures | To alter\nor drop stored functions/procedures |\n| Create | Databases,Tables,Indexes | To create\nnew databases and tables |\n| Create routine | Databases | To use\nCREATE FUNCTION/PROCEDURE |\n| Create temporary tables | Databases | To use\nCREATE TEMPORARY TABLE |\n| Create view | Tables | To create\nnew views |\n| Create user | Server Admin | To create\nnew users |\n| Delete | Tables | To delete\nexisting rows |\n| Delete history | Tables | To delete\nversioning table historical rows |\n| Drop | Databases,Tables | To drop\ndatabases, tables, and views |\n| Event | Server Admin | To\ncreate, alter, drop and execute events |\n| Execute | Functions,Procedures | To\nexecute stored routines |\n| File | File access on server | To read\nand write files on the server |\n| Grant option | Databases,Tables,Functions,Procedures | To give\nto other users those privileges you possess |\n| Index | Tables | To create\nor drop indexes |\n| Insert | Tables | To insert\ndata into tables |\n| Lock tables | Databases | To use\nLOCK TABLES (together with SELECT privilege) |\n| Process | Server Admin | To view\nthe plain text of currently executing queries |\n| Proxy | Server Admin | To make\nproxy user possible |\n| References | Databases,Tables | To have\nreferences on tables |\n| Reload | Server Admin | To reload\nor refresh tables, logs and privileges |\n| Binlog admin | Server | To purge\nbinary logs |\n| Binlog monitor | Server | To use\nSHOW BINLOG STATUS and SHOW BINARY LOG |\n| Binlog replay | Server | To use\nBINLOG (generated by mariadb-binlog) |\n| Replication master admin | Server | To\nmonitor connected slaves |\n| Replication slave admin | Server | To\nstart/stop slave and apply binlog events |\n| Slave monitor | Server | To use\nSHOW SLAVE STATUS and SHOW RELAYLOG EVENTS |\n| Replication slave | Server Admin | To read\nbinary log events from the master |\n| Select | Tables | To\nretrieve rows from table |\n| Show databases | Server Admin | To see\nall databases with SHOW DATABASES |\n| Show view | Tables | To see\nviews with SHOW CREATE VIEW |\n| Shutdown | Server Admin | To shut\ndown the server |\n| Super | Server Admin | To use\nKILL thread, SET GLOBAL, CHANGE MASTER, etc. |\n| Trigger | Tables | To use\ntriggers |\n| Create tablespace | Server Admin | To\ncreate/alter/drop tablespaces |\n| Update | Tables | To update\nexisting rows |\n| Set user | Server | To create\nviews and stored routines with a different definer |\n| Federated admin | Server | To\nexecute the CREATE SERVER, ALTER SERVER, DROP SERVER statements |\n| Connection admin | Server | To bypass\nconnection limits and kill other users\' connections |\n| Read_only admin | Server | To\nperform write operations even if @@read_only=ON |\n| Usage | Server Admin | No\nprivileges - allow connect only |\n+--------------------------+---------------------------------------+-----------\n--------------------------------------------------------+\n41 rows in set (0.000 sec)\n\n\n\nURL: mariadb.com/kb/en/show-privileges/','','https://mariadb.com/kb/en/show-privileges/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (387,26,'SHOW PROCEDURE CODE','Syntax\n------\n\nSHOW PROCEDURE CODE proc_name\n\nDescription\n-----------\n\nThis statement is a MariaDB extension that is available only for servers that\nhave been built with debugging support. It displays a representation of the\ninternal implementation of the named stored procedure. A similar statement,\nSHOW FUNCTION CODE, displays information about stored functions.\n\nBoth statements require that you be the owner of the routine or have SELECT\naccess to the mysql.proc table.\n\nIf the named routine is available, each statement produces a result set. Each\nrow in the result set corresponds to one "instruction" in the routine. The\nfirst column is Pos, which is an ordinal number beginning with 0. The second\ncolumn is Instruction, which contains an SQL statement (usually changed from\nthe original source), or a directive which has meaning only to the\nstored-routine handler.\n\nExamples\n--------\n\nDELIMITER //\n\nCREATE PROCEDURE p1 ()\n BEGIN\n DECLARE fanta INT DEFAULT 55;\n DROP TABLE t2;\n LOOP\n INSERT INTO t3 VALUES (fanta);\n END LOOP;\n END//\nQuery OK, 0 rows affected (0.00 sec)\n\nSHOW PROCEDURE CODE p1//\n+-----+----------------------------------------+\n| Pos | Instruction |\n+-----+----------------------------------------+\n| 0 | set fanta@0 55 |\n| 1 | stmt 9 "DROP TABLE t2" |\n| 2 | stmt 5 "INSERT INTO t3 VALUES (fanta)" |\n| 3 | jump 2 |\n+-----+----------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/show-procedure-code/','','https://mariadb.com/kb/en/show-procedure-code/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (388,26,'SHOW PROCEDURE STATUS','Syntax\n------\n\nSHOW PROCEDURE STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nThis statement is a MariaDB extension. It returns characteristics of a stored\nprocedure, such as the database, name, type, creator, creation and\nmodification dates, and character set information. A similar statement, SHOW\nFUNCTION STATUS, displays information about stored functions.\n\nThe LIKE clause, if present, indicates which procedure or function names to\nmatch. The WHERE and LIKE clauses can be given to select rows using more\ngeneral conditions, as discussed in Extended SHOW.\n\nThe ROUTINES table in the INFORMATION_SCHEMA database contains more detailed\ninformation.\n\nExamples\n--------\n\nSHOW PROCEDURE STATUS LIKE \'p1\'\G\n*************************** 1. row ***************************\n Db: test\n Name: p1\n Type: PROCEDURE\n Definer: root@localhost\n Modified: 2010-08-23 13:23:03\n Created: 2010-08-23 13:23:03\n Security_type: DEFINER\n Comment:\ncharacter_set_client: latin1\ncollation_connection: latin1_swedish_ci\n Database Collation: latin1_swedish_ci\n\n\n\nURL: mariadb.com/kb/en/show-procedure-status/','','https://mariadb.com/kb/en/show-procedure-status/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (389,26,'SHOW PROCESSLIST','Syntax\n------\n\nSHOW [FULL] PROCESSLIST\n\nDescription\n-----------\n\nSHOW PROCESSLIST shows you which threads are running. You can also get this\ninformation from the information_schema.PROCESSLIST table or the mysqladmin\nprocesslist command. If you have the PROCESS privilege, you can see all\nthreads. Otherwise, you can see only your own threads (that is, threads\nassociated with the MariaDB account that you are using). If you do not use the\nFULL keyword, only the first 100 characters of each statement are shown in the\nInfo field.\n\nThe columns shown in SHOW PROCESSLIST are:\n\n+---------------------+-------------------------------------------------------+\n| Name | Description |\n+---------------------+-------------------------------------------------------+\n| ID | The client\'s process ID. |\n+---------------------+-------------------------------------------------------+\n| USER | The username associated with the process. |\n+---------------------+-------------------------------------------------------+\n| HOST | The host the client is connected to. |\n+---------------------+-------------------------------------------------------+\n| DB | The default database of the process (NULL if no |\n| | default). |\n+---------------------+-------------------------------------------------------+\n| COMMAND | The command type. See Thread Command Values. |\n+---------------------+-------------------------------------------------------+\n| TIME | The amount of time, in seconds, the process has been |\n| | in its current state. For a replica SQL thread |\n| | before MariaDB 10.1, this is the time in seconds |\n| | between the last replicated event\'s timestamp and |\n| | the replica machine\'s real time. |\n+---------------------+-------------------------------------------------------+\n| STATE | See Thread States. |\n+---------------------+-------------------------------------------------------+\n| INFO | The statement being executed. |\n+---------------------+-------------------------------------------------------+\n| PROGRESS | The total progress of the process (0-100%) (see |\n| | Progress Reporting). |\n+---------------------+-------------------------------------------------------+\n\nSee TIME_MS column in information_schema.PROCESSLIST for differences in the\nTIME column between MariaDB and MySQL.\n\nThe information_schema.PROCESSLIST table contains the following additional\ncolumns:\n\n+---------------------+-------------------------------------------------------+\n| Name | Description |\n+---------------------+-------------------------------------------------------+\n| TIME_MS | The amount of time, in milliseconds, the process has |\n| | been in its current state. |\n+---------------------+-------------------------------------------------------+\n| STAGE | The stage the process is currently in. |\n+---------------------+-------------------------------------------------------+\n| MAX_STAGE | The maximum number of stages. |\n+---------------------+-------------------------------------------------------+\n| PROGRESS | The progress of the process within the current stage |\n| | (0-100%). |\n+---------------------+-------------------------------------------------------+\n| MEMORY_USED | The amount of memory used by the process. |\n+---------------------+-------------------------------------------------------+\n| EXAMINED_ROWS | The number of rows the process has examined. |\n+---------------------+-------------------------------------------------------+\n| QUERY_ID | Query ID. |\n+---------------------+-------------------------------------------------------+\n\nNote that the PROGRESS field from the information schema, and the PROGRESS\nfield from SHOW PROCESSLIST display different results. SHOW PROCESSLIST shows\nthe total progress, while the information schema shows the progress for the\ncurrent stage only.\n\nThreads can be killed using their thread_id or their query_id, with the KILL\nstatement.\n\nSince queries on this table are locking, if the performance_schema is enabled,\nyou may want to query the THREADS table instead.\n\nExamples\n--------\n\nSHOW PROCESSLIST;\n+----+-----------------+-----------+------+---------+------+-------------------\n----+------------------+----------+\n| Id | User | Host | db | Command | Time | State \n | Info | Progress |\n+----+-----------------+-----------+------+---------+------+-------------------\n----+------------------+----------+\n| 2 | event_scheduler | localhost | NULL | Daemon | 2693 | Waiting on empty\nqueue | NULL | 0.000 |\n| 4 | root | localhost | NULL | Query | 0 | Table lock \n | SHOW PROCESSLIST | 0.000 |\n+----+-----------------+-----------+------+---------+------+-------------------\n----+------------------+----------+\n\n\n\nURL: mariadb.com/kb/en/show-processlist/','','https://mariadb.com/kb/en/show-processlist/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (390,26,'SHOW PROFILE','Syntax\n------\n\nSHOW PROFILE [type [, type] ... ]\n [FOR QUERY n]\n [LIMIT row_count [OFFSET offset]]\n\ntype:\n ALL\n | BLOCK IO\n | CONTEXT SWITCHES\n | CPU\n | IPC\n | MEMORY\n | PAGE FAULTS\n | SOURCE\n | SWAPS\n\nDescription\n-----------\n\nThe SHOW PROFILE and SHOW PROFILES statements display profiling information\nthat indicates resource usage for statements executed during the course of the\ncurrent session.\n\nProfiling is controlled by the profiling session variable, which has a default\nvalue of 0 (OFF). Profiling is enabled by setting profiling to 1 or ON:\n\nSET profiling = 1;\n\nSHOW PROFILES displays a list of the most recent statements sent to the\nmaster. The size of the list is controlled by the profiling_history_size\nsession variable, which has a default value of 15. The maximum value is 100.\nSetting the value to 0 has the practical effect of disabling profiling.\n\nAll statements are profiled except SHOW PROFILES and SHOW PROFILE, so you will\nfind neither of those statements in the profile list. Malformed statements are\nprofiled. For example, SHOW PROFILING is an illegal statement, and a syntax\nerror occurs if you try to execute it, but it will show up in the profiling\nlist.\n\nSHOW PROFILE displays detailed information about a single statement. Without\nthe FOR QUERY n clause, the output pertains to the most recently executed\nstatement. If FOR QUERY n is included, SHOW PROFILE displays information for\nstatement n. The values of n correspond to the Query_ID values displayed by\nSHOW PROFILES.\n\nThe LIMIT row_count clause may be given to limit the output to row_count rows.\nIf LIMIT is given, OFFSET offset may be added to begin the output offset rows\ninto the full set of rows.\n\nBy default, SHOW PROFILE displays Status and Duration columns. The Status\nvalues are like the State values displayed by SHOW PROCESSLIST, although there\nmight be some minor differences in interpretation for the two statements for\nsome status values (see\nhttp://dev.mysql.com/doc/refman/5.6/en/thread-information.html).\n\nOptional type values may be specified to display specific additional types of\ninformation:\n\n* ALL displays all information\n* BLOCK IO displays counts for block input and output operations\n* CONTEXT SWITCHES displays counts for voluntary and involuntary context\nswitches\n* CPU displays user and system CPU usage times\n* IPC displays counts for messages sent and received\n* MEMORY is not currently implemented\n* PAGE FAULTS displays counts for major and minor page faults\n* SOURCE displays the names of functions from the source code, together with\nthe name and line number of the file in which the function occurs\n* SWAPS displays swap counts\n\nProfiling is enabled per session. When a session ends, its profiling\ninformation is lost.\n\nThe information_schema.PROFILING table contains similar information.\n\nExamples\n--------\n\nSELECT @@profiling;\n+-------------+\n| @@profiling |\n+-------------+\n| 0 |\n+-------------+\n\nSET profiling = 1;\n\nUSE test;\n\nDROP TABLE IF EXISTS t1;\n\nCREATE TABLE T1 (id INT);\n\nSHOW PROFILES;\n+----------+------------+--------------------------+\n| Query_ID | Duration | Query |\n+----------+------------+--------------------------+\n| 1 | 0.00009200 | SELECT DATABASE() |\n| 2 | 0.00023800 | show databases |\n| 3 | 0.00018900 | show tables |\n| 4 | 0.00014700 | DROP TABLE IF EXISTS t1 |\n| 5 | 0.24476900 | CREATE TABLE T1 (id INT) |\n+----------+------------+--------------------------+\n\nSHOW PROFILE;\n+----------------------+----------+\n| Status | Duration |\n+----------------------+----------+\n| starting | 0.000042 |\n| checking permissions | 0.000044 |\n| creating table | 0.244645 |\n| After create | 0.000013 |\n| query end | 0.000003 |\n| freeing items | 0.000016 |\n| logging slow query | 0.000003 |\n| cleaning up | 0.000003 |\n+----------------------+----------+\n\nSHOW PROFILE FOR QUERY 4;\n+--------------------+----------+\n| Status | Duration |\n+--------------------+----------+\n| starting | 0.000126 |\n| query end | 0.000004 |\n| freeing items | 0.000012 |\n| logging slow query | 0.000003 |\n| cleaning up | 0.000002 |\n+--------------------+----------+\n\nSHOW PROFILE CPU FOR QUERY 5;\n+----------------------+----------+----------+------------+\n| Status | Duration | CPU_user | CPU_system |\n+----------------------+----------+----------+------------+\n| starting | 0.000042 | 0.000000 | 0.000000 |\n| checking permissions | 0.000044 | 0.000000 | 0.000000 |\n| creating table | 0.244645 | 0.000000 | 0.000000 |\n| After create | 0.000013 | 0.000000 | 0.000000 |\n| query end | 0.000003 | 0.000000 | 0.000000 |\n| freeing items | 0.000016 | 0.000000 | 0.000000 |\n| logging slow query | 0.000003 | 0.000000 | 0.000000 |\n| cleaning up | 0.000003 | 0.000000 | 0.000000 |\n+----------------------+----------+----------+------------+\n\n\n\nURL: mariadb.com/kb/en/show-profile/','','https://mariadb.com/kb/en/show-profile/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (391,26,'SHOW PROFILES','Syntax\n------\n\nSHOW PROFILES\n\nDescription\n-----------\n\nThe SHOW PROFILES statement displays profiling information that indicates\nresource usage for statements executed during the course of the current\nsession. It is used together with SHOW PROFILE.\n\n\n\nURL: mariadb.com/kb/en/show-profiles/','','https://mariadb.com/kb/en/show-profiles/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (392,26,'SHOW QUERY_RESPONSE_TIME','It is possible to use SHOW QUERY_RESPONSE_TIME as an alternative for\nretrieving information from the QUERY_RESPONSE_TIME plugin.\n\nThis was introduced as part of the Information Schema plugin extension.\n\n\n\nURL: mariadb.com/kb/en/show-query_response_time/','','https://mariadb.com/kb/en/show-query_response_time/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (393,26,'SHOW RELAYLOG EVENTS','The terms master and slave have historically been used in replication,\nbut the terms terms primary and replica are now preferred. The old terms are\nused still used in parts of the documentation, and in MariaDB commands,\nalthough MariaDB 10.5 has begun the process of renaming. The documentation\nprocess is ongoing. See MDEV-18777 to follow progress on this effort.\n\nSyntax\n------\n\nSHOW RELAYLOG [\'connection_name\'] EVENTS\n [IN \'log_name\'] [FROM pos] [LIMIT [offset,] row_count]\n [ FOR CHANNEL \'channel_name\']\n\nDescription\n-----------\n\nOn replicas, this command shows the events in the relay log. If \'log_name\' is\nnot specified, the first relay log is shown.\n\nSyntax for the LIMIT clause is the same as for SELECT ... LIMIT.\n\nUsing the LIMIT clause is highly recommended because the SHOW RELAYLOG EVENTS\ncommand returns the complete contents of the relay log, which can be quite\nlarge.\n\nThis command does not return events related to setting user and system\nvariables. If you need those, use mariadb-binlog/mysqlbinlog.\n\nOn the primary, this command does nothing.\n\nRequires the REPLICA MONITOR privilege (>= MariaDB 10.5.9), the REPLICATION\nSLAVE ADMIN privilege (>= MariaDB 10.5.2) or the REPLICATION SLAVE privilege\n(<= MariaDB 10.5.1).\n\nconnection_name\n---------------\n\nIf there is only one nameless primary, or the default primary (as specified by\nthe default_master_connection system variable) is intended, connection_name\ncan be omitted. If provided, the SHOW RELAYLOG statement will apply to the\nspecified primary. connection_name is case-insensitive.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after SHOW RELAYLOG.\n\n\n\nURL: mariadb.com/kb/en/show-relaylog-events/','','https://mariadb.com/kb/en/show-relaylog-events/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (394,26,'SHOW SLAVE HOSTS','Syntax\n------\n\nSHOW SLAVE HOSTS\nSHOW REPLICA HOSTS -- from MariaDB 10.5.1\n\nDescription\n-----------\n\nThis command is run on the primary and displays a list of replicas that are\ncurrently registered with it. Only replicas started with the\n--report-host=host_name option are visible in this list.\n\nThe list is displayed on any server (not just the primary server). The output\nlooks like this:\n\nSHOW SLAVE HOSTS;\n+------------+-----------+------+-----------+\n| Server_id | Host | Port | Master_id |\n+------------+-----------+------+-----------+\n| 192168010 | iconnect2 | 3306 | 192168011 |\n| 1921680101 | athena | 3306 | 192168011 |\n+------------+-----------+------+-----------+\n\n* Server_id: The unique server ID of the replica server, as configured in the\nserver\'s option file, or on the command line with --server-id=value.\n* Host: The host name of the replica server, as configured in the server\'s\noption file, or on the command line with --report-host=host_name. Note that\nthis can differ from the machine name as configured in the operating system.\n* Port: The port the replica server is listening on.\n* Master_id: The unique server ID of the primary server that the replica\nserver is replicating from.\n\nSome MariaDB and MySQL versions report another variable, rpl_recovery_rank.\nThis variable was never used, and was eventually removed in MariaDB 10.1.2 .\n\nRequires the REPLICATION MASTER ADMIN privilege (>= MariaDB 10.5.2) or the\nREPLICATION SLAVE privilege (<= MariaDB 10.5.1).\n\nSHOW REPLICA HOSTS\n------------------\n\nMariaDB starting with 10.5.1\n----------------------------\nSHOW REPLICA HOSTS is an alias for SHOW SLAVE HOSTS from MariaDB 10.5.1.\n\n\n\nURL: mariadb.com/kb/en/show-slave-hosts/','','https://mariadb.com/kb/en/show-slave-hosts/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (395,26,'SHOW SLAVE STATUS','Syntax\n------\n\nSHOW SLAVE ["connection_name"] STATUS [FOR CHANNEL "connection_name"]\nSHOW REPLICA ["connection_name"] STATUS -- From MariaDB 10.5.1\n\nor\n\nSHOW ALL SLAVES STATUS\nSHOW ALL REPLICAS STATUS -- From MariaDB 10.5.1\n\nDescription\n-----------\n\nThis statement is to be run on a replica and provides status information on\nessential parameters of the replica threads.\n\nThis statement requires the SUPER privilege, the REPLICATION_CLIENT privilege,\nor, from MariaDB 10.5.2, the REPLICATION SLAVE ADMIN privilege, or, from\nMariaDB 10.5.9, the REPLICA MONITOR privilege.\n\nMulti-Source\n------------\n\nThe FULL and "connection_name" options allow you to connect to many primaries\nat the same time.\n\nALL SLAVES (or ALL REPLICAS from MariaDB 10.5.1) gives you a list of all\nconnections to the primary nodes.\n\nThe rows will be sorted according to Connection_name.\n\nIf you specify a connection_name, you only get the information about that\nconnection. If connection_name is not used, then the name set by\ndefault_master_connection is used. If the connection name doesn\'t exist you\nwill get an error: There is no master connection for \'xxx\'.\n\nMariaDB starting with 10.7.0\n----------------------------\nThe FOR CHANNEL keyword was added for MySQL compatibility. This is identical\nas using the channel_name directly after SHOW SLAVE.\n\nColumn Descriptions\n-------------------\n\n+----------------+----------------------------------------+-------------------+\n| Name | Description | Added |\n+----------------+----------------------------------------+-------------------+\n| Connection_nam | Name of the primary connection. | |\n| | Returned with SHOW ALL SLAVES STATUS | |\n| | (or SHOW ALL REPLICAS STATUS from | |\n| | MariaDB 10.5.1) only. | |\n+----------------+----------------------------------------+-------------------+\n| Slave_SQL_Stat | State of SQL thread. Returned with | |\n| | SHOW ALL SLAVES STATUS (or SHOW ALL | |\n| | REPLICAS STATUS from MariaDB 10.5.1) | |\n| | only. See Slave SQL Thread States. | |\n+----------------+----------------------------------------+-------------------+\n| Slave_IO_State | State of I/O thread. See Slave I/O | |\n| | Thread States. | |\n+----------------+----------------------------------------+-------------------+\n| Master_host | Master host that the replica is | |\n| | connected to. | |\n+----------------+----------------------------------------+-------------------+\n| Master_user | Account user name being used to | |\n| | connect to the primary. | |\n+----------------+----------------------------------------+-------------------+\n| Master_port | The port being used to connect to the | |\n| | primary. | |\n+----------------+----------------------------------------+-------------------+\n| Connect_Retry | Time in seconds between retries to | |\n| | connect. The default is 60. The | |\n| | CHANGE MASTER TO statement can set | |\n| | this. The master-retry-count option | |\n| | determines the maximum number of | |\n| | reconnection attempts. | |\n+----------------+----------------------------------------+-------------------+\n| Master_Log_Fil | Name of the primary binary log file | |\n| | that the I/O thread is currently | |\n| | reading from. | |\n+----------------+----------------------------------------+-------------------+\n| Read_Master_Lo | Position up to which the I/O thread | |\n| _Pos | has read in the current primary | |\n| | binary log file. | |\n+----------------+----------------------------------------+-------------------+\n| Relay_Log_File | Name of the relay log file that the | |\n| | SQL thread is currently processing. | |\n+----------------+----------------------------------------+-------------------+\n| Relay_Log_Pos | Position up to which the SQL thread | |\n| | has finished processing in the | |\n| | current relay log file. | |\n+----------------+----------------------------------------+-------------------+\n| Relay_Master_L | Name of the primary binary log file | |\n| g_File | that contains the most recent event | |\n| | executed by the SQL thread. | |\n+----------------+----------------------------------------+-------------------+\n| Slave_IO_Runni | Whether the replica I/O thread is | |\n| g | running and connected (Yes), running | |\n| | but not connected to a primary | |\n| | (Connecting) or not running (No). | |\n+----------------+----------------------------------------+-------------------+\n| Slave_SQL_Runn | Whether or not the SQL thread is | |\n| ng | running. | |\n+----------------+----------------------------------------+-------------------+\n| Replicate_Do_D | Databases specified for replicating | |\n| | with the replicate_do_db option. | |\n+----------------+----------------------------------------+-------------------+\n| Replicate_Igno | Databases specified for ignoring with | |\n| e_DB | the replicate_ignore_db option. | |\n+----------------+----------------------------------------+-------------------+\n| Replicate_Do_T | Tables specified for replicating with | |\n| ble | the replicate_do_table option. | |\n+----------------+----------------------------------------+-------------------+\n| Replicate_Igno | Tables specified for ignoring with | |\n| e_Table | the replicate_ignore_table option. | |\n+----------------+----------------------------------------+-------------------+\n| Replicate_Wild | Tables specified for replicating with | |\n| Do_Table | the replicate_wild_do_table option. | |\n+----------------+----------------------------------------+-------------------+\n| Replicate_Wild | Tables specified for ignoring with | |\n| Ignore_Table | the replicate_wild_ignore_table | |\n| | option. | |\n+----------------+----------------------------------------+-------------------+\n| Last_Errno | Alias for Last_SQL_Errno (see below) | |\n+----------------+----------------------------------------+-------------------+\n| Last Error | Alias for Last_SQL_Error (see below) | |\n+----------------+----------------------------------------+-------------------+\n| Skip_Counter | Number of events that a replica skips | |\n| | from the master, as recorded in the | |\n| | sql_slave_skip_counter system | |\n| | variable. | |\n+----------------+----------------------------------------+-------------------+\n| Exec_Master_Lo | Position up to which the SQL thread | |\n| _Pos | has processed in the current master | |\n| | binary log file. Can be used to start | |\n| | a new replica from a current replica | |\n| | with the CHANGE MASTER TO ... | |\n| | MASTER_LOG_POS option. | |\n+----------------+----------------------------------------+-------------------+\n| Relay_Log_Spac | Total size of all relay log files | |\n| | combined. | |\n+----------------+----------------------------------------+-------------------+\n| Until_Conditio | | |\n| | | |\n+----------------+----------------------------------------+-------------------+\n| Until_Log_File | The MASTER_LOG_FILE value of the | |\n| | START SLAVE UNTIL condition. | |\n+----------------+----------------------------------------+-------------------+\n| Until_Log_Pos | The MASTER_LOG_POS value of the START | |\n| | SLAVE UNTIL condition. | |\n+----------------+----------------------------------------+-------------------+\n| Master_SSL_All | Whether an SSL connection is | |\n| wed | permitted (Yes), not permitted (No) | |\n| | or permitted but without the replica | |\n| | having SSL support enabled (Ignored) | |\n+----------------+----------------------------------------+-------------------+\n| Master_SSL_CA_ | The MASTER_SSL_CA option of the | |\n| ile | CHANGE MASTER TO statement. | |\n+----------------+----------------------------------------+-------------------+\n| Master_SSL_CA_ | The MASTER_SSL_CAPATH option of the | |\n| ath | CHANGE MASTER TO statement. | |\n+----------------+----------------------------------------+-------------------+\n| Master_SSL_Cer | The MASTER_SSL_CERT option of the | |\n| | CHANGE MASTER TO statement. | |\n+----------------+----------------------------------------+-------------------+\n| Master_SSL_Cip | The MASTER_SSL_CIPHER option of the | |\n| er | CHANGE MASTER TO statement. | |\n+----------------+----------------------------------------+-------------------+\n| Master_SSL_Key | The MASTER_SSL_KEY option of the | |\n| | CHANGE MASTER TO statement. | |\n+----------------+----------------------------------------+-------------------+\n| Seconds_Behind | Difference between the timestamp | |\n| Master | logged on the master for the event | |\n| | that the replica is currently | |\n| | processing, and the current timestamp | |\n| | on the replica. Zero if the replica | |\n| | is not currently processing an event. | |\n| | With parallel replication, | |\n| | seconds_behind_master is updated only | |\n| | after transactions commit. | |\n+----------------+----------------------------------------+-------------------+\n| Master_SSL_Ver | The MASTER_SSL_VERIFY_SERVER_CERT | |\n| fy_Server_Cert | option of the CHANGE MASTER TO | |\n| | statement. | |\n+----------------+----------------------------------------+-------------------+\n| Last_IO_Errno | Error code of the most recent error | |\n| | that caused the I/O thread to stop | |\n| | (also recorded in the replica\'s error | |\n| | log). 0 means no error. RESET SLAVE | |\n| | or RESET MASTER will reset this value. | |\n+----------------+----------------------------------------+-------------------+\n| Last_IO_Error | Error message of the most recent | |\n| | error that caused the I/O thread to | |\n| | stop (also recorded in the replica\'s | |\n| | error log). An empty string means no | |\n| | error. RESET SLAVE or RESET MASTER | |\n| | will reset this value. | |\n+----------------+----------------------------------------+-------------------+\n| Last_SQL_Errno | Error code of the most recent error | |\n| | that caused the SQL thread to stop | |\n| | (also recorded in the replica\'s error | |\n| | log). 0 means no error. RESET SLAVE | |\n| | or RESET MASTER will reset this value. | |\n+----------------+----------------------------------------+-------------------+\n| Last_SQL_Error | Error message of the most recent | |\n| | error that caused the SQL thread to | |\n| | stop (also recorded in the replica\'s | |\n| | error log). An empty string means no | |\n| | error. RESET SLAVE or RESET MASTER | |\n| | will reset this value. | |\n+----------------+----------------------------------------+-------------------+\n| Replicate_Igno | List of server_ids that are currently | |\n| e_Server_Ids | being ignored for replication | |\n| | purposes, or an empty string for | |\n| | none, as specified in the | |\n| | IGNORE_SERVER_IDS option of the | |\n| | CHANGE MASTER TO statement. | |\n+----------------+----------------------------------------+-------------------+\n| Master_Server_ | The master\'s server_id value. | |\n| d | | |\n+----------------+----------------------------------------+-------------------+\n| Master_SSL_Crl | The MASTER_SSL_CRL option of the | |\n| | CHANGE MASTER TO statement. | |\n+----------------+----------------------------------------+-------------------+\n| Master_SSL_Crl | The MASTER_SSL_CRLPATH option of the | |\n| ath | CHANGE MASTER TO statement. | |\n+----------------+----------------------------------------+-------------------+\n| Using_Gtid | Whether or not global transaction | |\n| | ID\'s are being used for replication | |\n| | (can be No, Slave_Pos, or | |\n| | Current_Pos). | |\n+----------------+----------------------------------------+-------------------+\n| Gtid_IO_Pos | Current global transaction ID value. | |\n+----------------+----------------------------------------+-------------------+\n| Retried_transa | Number of retried transactions for | |\n| tions | this connection. Returned with SHOW | |\n| | ALL SLAVES STATUS only. | |\n+----------------+----------------------------------------+-------------------+\n| Max_relay_log_ | Max relay log size for this | |\n| ize | connection. Returned with SHOW ALL | |\n| | SLAVES STATUS only. | |\n+----------------+----------------------------------------+-------------------+\n| Executed_log_e | How many log entries the replica has | |\n| tries | executed. Returned with SHOW ALL | |\n| | SLAVES STATUS only. | |\n+----------------+----------------------------------------+-------------------+\n| Slave_received | How many heartbeats we have got from | |\n| heartbeats | the master. Returned with SHOW ALL | |\n| | SLAVES STATUS only. | |\n+----------------+----------------------------------------+-------------------+\n| Slave_heartbea | How often to request a heartbeat | |\n| _period | packet from the master (in seconds). | |\n| | Returned with SHOW ALL SLAVES STATUS | |\n| | only. | |\n+----------------+----------------------------------------+-------------------+\n| Gtid_Slave_Pos | GTID of the last event group | |\n| | replicated on a replica server, for | |\n| | each replication domain, as stored in | |\n| | the gtid_slave_pos system variable. | |\n| | Returned with SHOW ALL SLAVES STATUS | |\n| | only. | |\n+----------------+----------------------------------------+-------------------+\n| SQL_Delay | Value specified by MASTER_DELAY in | MariaDB 10.2.3 |\n| | CHANGE MASTER (or 0 if none). | |\n+----------------+----------------------------------------+-------------------+\n| SQL_Remaining_ | When the replica is delaying the | MariaDB 10.2.3 |\n| elay | execution of an event due to | |\n| | MASTER_DELAY, this is the number of | |\n| | seconds of delay remaining before the | |\n| | event will be applied. Otherwise, the | |\n| | value is NULL. | |\n+----------------+----------------------------------------+-------------------+\n| Slave_SQL_Runn | The state of the SQL driver threads, | MariaDB 10.2.3 |\n| ng_State | same as in SHOW PROCESSLIST. When the | |\n| | replica is delaying the execution of | |\n| | an event due to MASTER_DELAY, this | |\n| | field displays: "Waiting until | |\n| | MASTER_DELAY seconds after master | |\n| | executed event". | |\n+----------------+----------------------------------------+-------------------+\n| Slave_DDL_Grou | This status variable counts the | MariaDB 10.3.7 |\n| s | occurrence of DDL statements. This | |\n| | is a replica-side counter for | |\n| | optimistic parallel replication. | |\n+----------------+----------------------------------------+-------------------+\n| Slave_Non_Tran | This status variable counts the | MariaDB 10.3.7 |\n| actional_Group | occurrence of non-transactional event | |\n| | groups. This is a replica-side | |\n| | counter for optimistic parallel | |\n| | replication. | |\n+----------------+----------------------------------------+-------------------+\n| Slave_Transact | This status variable counts the | MariaDB 10.3.7 |\n| onal_Groups | occurrence of transactional event | |\n| | groups. This is a replica-side | |\n| | counter for optimistic parallel | |\n| | replication. | |\n+----------------+----------------------------------------+-------------------+\n\nSHOW REPLICA STATUS\n-------------------\n\nMariaDB starting with 10.5.1\n----------------------------\nSHOW REPLICA STATUS is an alias for SHOW SLAVE STATUS from MariaDB 10.5.1.\n\nExamples\n--------\n\nIf you issue this statement using the mysql client, you can use a \G statement\nterminator rather than a semicolon to obtain a more readable vertical layout.\n\nSHOW SLAVE STATUS\G\n*************************** 1. row ***************************\n Slave_IO_State: Waiting for master to send event\n Master_Host: db01.example.com\n Master_User: replicant\n Master_Port: 3306\n Connect_Retry: 60\n Master_Log_File: mariadb-bin.000010\n Read_Master_Log_Pos: 548\n Relay_Log_File: relay-bin.000004\n Relay_Log_Pos: 837\n Relay_Master_Log_File: mariadb-bin.000010\n Slave_IO_Running: Yes\n Slave_SQL_Running: Yes\n Replicate_Do_DB:\n Replicate_Ignore_DB:\n Replicate_Do_Table:\n Replicate_Ignore_Table:\n Replicate_Wild_Do_Table:\n Replicate_Wild_Ignore_Table:\n Last_Errno: 0\n Last_Error:\n Skip_Counter: 0\n Exec_Master_Log_Pos: 548\n Relay_Log_Space: 1497\n Until_Condition: None\n Until_Log_File:\n Until_Log_Pos: 0\n Master_SSL_Allowed: No\n Master_SSL_CA_File:\n Master_SSL_CA_Path:\n Master_SSL_Cert:\n Master_SSL_Cipher:\n Master_SSL_Key:\n Seconds_Behind_Master: 0\nMaster_SSL_Verify_Server_Cert: No\n Last_IO_Errno: 0\n Last_IO_Error:\n Last_SQL_Errno: 0\n Last_SQL_Error:\n Replicate_Ignore_Server_Ids:\n Master_Server_Id: 101\n Master_SSL_Crl:\n Master_SSL_Crlpath:\n Using_Gtid: No\n Gtid_IO_Pos:\n\nSHOW ALL SLAVES STATUS\G\n*************************** 1. row ***************************\n Connection_name:\n Slave_SQL_State: Slave has read all relay log; waiting for the\nslave I/O thread to update it\n Slave_IO_State: Waiting for master to send event\n Master_Host: db01.example.com\n Master_User: replicant\n Master_Port: 3306\n Connect_Retry: 60\n Master_Log_File: mariadb-bin.000010\n Read_Master_Log_Pos: 3608\n Relay_Log_File: relay-bin.000004\n Relay_Log_Pos: 3897\n Relay_Master_Log_File: mariadb-bin.000010\n Slave_IO_Running: Yes\n Slave_SQL_Running: Yes\n Replicate_Do_DB:\n Replicate_Ignore_DB:\n Replicate_Do_Table:\n Replicate_Ignore_Table:\n Replicate_Wild_Do_Table:\n Replicate_Wild_Ignore_Table:\n Last_Errno: 0\n Last_Error:\n Skip_Counter: 0\n Exec_Master_Log_Pos: 3608\n Relay_Log_Space: 4557\n Until_Condition: None\n Until_Log_File:\n Until_Log_Pos: 0\n Master_SSL_Allowed: No\n Master_SSL_CA_File:\n Master_SSL_CA_Path:\n Master_SSL_Cert:\n Master_SSL_Cipher:\n Master_SSL_Key:\n Seconds_Behind_Master: 0\nMaster_SSL_Verify_Server_Cert: No\n Last_IO_Errno: 0\n Last_IO_Error:\n Last_SQL_Errno: 0\n Last_SQL_Error:\n Replicate_Ignore_Server_Ids:\n Master_Server_Id: 101\n Master_SSL_Crl:\n Master_SSL_Crlpath:\n Using_Gtid: No\n Gtid_IO_Pos:\n Retried_transactions: 0\n Max_relay_log_size: 104857600\n Executed_log_entries: 40\n Slave_received_heartbeats: 11\n Slave_heartbeat_period: 1800.000\n Gtid_Slave_Pos: 0-101-2320\n\nYou can also access some of the variables directly from status variables:\n\nSET @@default_master_connection="test" ;\nshow status like "%slave%"\n\nVariable_name Value\nCom_show_slave_hosts 0\nCom_show_slave_status 0\nCom_start_all_slaves 0\nCom_start_slave 0\nCom_stop_all_slaves 0\nCom_stop_slave 0\nRpl_semi_sync_slave_status OFF\nSlave_connections 0\nSlave_heartbeat_period 1800.000\nSlave_open_temp_tables 0\nSlave_received_heartbeats 0\nSlave_retried_transactions 0\nSlave_running OFF\nSlaves_connected 0\nSlaves_running 1\n\n\n\nURL: mariadb.com/kb/en/show-slave-status/','','https://mariadb.com/kb/en/show-slave-status/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (396,26,'SHOW STATUS','Syntax\n------\n\nSHOW [GLOBAL | SESSION] STATUS\n [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW STATUS provides server status information. This information also can be\nobtained using the mysqladmin extended-status command, or by querying the\nInformation Schema GLOBAL_STATUS and SESSION_STATUS tables. The LIKE clause,\nif present, indicates which variable names to match. The WHERE clause can be\ngiven to select rows using more general conditions.\n\nWith the GLOBAL modifier, SHOW STATUS displays the status values for all\nconnections to MariaDB. With SESSION, it displays the status values for the\ncurrent connection. If no modifier is present, the default is SESSION. LOCAL\nis a synonym for SESSION. If you see a lot of 0 values, the reason is probably\nthat you have used SHOW STATUS with a new connection instead of SHOW GLOBAL\nSTATUS.\n\nSome status variables have only a global value. For these, you get the same\nvalue for both GLOBAL and SESSION.\n\nSee Server Status Variables for a full list, scope and description of the\nvariables that can be viewed with SHOW STATUS.\n\nThe LIKE clause, if present on its own, indicates which variable name to match.\n\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nExamples\n--------\n\nFull output from MariaDB 10.1.17:\n\nSHOW GLOBAL STATUS;\n+--------------------------------------------------------------+---------------\n------------------------+\n| Variable_name | Value \n |\n+--------------------------------------------------------------+---------------\n------------------------+\n| Aborted_clients | 0 \n |\n| Aborted_connects | 0 \n |\n| Access_denied_errors | 0 \n |\n| Acl_column_grants | 0 \n |\n| Acl_database_grants | 2 \n |\n| Acl_function_grants | 0 \n |\n| Acl_procedure_grants | 0 \n |\n| Acl_proxy_users | 2 \n |\n| Acl_role_grants | 0 \n |\n| Acl_roles | 0 \n |\n| Acl_table_grants | 0 \n |\n| Acl_users | 6 \n |\n| Aria_pagecache_blocks_not_flushed | 0 \n |\n| Aria_pagecache_blocks_unused | 15706 \n |\n| Aria_pagecache_blocks_used | 0 \n |\n| Aria_pagecache_read_requests | 0 \n |\n| Aria_pagecache_reads | 0 \n |\n| Aria_pagecache_write_requests | 0 \n |\n| Aria_pagecache_writes | 0 \n |\n| Aria_transaction_log_syncs | 0 \n |\n| Binlog_commits | 0 \n |\n| Binlog_group_commits | 0 \n |\n| Binlog_group_commit_trigger_count | 0 \n |\n| Binlog_group_commit_trigger_lock_wait | 0 \n |\n| Binlog_group_commit_trigger_timeout | 0 \n |\n| Binlog_snapshot_file | \n |\n| Binlog_snapshot_position | 0 \n |\n| Binlog_bytes_written | 0 \n |\n| Binlog_cache_disk_use | 0 \n |\n| Binlog_cache_use | 0 \n |\n| Binlog_stmt_cache_disk_use | 0 \n |\n| Binlog_stmt_cache_use | 0 \n |\n| Busy_time | 0.000000 \n |\n| Bytes_received | 432 \n |\n| Bytes_sent | 15183 \n |\n| Com_admin_commands | 1 \n |\n| Com_alter_db | 0 \n |\n| Com_alter_db_upgrade | 0 \n |\n| Com_alter_event | 0 \n |\n| Com_alter_function | 0 \n |\n| Com_alter_procedure | 0 \n |\n| Com_alter_server | 0 \n |\n| Com_alter_table | 0 \n |\n| Com_alter_tablespace | 0 \n |\n| Com_analyze | 0 \n |\n| Com_assign_to_keycache | 0 \n |\n| Com_begin | 0 \n |\n| Com_binlog | 0 \n |\n| Com_call_procedure | 0 \n |\n| Com_change_db | 0 \n |\n| Com_change_master | 0 \n |\n| Com_check | 0 \n |\n| Com_checksum | 0 \n |\n| Com_commit | 0 \n |\n| Com_compound_sql | 0 \n |\n| Com_create_db | 0 \n |\n| Com_create_event | 0 \n |\n| Com_create_function | 0 \n |\n| Com_create_index | 0 \n |\n| Com_create_procedure | 0 \n |\n| Com_create_role | 0 \n |\n| Com_create_server | 0 \n |\n| Com_create_table | 0 \n |\n| Com_create_temporary_table | 0 \n |\n| Com_create_trigger | 0 \n |\n| Com_create_udf | 0 \n |\n| Com_create_user | 0 \n |\n| Com_create_view | 0 \n |\n| Com_dealloc_sql | 0 \n |\n| Com_delete | 0 \n |\n| Com_delete_multi | 0 \n |\n| Com_do | 0 \n |\n| Com_drop_db | 0 \n |\n| Com_drop_event | 0 \n |\n| Com_drop_function | 0 \n |\n| Com_drop_index | 0 \n |\n| Com_drop_procedure | 0 \n |\n| Com_drop_role | 0 \n |\n| Com_drop_server | 0 \n |\n| Com_drop_table | 0 \n |\n| Com_drop_temporary_table | 0 \n |\n| Com_drop_trigger | 0 \n |\n| Com_drop_user | 0 \n |\n| Com_drop_view | 0 \n |\n| Com_empty_query | 0 \n |\n| Com_execute_sql | 0 \n |\n| Com_flush | 0 \n |\n| Com_get_diagnostics | 0 \n |\n| Com_grant | 0 \n |\n| Com_grant_role | 0 \n |\n| Com_ha_close | 0 \n |\n| Com_ha_open | 0 \n |\n| Com_ha_read | 0 \n |\n| Com_help | 0 \n |\n| Com_insert | 0 \n |\n| Com_insert_select | 0 \n |\n| Com_install_plugin | 0 \n |\n| Com_kill | 0 \n |\n| Com_load | 0 \n |\n| Com_lock_tables | 0 \n |\n| Com_optimize | 0 \n |\n| Com_preload_keys | 0 \n |\n| Com_prepare_sql | 0 \n |\n| Com_purge | 0 \n |\n| Com_purge_before_date | 0 \n |\n| Com_release_savepoint | 0 \n |\n| Com_rename_table | 0 \n |\n| Com_rename_user | 0 \n |\n| Com_repair | 0 \n |\n| Com_replace | 0 \n |\n| Com_replace_select | 0 \n |\n| Com_reset | 0 \n |\n| Com_resignal | 0 \n |\n| Com_revoke | 0 \n |\n| Com_revoke_all | 0 \n |\n| Com_revoke_role | 0 \n |\n| Com_rollback | 0 \n |\n| Com_rollback_to_savepoint | 0 \n |\n| Com_savepoint | 0 \n |\n| Com_select | 1 \n |\n| Com_set_option | 0 \n |\n| Com_show_authors | 0 \n |\n| Com_show_binlog_events | 0 \n |\n| Com_show_binlogs | 0 \n |\n| Com_show_charsets | 0 \n |\n| Com_show_collations | 0 \n |\n| Com_show_contributors | 0 \n |\n| Com_show_create_db | 0 \n |\n| Com_show_create_event | 0 \n |\n| Com_show_create_func | 0 \n |\n| Com_show_create_proc | 0 \n |\n| Com_show_create_table | 0 \n |\n| Com_show_create_trigger | 0 \n |\n| Com_show_databases | 0 \n |\n| Com_show_engine_logs | 0 \n |\n| Com_show_engine_mutex | 0 \n |\n| Com_show_engine_status | 0 \n |\n| Com_show_errors | 0 \n |\n| Com_show_events | 0 \n |\n| Com_show_explain | 0 \n |\n| Com_show_fields | 0 \n |\n| Com_show_function_status | 0 \n |\n| Com_show_generic | 0 \n |\n| Com_show_grants | 0 \n |\n| Com_show_keys | 0 \n |\n| Com_show_master_status | 0 \n |\n| Com_show_open_tables | 0 \n |\n| Com_show_plugins | 0 \n |\n| Com_show_privileges | 0 \n |\n| Com_show_procedure_status | 0 \n |\n| Com_show_processlist | 0 \n |\n| Com_show_profile | 0 \n |\n| Com_show_profiles | 0 \n |\n| Com_show_relaylog_events | 0 \n |\n| Com_show_slave_hosts | 0 \n |\n| Com_show_slave_status | 0 \n |\n| Com_show_status | 2 \n |\n| Com_show_storage_engines | 0 \n |\n| Com_show_table_status | 0 \n |\n| Com_show_tables | 0 \n |\n| Com_show_triggers | 0 \n |\n| Com_show_variables | 0 \n |\n| Com_show_warnings | 0 \n |\n| Com_shutdown | 0 \n |\n| Com_signal | 0 \n |\n| Com_start_all_slaves | 0 \n |\n| Com_start_slave | 0 \n |\n| Com_stmt_close | 0 \n |\n| Com_stmt_execute | 0 \n |\n| Com_stmt_fetch | 0 \n |\n| Com_stmt_prepare | 0 \n |\n| Com_stmt_reprepare | 0 \n |\n| Com_stmt_reset | 0 \n |\n| Com_stmt_send_long_data | 0 \n |\n| Com_stop_all_slaves | 0 \n |\n| Com_stop_slave | 0 \n |\n| Com_truncate | 0 \n |\n| Com_uninstall_plugin | 0 \n |\n| Com_unlock_tables | 0 \n |\n| Com_update | 0 \n |\n| Com_update_multi | 0 \n |\n| Com_xa_commit | 0 \n |\n| Com_xa_end | 0 \n |\n| Com_xa_prepare | 0 \n |\n| Com_xa_recover | 0 \n |\n| Com_xa_rollback | 0 \n |\n| Com_xa_start | 0 \n |\n| Compression | OFF \n |\n| Connection_errors_accept | 0 \n |\n| Connection_errors_internal | 0 \n |\n| Connection_errors_max_connections | 0 \n |\n| Connection_errors_peer_address | 0 \n |\n| Connection_errors_select | 0 \n |\n| Connection_errors_tcpwrap | 0 \n |\n| Connections | 4 \n |\n| Cpu_time | 0.000000 \n |\n| Created_tmp_disk_tables | 0 \n |\n| Created_tmp_files | 6 \n |\n| Created_tmp_tables | 2 \n |\n| Delayed_errors | 0 \n |\n| Delayed_insert_threads | 0 \n |\n| Delayed_writes | 0 \n |\n| Delete_scan | 0 \n |\n| Empty_queries | 0 \n |\n| Executed_events | 0 \n |\n| Executed_triggers | 0 \n |\n| Feature_delay_key_write | 0 \n |\n| Feature_dynamic_columns | 0 \n |\n| Feature_fulltext | 0 \n |\n| Feature_gis | 0 \n |\n| Feature_locale | 0 \n |\n| Feature_subquery | 0 \n |\n| Feature_timezone | 0 \n |\n| Feature_trigger | 0 \n |\n| Feature_xml | 0 \n |\n| Flush_commands | 1 \n |\n| Handler_commit | 1 \n |\n| Handler_delete | 0 \n |\n| Handler_discover | 0 \n |\n| Handler_external_lock | 0 \n |\n| Handler_icp_attempts | 0 \n |\n| Handler_icp_match | 0 \n |\n| Handler_mrr_init | 0 \n |\n| Handler_mrr_key_refills | 0 \n |\n| Handler_mrr_rowid_refills | 0 \n |\n| Handler_prepare | 0 \n |\n| Handler_read_first | 3 \n |\n| Handler_read_key | 0 \n |\n| Handler_read_last | 0 \n |\n| Handler_read_next | 0 \n |\n| Handler_read_prev | 0 \n |\n| Handler_read_retry | 0 \n |\n| Handler_read_rnd | 0 \n |\n| Handler_read_rnd_deleted | 0 \n |\n| Handler_read_rnd_next | 537 \n |\n| Handler_rollback | 0 \n |\n| Handler_savepoint | 0 \n |\n| Handler_savepoint_rollback | 0 \n |\n| Handler_tmp_update | 0 \n |\n| Handler_tmp_write | 516 \n |\n| Handler_update | 0 \n |\n| Handler_write | 0 \n |\n| Innodb_available_undo_logs | 128 \n |\n| Innodb_background_log_sync | 222 \n |\n| Innodb_buffer_pool_bytes_data | 2523136 \n |\n| Innodb_buffer_pool_bytes_dirty | 0 \n |\n| Innodb_buffer_pool_dump_status | Dumping\nbuffer pool(s) not yet started |\n| Innodb_buffer_pool_load_status | Loading\nbuffer pool(s) not yet started |\n| Innodb_buffer_pool_pages_data | 154 \n |\n| Innodb_buffer_pool_pages_dirty | 0 \n |\n| Innodb_buffer_pool_pages_flushed | 1 \n |\n| Innodb_buffer_pool_pages_free | 8037 \n |\n| Innodb_buffer_pool_pages_lru_flushed | 0 \n |\n| Innodb_buffer_pool_pages_made_not_young | 0 \n |\n| Innodb_buffer_pool_pages_made_young | 0 \n |\n| Innodb_buffer_pool_pages_misc | 0 \n |\n| Innodb_buffer_pool_pages_old | 0 \n |\n| Innodb_buffer_pool_pages_total | 8191 \n |\n| Innodb_buffer_pool_read_ahead | 0 \n |\n| Innodb_buffer_pool_read_ahead_evicted | 0 \n |\n| Innodb_buffer_pool_read_ahead_rnd | 0 \n |\n| Innodb_buffer_pool_read_requests | 558 \n |\n| Innodb_buffer_pool_reads | 155 \n |\n| Innodb_buffer_pool_wait_free | 0 \n |\n| Innodb_buffer_pool_write_requests | 1 \n |\n| Innodb_checkpoint_age | 0 \n |\n| Innodb_checkpoint_max_age | 80826164 \n |\n| Innodb_data_fsyncs | 5 \n |\n| Innodb_data_pending_fsyncs | 0 \n |\n| Innodb_data_pending_reads | 0 \n |\n| Innodb_data_pending_writes | 0 \n |\n| Innodb_data_read | 2609664 \n |\n| Innodb_data_reads | 172 \n |\n| Innodb_data_writes | 5 \n |\n| Innodb_data_written | 34304 \n |\n| Innodb_dblwr_pages_written | 1 \n |\n| Innodb_dblwr_writes | 1 \n |\n| Innodb_deadlocks | 0 \n |\n| Innodb_have_atomic_builtins | ON \n |\n| Innodb_history_list_length | 0 \n |\n| Innodb_ibuf_discarded_delete_marks | 0 \n |\n| Innodb_ibuf_discarded_deletes | 0 \n |\n| Innodb_ibuf_discarded_inserts | 0 \n |\n| Innodb_ibuf_free_list | 0 \n |\n| Innodb_ibuf_merged_delete_marks | 0 \n |\n| Innodb_ibuf_merged_deletes | 0 \n |\n| Innodb_ibuf_merged_inserts | 0 \n |\n| Innodb_ibuf_merges | 0 \n |\n| Innodb_ibuf_segment_size | 2 \n |\n| Innodb_ibuf_size | 1 \n |\n| Innodb_log_waits | 0 \n |\n| Innodb_log_write_requests | 0 \n |\n| Innodb_log_writes | 1 \n |\n| Innodb_lsn_current | 1616829 \n |\n| Innodb_lsn_flushed | 1616829 \n |\n| Innodb_lsn_last_checkpoint | 1616829 \n |\n| Innodb_master_thread_active_loops | 0 \n |\n| Innodb_master_thread_idle_loops | 222 \n |\n| Innodb_max_trx_id | 2308 \n |\n| Innodb_mem_adaptive_hash | 2217568 \n |\n| Innodb_mem_dictionary | 630703 \n |\n| Innodb_mem_total | 140771328 \n |\n| Innodb_mutex_os_waits | 1 \n |\n| Innodb_mutex_spin_rounds | 30 \n |\n| Innodb_mutex_spin_waits | 1 \n |\n| Innodb_oldest_view_low_limit_trx_id | 0 \n |\n| Innodb_os_log_fsyncs | 3 \n |\n| Innodb_os_log_pending_fsyncs | 0 \n |\n| Innodb_os_log_pending_writes | 0 \n |\n| Innodb_os_log_written | 512 \n |\n| Innodb_page_size | 16384 \n |\n| Innodb_pages_created | 0 \n |\n| Innodb_pages_read | 154 \n |\n| Innodb_pages_written | 1 \n |\n| Innodb_purge_trx_id | 0 \n |\n| Innodb_purge_undo_no | 0 \n |\n| Innodb_read_views_memory | 88 \n |\n| Innodb_row_lock_current_waits | 0 \n |\n| Innodb_row_lock_time | 0 \n |\n| Innodb_row_lock_time_avg | 0 \n |\n| Innodb_row_lock_time_max | 0 \n |\n| Innodb_row_lock_waits | 0 \n |\n| Innodb_rows_deleted | 0 \n |\n| Innodb_rows_inserted | 0 \n |\n| Innodb_rows_read | 0 \n |\n| Innodb_rows_updated | 0 \n |\n| Innodb_system_rows_deleted | 0 \n |\n| Innodb_system_rows_inserted | 0 \n |\n| Innodb_system_rows_read | 0 \n |\n| Innodb_system_rows_updated | 0 \n |\n| Innodb_s_lock_os_waits | 2 \n |\n| Innodb_s_lock_spin_rounds | 60 \n |\n| Innodb_s_lock_spin_waits | 2 \n |\n| Innodb_truncated_status_writes | 0 \n |\n| Innodb_x_lock_os_waits | 0 \n |\n| Innodb_x_lock_spin_rounds | 0 \n |\n| Innodb_x_lock_spin_waits | 0 \n |\n| Innodb_page_compression_saved | 0 \n |\n| Innodb_page_compression_trim_sect512 | 0 \n |\n| Innodb_page_compression_trim_sect1024 | 0 \n |\n| Innodb_page_compression_trim_sect2048 | 0 \n |\n| Innodb_page_compression_trim_sect4096 | 0 \n |\n| Innodb_page_compression_trim_sect8192 | 0 \n |\n| Innodb_page_compression_trim_sect16384 | 0 \n |\n| Innodb_page_compression_trim_sect32768 | 0 \n |\n| Innodb_num_index_pages_written | 0 \n |\n| Innodb_num_non_index_pages_written | 5 \n |\n| Innodb_num_pages_page_compressed | 0 \n |\n| Innodb_num_page_compressed_trim_op | 0 \n |\n| Innodb_num_page_compressed_trim_op_saved | 0 \n |\n| Innodb_num_pages_page_decompressed | 0 \n |\n| Innodb_num_pages_page_compression_error | 0 \n |\n| Innodb_num_pages_encrypted | 0 \n |\n| Innodb_num_pages_decrypted | 0 \n |\n| Innodb_have_lz4 | OFF \n |\n| Innodb_have_lzo | OFF \n |\n| Innodb_have_lzma | OFF \n |\n| Innodb_have_bzip2 | OFF \n |\n| Innodb_have_snappy | OFF \n |\n| Innodb_defragment_compression_failures | 0 \n |\n| Innodb_defragment_failures | 0 \n |\n| Innodb_defragment_count | 0 \n |\n| Innodb_onlineddl_rowlog_rows | 0 \n |\n| Innodb_onlineddl_rowlog_pct_used | 0 \n |\n| Innodb_onlineddl_pct_progress | 0 \n |\n| Innodb_secondary_index_triggered_cluster_reads | 0 \n |\n| Innodb_secondary_index_triggered_cluster_reads_avoided | 0 \n |\n| Innodb_encryption_rotation_pages_read_from_cache | 0 \n |\n| Innodb_encryption_rotation_pages_read_from_disk | 0 \n |\n| Innodb_encryption_rotation_pages_modified | 0 \n |\n| Innodb_encryption_rotation_pages_flushed | 0 \n |\n| Innodb_encryption_rotation_estimated_iops | 0 \n |\n| Innodb_scrub_background_page_reorganizations | 0 \n |\n| Innodb_scrub_background_page_splits | 0 \n |\n| Innodb_scrub_background_page_split_failures_underflow | 0 \n |\n| Innodb_scrub_background_page_split_failures_out_of_filespace | 0 \n |\n| Innodb_scrub_background_page_split_failures_missing_index | 0 \n |\n| Innodb_scrub_background_page_split_failures_unknown | 0 \n |\n| Key_blocks_not_flushed | 0 \n |\n| Key_blocks_unused | 107163 \n |\n| Key_blocks_used | 0 \n |\n| Key_blocks_warm | 0 \n |\n| Key_read_requests | 0 \n |\n| Key_reads | 0 \n |\n| Key_write_requests | 0 \n |\n| Key_writes | 0 \n |\n| Last_query_cost | 0.000000 \n |\n| Master_gtid_wait_count | 0 \n |\n| Master_gtid_wait_time | 0 \n |\n| Master_gtid_wait_timeouts | 0 \n |\n| Max_statement_time_exceeded | 0 \n |\n| Max_used_connections | 1 \n |\n| Memory_used | 273614696 \n |\n| Not_flushed_delayed_rows | 0 \n |\n| Open_files | 25 \n |\n| Open_streams | 0 \n |\n| Open_table_definitions | 18 \n |\n| Open_tables | 11 \n |\n| Opened_files | 77 \n |\n| Opened_plugin_libraries | 0 \n |\n| Opened_table_definitions | 18 \n |\n| Opened_tables | 18 \n |\n| Opened_views | 0 \n |\n| Performance_schema_accounts_lost | 0 \n |\n| Performance_schema_cond_classes_lost | 0 \n |\n| Performance_schema_cond_instances_lost | 0 \n |\n| Performance_schema_digest_lost | 0 \n |\n| Performance_schema_file_classes_lost | 0 \n |\n| Performance_schema_file_handles_lost | 0 \n |\n| Performance_schema_file_instances_lost | 0 \n |\n| Performance_schema_hosts_lost | 0 \n |\n| Performance_schema_locker_lost | 0 \n |\n| Performance_schema_mutex_classes_lost | 0 \n |\n| Performance_schema_mutex_instances_lost | 0 \n |\n| Performance_schema_rwlock_classes_lost | 0 \n |\n| Performance_schema_rwlock_instances_lost | 0 \n |\n| Performance_schema_session_connect_attrs_lost | 0 \n |\n| Performance_schema_socket_classes_lost | 0 \n |\n| Performance_schema_socket_instances_lost | 0 \n |\n| Performance_schema_stage_classes_lost | 0 \n |\n| Performance_schema_statement_classes_lost | 0 \n |\n| Performance_schema_table_handles_lost | 0 \n |\n| Performance_schema_table_instances_lost | 0 \n |\n| Performance_schema_thread_classes_lost | 0 \n |\n| Performance_schema_thread_instances_lost | 0 \n |\n| Performance_schema_users_lost | 0 \n |\n| Prepared_stmt_count | 0 \n |\n| Qcache_free_blocks | 1 \n |\n| Qcache_free_memory | 1031336 \n |\n| Qcache_hits | 0 \n |\n| Qcache_inserts | 0 \n |\n| Qcache_lowmem_prunes | 0 \n |\n| Qcache_not_cached | 0 \n |\n| Qcache_queries_in_cache | 0 \n |\n| Qcache_total_blocks | 1 \n |\n| Queries | 4 \n |\n| Questions | 4 \n |\n| Rows_read | 10 \n |\n| Rows_sent | 517 \n |\n| Rows_tmp_read | 516 \n |\n| Rpl_status | AUTH_MASTER \n |\n| Select_full_join | 0 \n |\n| Select_full_range_join | 0 \n |\n| Select_range | 0 \n |\n| Select_range_check | 0 \n |\n| Select_scan | 2 \n |\n| Slave_connections | 0 \n |\n| Slave_heartbeat_period | 0.000 \n |\n| Slave_open_temp_tables | 0 \n |\n| Slave_received_heartbeats | 0 \n |\n| Slave_retried_transactions | 0 \n |\n| Slave_running | OFF \n |\n| Slave_skipped_errors | 0 \n |\n| Slaves_connected | 0 \n |\n| Slaves_running | 0 \n |\n| Slow_launch_threads | 0 \n |\n| Slow_queries | 0 \n |\n| Sort_merge_passes | 0 \n |\n| Sort_priority_queue_sorts | 0 \n |\n| Sort_range | 0 \n |\n| Sort_rows | 0 \n |\n| Sort_scan | 0 \n |\n| Ssl_accept_renegotiates | 0 \n |\n| Ssl_accepts | 0 \n |\n| Ssl_callback_cache_hits | 0 \n |\n| Ssl_cipher | \n |\n| Ssl_cipher_list | \n |\n| Ssl_client_connects | 0 \n |\n| Ssl_connect_renegotiates | 0 \n |\n| Ssl_ctx_verify_depth | 0 \n |\n| Ssl_ctx_verify_mode | 0 \n |\n| Ssl_default_timeout | 0 \n |\n| Ssl_finished_accepts | 0 \n |\n| Ssl_finished_connects | 0 \n |\n| Ssl_server_not_after | \n |\n| Ssl_server_not_before | \n |\n| Ssl_session_cache_hits | 0 \n |\n| Ssl_session_cache_misses | 0 \n |\n| Ssl_session_cache_mode | NONE \n |\n| Ssl_session_cache_overflows | 0 \n |\n| Ssl_session_cache_size | 0 \n |\n| Ssl_session_cache_timeouts | 0 \n |\n| Ssl_sessions_reused | 0 \n |\n| Ssl_used_session_cache_entries | 0 \n |\n| Ssl_verify_depth | 0 \n |\n| Ssl_verify_mode | 0 \n |\n| Ssl_version | \n |\n| Subquery_cache_hit | 0 \n |\n| Subquery_cache_miss | 0 \n |\n| Syncs | 2 \n |\n| Table_locks_immediate | 21 \n |\n| Table_locks_waited | 0 \n |\n| Tc_log_max_pages_used | 0 \n |\n| Tc_log_page_size | 4096 \n |\n| Tc_log_page_waits | 0 \n |\n| Threadpool_idle_threads | 0 \n |\n| Threadpool_threads | 0 \n |\n| Threads_cached | 0 \n |\n| Threads_connected | 1 \n |\n| Threads_created | 2 \n |\n| Threads_running | 1 \n |\n| Update_scan | 0 \n |\n| Uptime | 223 \n |\n| Uptime_since_flush_status | 223 \n |\n| wsrep_cluster_conf_id |\n18446744073709551615 |\n| wsrep_cluster_size | 0 \n |\n| wsrep_cluster_state_uuid | \n |\n| wsrep_cluster_status | Disconnected \n |\n| wsrep_connected | OFF \n |\n| wsrep_local_bf_aborts | 0 \n |\n| wsrep_local_index |\n18446744073709551615 |\n| wsrep_provider_name | \n |\n| wsrep_provider_vendor | \n |\n| wsrep_provider_version | \n |\n| wsrep_ready | OFF \n |\n| wsrep_thread_count | 0 \n |\n+--------------------------------------------------------------+---------------\n------------------------+\n516 rows in set (0.00 sec)\n\nExample of filtered output:\n\nSHOW STATUS LIKE \'Key%\';\n+------------------------+--------+\n| Variable_name | Value |\n+------------------------+--------+\n| Key_blocks_not_flushed | 0 |\n| Key_blocks_unused | 107163 |\n| Key_blocks_used | 0 |\n| Key_blocks_warm | 0 |\n| Key_read_requests | 0 |\n| Key_reads | 0 |\n| Key_write_requests | 0 |\n| Key_writes | 0 |\n+------------------------+--------+\n8 rows in set (0.00 sec)\n\n\n\nURL: mariadb.com/kb/en/show-status/','','https://mariadb.com/kb/en/show-status/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (397,26,'SHOW TABLE STATUS','Syntax\n------\n\nSHOW TABLE STATUS [{FROM | IN} db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW TABLE STATUS works like SHOW TABLES, but provides more extensive\ninformation about each non-TEMPORARY table.\n\nThe LIKE clause, if present on its own, indicates which table names to match.\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nThe following information is returned:\n\n+---------------------------+-------------------------------------------------+\n| Column | Description |\n+---------------------------+-------------------------------------------------+\n| Name | Table name. |\n+---------------------------+-------------------------------------------------+\n| Engine | Table storage engine. |\n+---------------------------+-------------------------------------------------+\n| Version | Version number from the table\'s .frm file. |\n+---------------------------+-------------------------------------------------+\n| Row_format | Row format (see InnoDB, Aria and MyISAM row |\n| | formats). |\n+---------------------------+-------------------------------------------------+\n| Rows | Number of rows in the table. Some engines, |\n| | such as XtraDB and InnoDB may store an |\n| | estimate. |\n+---------------------------+-------------------------------------------------+\n| Avg_row_length | Average row length in the table. |\n+---------------------------+-------------------------------------------------+\n| Data_length | For InnoDB/XtraDB, the index size, in pages, |\n| | multiplied by the page size. For Aria and |\n| | MyISAM, length of the data file, in bytes. For |\n| | MEMORY, the approximate allocated memory. |\n+---------------------------+-------------------------------------------------+\n| Max_data_length | Maximum length of the data file, ie the total |\n| | number of bytes that could be stored in the |\n| | table. Not used in XtraDB and InnoDB. |\n+---------------------------+-------------------------------------------------+\n| Index_length | Length of the index file. |\n+---------------------------+-------------------------------------------------+\n| Data_free | Bytes allocated but unused. For InnoDB tables |\n| | in a shared tablespace, the free space of the |\n| | shared tablespace with small safety margin. An |\n| | estimate in the case of partitioned tables - |\n| | see the PARTITIONS table. |\n+---------------------------+-------------------------------------------------+\n| Auto_increment | Next AUTO_INCREMENT value. |\n+---------------------------+-------------------------------------------------+\n| Create_time | Time the table was created. |\n+---------------------------+-------------------------------------------------+\n| Update_time | Time the table was last updated. On Windows, |\n| | the timestamp is not updated on update, so |\n| | MyISAM values will be inaccurate. In InnoDB, |\n| | if shared tablespaces are used, will be NULL, |\n| | while buffering can also delay the update, so |\n| | the value will differ from the actual time of |\n| | the last UPDATE, INSERT or DELETE. |\n+---------------------------+-------------------------------------------------+\n| Check_time | Time the table was last checked. Not kept by |\n| | all storage engines, in which case will be |\n| | NULL. |\n+---------------------------+-------------------------------------------------+\n| Collation | Character set and collation. |\n+---------------------------+-------------------------------------------------+\n| Checksum | Live checksum value, if any. |\n+---------------------------+-------------------------------------------------+\n| Create_options | Extra CREATE TABLE options. |\n+---------------------------+-------------------------------------------------+\n| Comment | Table comment provided when MariaDB created |\n| | the table. |\n+---------------------------+-------------------------------------------------+\n| Max_index_length | Maximum index length (supported by MyISAM and |\n| | Aria tables). Added in MariaDB 10.3.5. |\n+---------------------------+-------------------------------------------------+\n| Temporary | Placeholder to signal that a table is a |\n| | temporary table. Currently always "N", except |\n| | "Y" for generated information_schema tables |\n| | and NULL for views. Added in MariaDB 10.3.5. |\n+---------------------------+-------------------------------------------------+\n\nSimilar information can be found in the information_schema.TABLES table as\nwell as by using mysqlshow:\n\nmysqlshow --status db_name\n\nViews\n-----\n\nFor views, all columns in SHOW TABLE STATUS are NULL except \'Name\' and\n\'Comment\'\n\nExample\n-------\n\nshow table status\G\n*************************** 1. row ***************************\n Name: bus_routes\n Engine: InnoDB\n Version: 10\n Row_format: Dynamic\n Rows: 5\n Avg_row_length: 3276\n Data_length: 16384\nMax_data_length: 0\n Index_length: 0\n Data_free: 0\n Auto_increment: NULL\n Create_time: 2017-05-24 11:17:46\n Update_time: NULL\n Check_time: NULL\n Collation: latin1_swedish_ci\n Checksum: NULL\n Create_options: \n Comment:\n\n\n\nURL: mariadb.com/kb/en/show-table-status/','','https://mariadb.com/kb/en/show-table-status/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (398,26,'SHOW TABLES','Syntax\n------\n\nSHOW [FULL] TABLES [FROM db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW TABLES lists the non-TEMPORARY tables, sequences and views in a given\ndatabase.\n\nThe LIKE clause, if present on its own, indicates which table names to match.\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW. For example, when searching for\ntables in the test database, the column name for use in the WHERE and LIKE\nclauses will be Tables_in_test\n\nThe FULL modifier is supported such that SHOW FULL TABLES displays a second\noutput column. Values for the second column, Table_type, are BASE TABLE for a\ntable, VIEW for a view and SEQUENCE for a sequence.\n\nYou can also get this information using:\n\nmysqlshow db_name\n\nSee mysqlshow for more details.\n\nIf you have no privileges for a base table or view, it does not show up in the\noutput from SHOW TABLES or mysqlshow db_name.\n\nThe information_schema.TABLES table, as well as the SHOW TABLE STATUS\nstatement, provide extended information about tables.\n\nExamples\n--------\n\nSHOW TABLES;\n+----------------------+\n| Tables_in_test |\n+----------------------+\n| animal_count |\n| animals |\n| are_the_mooses_loose |\n| aria_test2 |\n| t1 |\n| view1 |\n+----------------------+\n\nShowing the tables beginning with a only.\n\nSHOW TABLES WHERE Tables_in_test LIKE \'a%\';\n+----------------------+\n| Tables_in_test |\n+----------------------+\n| animal_count |\n| animals |\n| are_the_mooses_loose |\n| aria_test2 |\n+----------------------+\n\nShowing tables and table types:\n\nSHOW FULL TABLES;\n+----------------+------------+\n| Tables_in_test | Table_type |\n+----------------+------------+\n| s1 | SEQUENCE |\n| student | BASE TABLE |\n| v1 | VIEW |\n+----------------+------------+\n\n\n\nURL: mariadb.com/kb/en/show-tables/','','https://mariadb.com/kb/en/show-tables/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (399,26,'SHOW TABLE_STATISTICS','Syntax\n------\n\nSHOW TABLE_STATISTICS\n\nDescription\n-----------\n\nThe SHOW TABLE_STATISTICS statementis part of the User Statistics feature. It\nwas removed as a separate statement in MariaDB 10.1.1, but effectively\nreplaced by the generic SHOW information_schema_table statement. The\ninformation_schema.TABLE_STATISTICS table shows statistics on table usage\n\nThe userstat system variable must be set to 1 to activate this feature. See\nthe User Statistics and information_schema.TABLE_STATISTICS articles for more\ninformation.\n\nExample\n-------\n\nSHOW TABLE_STATISTICS\G\n*************************** 1. row ***************************\n Table_schema: mysql\n Table_name: proxies_priv\n Rows_read: 2\n Rows_changed: 0\nRows_changed_x_#indexes: 0\n*************************** 2. row ***************************\n Table_schema: test\n Table_name: employees_example\n Rows_read: 7\n Rows_changed: 0\nRows_changed_x_#indexes: 0\n*************************** 3. row ***************************\n Table_schema: mysql\n Table_name: user\n Rows_read: 16\n Rows_changed: 0\nRows_changed_x_#indexes: 0\n*************************** 4. row ***************************\n Table_schema: mysql\n Table_name: db\n Rows_read: 2\n Rows_changed: 0\nRows_changed_x_#indexes: 0\n\n\n\nURL: mariadb.com/kb/en/show-table-statistics/','','https://mariadb.com/kb/en/show-table-statistics/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (400,26,'SHOW TRIGGERS','Syntax\n------\n\nSHOW TRIGGERS [FROM db_name]\n [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW TRIGGERS lists the triggers currently defined for tables in a database\n(the default database unless a FROM clause is given). This statement requires\nthe TRIGGER privilege (prior to MySQL 5.1.22, it required the SUPER privilege).\n\nThe LIKE clause, if present on its own, indicates which table names to match\nand causes the statement to display triggers for those tables. The WHERE and\nLIKE clauses can be given to select rows using more general conditions, as\ndiscussed in Extended SHOW.\n\nSimilar information is stored in the information_schema.TRIGGERS table.\n\nMariaDB starting with 10.2.3\n----------------------------\nIf there are multiple triggers for the same action, then the triggers are\nshown in action order.\n\nExamples\n--------\n\nFor the trigger defined at Trigger Overview:\n\nSHOW triggers Like \'animals\' \G\n*************************** 1. row ***************************\n Trigger: the_mooses_are_loose\n Event: INSERT\n Table: animals\n Statement: BEGIN\n IF NEW.name = \'Moose\' THEN\n UPDATE animal_count SET animal_count.animals = animal_count.animals+100;\n ELSE \n UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\n END IF;\nEND\n Timing: AFTER\n Created: 2016-09-29 13:53:34.35\n sql_mode:\n Definer: root@localhost\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nListing all triggers associated with a certain table:\n\nSHOW TRIGGERS FROM test WHERE `Table` = \'user\' \G\n*************************** 1. row ***************************\n Trigger: user_ai\n Event: INSERT\n Table: user\n Statement: BEGIN END\n Timing: AFTER\n Created: 2016-09-29 13:53:34.35\n sql_mode:\n Definer: root@%\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\nSHOW triggers WHERE Event Like \'Insert\' \G\n*************************** 1. row ***************************\n Trigger: the_mooses_are_loose\n Event: INSERT\n Table: animals\n Statement: BEGIN\n IF NEW.name = \'Moose\' THEN\n UPDATE animal_count SET animal_count.animals = animal_count.animals+100;\n ELSE \n UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\n END IF;\nEND\n Timing: AFTER\n Created: 2016-09-29 13:53:34.35\n sql_mode:\n Definer: root@localhost\ncharacter_set_client: utf8\ncollation_connection: utf8_general_ci\n Database Collation: latin1_swedish_ci\n\n* character_set_client is the session value of the character_set_client system\nvariable when the trigger was created. \n* collation_connection is the session value of the collation_connection system\nvariable when the trigger was\n created. \n* Database Collation is the collation of the database \n with which the trigger is associated.\n\nThese columns were added in MariaDB/MySQL 5.1.21.\n\nOld triggers created before MySQL 5.7 and MariaDB 10.2.3 has NULL in the\nCreated column.\n\n\n\nURL: mariadb.com/kb/en/show-triggers/','','https://mariadb.com/kb/en/show-triggers/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (401,26,'SHOW USER_STATISTICS','Syntax\n------\n\nSHOW USER_STATISTICS\n\nDescription\n-----------\n\nThe SHOW USER_STATISTICS statement is part of the User Statistics feature. It\nwas removed as a separate statement in MariaDB 10.1.1, but effectively\nreplaced by the generic SHOW information_schema_table statement. The\ninformation_schema.USER_STATISTICS table holds statistics about user activity.\nYou can use this table to find out such things as which user is causing the\nmost load and which users are being abusive. You can also use this table to\nmeasure how close to capacity the server may be.\n\nThe userstat system variable must be set to 1 to activate this feature. See\nthe User Statistics and information_schema.USER_STATISTICS table for more\ninformation.\n\nExample\n-------\n\nSHOW USER_STATISTICS\G\n*************************** 1. row ***************************\n User: root\n Total_connections: 1\nConcurrent_connections: 0\n Connected_time: 3297\n Busy_time: 0.14113400000000006\n Cpu_time: 0.017637000000000003\n Bytes_received: 969\n Bytes_sent: 22355\n Binlog_bytes_written: 0\n Rows_read: 10\n Rows_sent: 67\n Rows_deleted: 0\n Rows_inserted: 0\n Rows_updated: 0\n Select_commands: 7\n Update_commands: 0\n Other_commands: 0\n Commit_transactions: 1\n Rollback_transactions: 0\n Denied_connections: 0\n Lost_connections: 0\n Access_denied: 0\n Empty_queries: 7\n\n\n\nURL: mariadb.com/kb/en/show-user-statistics/','','https://mariadb.com/kb/en/show-user-statistics/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (402,26,'SHOW VARIABLES','Syntax\n------\n\nSHOW [GLOBAL | SESSION] VARIABLES\n [LIKE \'pattern\' | WHERE expr]\n\nDescription\n-----------\n\nSHOW VARIABLES shows the values of MariaDB system variables. This information\nalso can be obtained using the mysqladmin variables command. The LIKE clause,\nif present, indicates which variable names to match. The WHERE clause can be\ngiven to select rows using more general conditions.\n\nWith the GLOBAL modifier, SHOW VARIABLES displays the values that are used for\nnew connections to MariaDB. With SESSION, it displays the values that are in\neffect for the current connection. If no modifier is present, the default is\nSESSION. LOCAL is a synonym for SESSION. With a LIKE clause, the statement\ndisplays only rows for those variables with names that match the pattern. To\nobtain the row for a specific variable, use a LIKE clause as shown:\n\nSHOW VARIABLES LIKE \'maria_group_commit\';\nSHOW SESSION VARIABLES LIKE \'maria_group_commit\';\n\nTo get a list of variables whose name match a pattern, use the "%" wildcard\ncharacter in a LIKE clause:\n\nSHOW VARIABLES LIKE \'%maria%\';\nSHOW GLOBAL VARIABLES LIKE \'%maria%\';\n\nWildcard characters can be used in any position within the pattern to be\nmatched. Strictly speaking, because "_" is a wildcard that matches any single\ncharacter, you should escape it as "\_" to match it literally. In practice,\nthis is rarely necessary.\n\nThe WHERE and LIKE clauses can be given to select rows using more general\nconditions, as discussed in Extended SHOW.\n\nSee SET for information on setting server system variables.\n\nSee Server System Variables for a list of all the variables that can be set.\n\nYou can also see the server variables by querying the Information Schema\nGLOBAL_VARIABLES and SESSION_VARIABLES tables.\n\nExamples\n--------\n\nSHOW VARIABLES LIKE \'aria%\';\n+------------------------------------------+---------------------+\n| Variable_name | Value |\n+------------------------------------------+---------------------+\n| aria_block_size | 8192 |\n| aria_checkpoint_interval | 30 |\n| aria_checkpoint_log_activity | 1048576 |\n| aria_force_start_after_recovery_failures | 0 |\n| aria_group_commit | none |\n| aria_group_commit_interval | 0 |\n| aria_log_file_size | 1073741824 |\n| aria_log_purge_type | immediate |\n| aria_max_sort_file_size | 9223372036853727232 |\n| aria_page_checksum | ON |\n| aria_pagecache_age_threshold | 300 |\n| aria_pagecache_buffer_size | 134217728 |\n| aria_pagecache_division_limit | 100 |\n| aria_recover | NORMAL |\n| aria_repair_threads | 1 |\n| aria_sort_buffer_size | 134217728 |\n| aria_stats_method | nulls_unequal |\n| aria_sync_log_dir | NEWFILE |\n| aria_used_for_temp_tables | ON |\n+------------------------------------------+---------------------+\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'max_error_count\' OR\n VARIABLE_NAME LIKE \'innodb_sync_spin_loops\';\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT | 64 | 64 |\n| INNODB_SYNC_SPIN_LOOPS | NULL | 30 |\n+---------------------------+---------------+--------------+\n\nSET GLOBAL max_error_count=128;\n\nSELECT VARIABLE_NAME, SESSION_VALUE, GLOBAL_VALUE FROM\n INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE\n VARIABLE_NAME LIKE \'max_error_count\' OR\n VARIABLE_NAME LIKE \'innodb_sync_spin_loops\';\n+---------------------------+---------------+--------------+\n| VARIABLE_NAME | SESSION_VALUE | GLOBAL_VALUE |\n+---------------------------+---------------+--------------+\n| MAX_ERROR_COUNT | 64 | 128 |\n| INNODB_SYNC_SPIN_LOOPS | NULL | 30 |\n+---------------------------+---------------+--------------+\n\nSET GLOBAL max_error_count=128;\n\nSHOW VARIABLES LIKE \'max_error_count\';\n+-----------------+-------+\n| Variable_name | Value |\n+-----------------+-------+\n| max_error_count | 64 |\n+-----------------+-------+\n\nSHOW GLOBAL VARIABLES LIKE \'max_error_count\';\n+-----------------+-------+\n| Variable_name | Value |\n+-----------------+-------+\n| max_error_count | 128 |\n+-----------------+-------+\n\nBecause the following variable only has a global scope, the global value is\nreturned even when specifying SESSION (in this case by default):\n\nSHOW VARIABLES LIKE \'innodb_sync_spin_loops\';\n+------------------------+-------+\n| Variable_name | Value |\n+------------------------+-------+\n| innodb_sync_spin_loops | 30 |\n+------------------------+-------+\n\n\n\nURL: mariadb.com/kb/en/show-variables/','','https://mariadb.com/kb/en/show-variables/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (403,26,'SHOW WARNINGS','Syntax\n------\n\nSHOW WARNINGS [LIMIT [offset,] row_count]\nSHOW ERRORS [LIMIT row_count OFFSET offset]\nSHOW COUNT(*) WARNINGS\n\nDescription\n-----------\n\nSHOW WARNINGS shows the error, warning, and note messages that resulted from\nthe last statement that generated messages in the current session. It shows\nnothing if the last statement used a table and generated no messages. (That\nis, a statement that uses a table but generates no messages clears the message\nlist.) Statements that do not use tables and do not generate messages have no\neffect on the message list.\n\nA note is different to a warning in that it only appears if the sql_notes\nvariable is set to 1 (the default), and is not converted to an error if strict\nmode is enabled.\n\nA related statement, SHOW ERRORS, shows only the errors.\n\nThe SHOW COUNT(*) WARNINGS statement displays the total number of errors,\nwarnings, and notes. You can also retrieve this number from the warning_count\nvariable:\n\nSHOW COUNT(*) WARNINGS;\nSELECT @@warning_count;\n\nThe value of warning_count might be greater than the number of messages\ndisplayed by SHOW WARNINGS if the max_error_count system variable is set so\nlow that not all messages are stored.\n\nThe LIMIT clause has the same syntax as for the SELECT statement.\n\nSHOW WARNINGS can be used after EXPLAIN EXTENDED to see how a query is\ninternally rewritten by MariaDB.\n\nIf the sql_notes server variable is set to 1, Notes are included in the output\nof SHOW WARNINGS; if it is set to 0, this statement will not show (or count)\nNotes.\n\nThe results of SHOW WARNINGS and SHOW COUNT(*) WARNINGS are directly sent to\nthe client. If you need to access those information in a stored program, you\ncan use the GET DIAGNOSTICS statement instead.\n\nFor a list of MariaDB error codes, see MariaDB Error Codes.\n\nThe mysql client also has a number of options related to warnings. The \W\ncommand will show warnings after every statement, while \w will disable this.\nStarting the client with the --show-warnings option will show warnings after\nevery statement.\n\nMariaDB 10.3.1 implements a stored routine error stack trace. SHOW WARNINGS\ncan also be used to show more information. See the example below.\n\nExamples\n--------\n\nSELECT 1/0;\n+------+\n| 1/0 |\n+------+\n| NULL |\n+------+\n\nSHOW COUNT(*) WARNINGS;\n+-------------------------+\n| @@session.warning_count |\n+-------------------------+\n| 1 |\n+-------------------------+\n\nSHOW WARNINGS;\n+---------+------+---------------+\n| Level | Code | Message |\n+---------+------+---------------+\n| Warning | 1365 | Division by 0 |\n+---------+------+---------------+\n\nStack Trace\n-----------\n\nFrom MariaDB 10.3.1, displaying a stack trace:\n\nDELIMITER $$\nCREATE OR REPLACE PROCEDURE p1()\n BEGIN\n DECLARE c CURSOR FOR SELECT * FROM not_existing;\n OPEN c;\n CLOSE c;\n END;\n$$\nCREATE OR REPLACE PROCEDURE p2()\n BEGIN\n CALL p1;\n END;\n$$\nDELIMITER ;\nCALL p2;\nERROR 1146 (42S02): Table \'test.not_existing\' doesn\'t exist\n\nSHOW WARNINGS;\n+-------+------+-----------------------------------------+\n| Level | Code | Message |\n+-------+------+-----------------------------------------+\n| Error | 1146 | Table \'test.not_existing\' doesn\'t exist |\n| Note | 4091 | At line 6 in test.p1 |\n| Note | 4091 | At line 4 in test.p2 |\n+-------+------+-----------------------------------------+\n\nSHOW WARNINGS displays a stack trace, showing where the error actually\nhappened:\n\n* Line 4 in test.p1 is the OPEN command which actually raised the error\n* Line 3 in test.p2 is the CALL statement, calling p1 from p2.\n\n\n\nURL: mariadb.com/kb/en/show-warnings/','','https://mariadb.com/kb/en/show-warnings/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (404,26,'SHOW WSREP_MEMBERSHIP','SHOW WSREP_MEMBERSHIP is part of the WSREP_INFO plugin.\n\nSyntax\n------\n\nSHOW WSREP_MEMBERSHIP\n\nDescription\n-----------\n\nThe SHOW WSREP_MEMBERSHIP statement returns Galera node cluster membership\ninformation. It returns the same information as found in the\ninformation_schema.WSREP_MEMBERSHIP table. Only users with the SUPER privilege\ncan access this information.\n\nExamples\n--------\n\nSHOW WSREP_MEMBERSHIP;\n+-------+--------------------------------------+----------+-----------------+\n| Index | Uuid | Name | Address |\n+-------+--------------------------------------+----------+-----------------+\n| 0 | 19058073-8940-11e4-8570-16af7bf8fced | my_node1 | 10.0.2.15:16001 |\n| 1 | 19f2b0e0-8942-11e4-9cb8-b39e8ee0b5dd | my_node3 | 10.0.2.15:16003 |\n| 2 | d85e62db-8941-11e4-b1ef-4bc9980e476d | my_node2 | 10.0.2.15:16002 |\n+-------+--------------------------------------+----------+-----------------+\n\n\n\nURL: mariadb.com/kb/en/show-wsrep_membership/','','https://mariadb.com/kb/en/show-wsrep_membership/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (405,26,'SHOW WSREP_STATUS','SHOW WSREP_STATUS is part of the WSREP_INFO plugin.\n\nSyntax\n------\n\nSHOW WSREP_STATUS\n\nDescription\n-----------\n\nThe SHOW WSREP_STATUS statement returns Galera node and cluster status\ninformation. It returns the same information as found in the\ninformation_schema.WSREP_STATUS table. Only users with the SUPER privilege can\naccess this information.\n\nExamples\n--------\n\nSHOW WSREP_STATUS;\n+------------+-------------+----------------+--------------+\n| Node_Index | Node_Status | Cluster_Status | Cluster_Size |\n+------------+-------------+----------------+--------------+\n| 0 | Synced | Primary | 3 |\n+------------+-------------+----------------+--------------+\n\n\n\nURL: mariadb.com/kb/en/show-wsrep_status/','','https://mariadb.com/kb/en/show-wsrep_status/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (406,27,'CALL','Syntax\n------\n\nCALL sp_name([parameter[,...]])\nCALL sp_name[()]\n\nDescription\n-----------\n\nThe CALL statement invokes a stored procedure that was defined previously with\nCREATE PROCEDURE.\n\nStored procedure names can be specified as database_name.procedure_name.\nProcedure names and database names can be quoted with backticks (). This is\nnecessary if they are reserved words, or contain special characters. See\nidentifier qualifiers for details.\n\nCALL p() and CALL p are equivalent.\n\nIf parentheses are used, any number of spaces, tab characters and newline\ncharacters are allowed between the procedure\'s name and the open parenthesis.\n\nCALL can pass back values to its caller using parameters that are declared as\nOUT or INOUT parameters. If no value is assigned to an OUT parameter, NULL is\nassigned (and its former value is lost). To pass such values from another\nstored program you can use user-defined variables, local variables or\nroutine\'s parameters; in other contexts, you can only use user-defined\nvariables.\n\nCALL can also be executed as a prepared statement. Placeholders can be used\nfor IN parameters in all versions of MariaDB; for OUT and INOUT parameters,\nplaceholders can be used since MariaDB 5.5.\n\nWhen the procedure returns, a client program can also obtain the number of\nrows affected for the final statement executed within the routine: At the SQL\nlevel, call the ROW_COUNT() function; from the C API, call the\nmysql_affected_rows() function.\n\nIf the CLIENT_MULTI_RESULTS API flag is set, CALL can return any number of\nresultsets and the called stored procedure can execute prepared statements. If\nit is not set, at most one resultset can be returned and prepared statements\ncannot be used within procedures.\n\n\n\nURL: mariadb.com/kb/en/call/','','https://mariadb.com/kb/en/call/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (407,27,'Concurrent Inserts','The MyISAM storage engine supports concurrent inserts. This feature\nallows SELECT statements to be executed during INSERT operations, reducing\ncontention.\n\nWhether concurrent inserts can be used or not depends on the value of the\nconcurrent_insert server system variable:\n\n* NEVER (0) disables concurrent inserts.\n* AUTO (1) allows concurrent inserts only when the target table has no free\nblocks (no data in the middle of the table has been deleted after the last\nOPTIMIZE TABLE). This is the default.\n* ALWAYS (2) always enables concurrent inserts, in which case new rows are\nadded at the end of a table if the table is being used by another thread.\n\nIf the binary log is used, CREATE TABLE ... SELECT and INSERT ... SELECT\nstatements cannot use concurrent inserts. These statements acquire a read lock\non the table, so concurrent inserts will need to wait. This way the log can be\nsafely used to restore data.\n\nConcurrent inserts are not used by replicas with the row based replication\n(see binary log formats).\n\nIf an INSERT statement contain the HIGH_PRIORITY clause, concurrent inserts\ncannot be used. INSERT ... DELAYED is usually unneeded if concurrent inserts\nare enabled.\n\nLOAD DATA INFILE uses concurrent inserts if the CONCURRENT keyword is\nspecified and concurrent_insert is not NEVER. This makes the statement slower\n(even if no other sessions access the table) but reduces contention.\n\nLOCK TABLES allows non-conflicting concurrent inserts if a READ LOCAL lock is\nused. Concurrent inserts are not allowed if the LOCAL keyword is omitted.\n\nNotes\n-----\n\nThe decision to enable concurrent insert for a table is done when the table is\nopened. If you change the value of concurrent_insert it will only affect new\nopened tables. If you want it to work for also for tables in use or cached,\nyou should do FLUSH TABLES after setting the variable.\n\n\n\nURL: mariadb.com/kb/en/concurrent-inserts/','','https://mariadb.com/kb/en/concurrent-inserts/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (408,27,'DELETE','Syntax\n------\n\nSingle-table syntax:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE] \n FROM tbl_name [PARTITION (partition_list)]\n [FOR PORTION OF period FROM expr1 TO expr2]\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n [RETURNING select_expr\n [, select_expr ...]]\n\nMultiple-table syntax:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n tbl_name[.*] [, tbl_name[.*]] ...\n FROM table_references\n [WHERE where_condition]\n\nOr:\n\nDELETE [LOW_PRIORITY] [QUICK] [IGNORE]\n FROM tbl_name[.*] [, tbl_name[.*]] ...\n USING table_references\n [WHERE where_condition]\n\nTrimming history:\n\nDELETE HISTORY\n FROM tbl_name [PARTITION (partition_list)]\n [BEFORE SYSTEM_TIME [TIMESTAMP|TRANSACTION] expression]\n\nDescription\n-----------\n\n+---------------------------+-------------------------------------------------+\n| Option | Description |\n+---------------------------+-------------------------------------------------+\n| LOW_PRIORITY | Wait until all SELECT\'s are done before |\n| | starting the statement. Used with storage |\n| | engines that uses table locking (MyISAM, Aria |\n| | etc). See HIGH_PRIORITY and LOW_PRIORITY |\n| | clauses for details. |\n+---------------------------+-------------------------------------------------+\n| QUICK | Signal the storage engine that it should |\n| | expect that a lot of rows are deleted. The |\n| | storage engine engine can do things to speed |\n| | up the DELETE like ignoring merging of data |\n| | blocks until all rows are deleted from the |\n| | block (instead of when a block is half full). |\n| | This speeds up things at the expanse of lost |\n| | space in data blocks. At least MyISAM and Aria |\n| | support this feature. |\n+---------------------------+-------------------------------------------------+\n| IGNORE | Don\'t stop the query even if a not-critical |\n| | error occurs (like data overflow). See How |\n| | IGNORE works for a full description. |\n+---------------------------+-------------------------------------------------+\n\nFor the single-table syntax, the DELETE statement deletes rows from tbl_name\nand returns a count of the number of deleted rows. This count can be obtained\nby calling the ROW_COUNT() function. The WHERE clause, if given, specifies the\nconditions that identify which rows to delete. With no WHERE clause, all rows\nare deleted. If the ORDER BY clause is specified, the rows are deleted in the\norder that is specified. The LIMIT clause places a limit on the number of rows\nthat can be deleted.\n\nFor the multiple-table syntax, DELETE deletes from each tbl_name the rows that\nsatisfy the conditions. In this case, ORDER BY and LIMIT> cannot be used. A\nDELETE can also reference tables which are located in different databases; see\nIdentifier Qualifiers for the syntax.\n\nwhere_condition is an expression that evaluates to true for each row to be\ndeleted. It is specified as described in SELECT.\n\nCurrently, you cannot delete from a table and select from the same table in a\nsubquery.\n\nYou need the DELETE privilege on a table to delete rows from it. You need only\nthe SELECT privilege for any columns that are only read, such as those named\nin the WHERE clause. See GRANT.\n\nAs stated, a DELETE statement with no WHERE clause deletes all rows. A faster\nway to do this, when you do not need to know the number of deleted rows, is to\nuse TRUNCATE TABLE. However, within a transaction or if you have a lock on the\ntable, TRUNCATE TABLE cannot be used whereas DELETE can. See TRUNCATE TABLE,\nand LOCK.\n\nPARTITION\n---------\n\nSee Partition Pruning and Selection for details.\n\nFOR PORTION OF\n--------------\n\nMariaDB starting with 10.4.3\n----------------------------\nSee Application Time Periods - Deletion by Portion.\n\nRETURNING\n---------\n\nIt is possible to return a resultset of the deleted rows for a single table to\nthe client by using the syntax DELETE ... RETURNING select_expr [,\nselect_expr2 ...]]\n\nAny of SQL expression that can be calculated from a single row fields is\nallowed. Subqueries are allowed. The AS keyword is allowed, so it is possible\nto use aliases.\n\nThe use of aggregate functions is not allowed. RETURNING cannot be used in\nmulti-table DELETEs.\n\nMariaDB starting with 10.3.1\n----------------------------\n\nSame Source and Target Table\n----------------------------\n\nUntil MariaDB 10.3.1, deleting from a table with the same source and target\nwas not possible. From MariaDB 10.3.1, this is now possible. For example:\n\nDELETE FROM t1 WHERE c1 IN (SELECT b.c1 FROM t1 b WHERE b.c2=0);\n\nMariaDB starting with 10.3.4\n----------------------------\n\nDELETE HISTORY\n--------------\n\nOne can use DELETE HISTORY to delete historical information from\nSystem-versioned tables.\n\nExamples\n--------\n\nHow to use the ORDER BY and LIMIT clauses:\n\nDELETE FROM page_hit ORDER BY timestamp LIMIT 1000000;\n\nHow to use the RETURNING clause:\n\nDELETE FROM t RETURNING f1;\n+------+\n| f1 |\n+------+\n| 5 |\n| 50 |\n| 500 |\n+------+\n\nThe following statement joins two tables: one is only used to satisfy a WHERE\ncondition, but no row is deleted from it; rows from the other table are\ndeleted, instead.\n\nDELETE post FROM blog INNER JOIN post WHERE blog.id = post.blog_id;\n\nDeleting from the Same Source and Target\n----------------------------------------\n\nCREATE TABLE t1 (c1 INT, c2 INT);\nDELETE FROM t1 WHERE c1 IN (SELECT b.c1 FROM t1 b WHERE b.c2=0);\n\nUntil MariaDB 10.3.1, this returned:\n\nERROR 1093 (HY000): Table \'t1\' is specified twice, both as a target for\n\'DELETE\' \n and as a separate source for\n\nFrom MariaDB 10.3.1:\n\nQuery OK, 0 rows affected (0.00 sec)\n\n\n\nURL: mariadb.com/kb/en/delete/','','https://mariadb.com/kb/en/delete/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (409,27,'DO','Syntax\n------\n\nDO expr [, expr] ...\n\nDescription\n-----------\n\nDO executes the expressions but does not return any results. In most respects,\nDO is shorthand for SELECT expr, ..., but has the advantage that it is\nslightly faster when you do not care about the result.\n\nDO is useful primarily with functions that have side effects, such as\nRELEASE_LOCK().\n\n\n\nURL: mariadb.com/kb/en/do/','','https://mariadb.com/kb/en/do/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (410,27,'DUAL','Description\n-----------\n\nYou are allowed to specify DUAL as a dummy table name in situations where no\ntables are referenced, such as the following SELECT statement:\n\nSELECT 1 + 1 FROM DUAL;\n+-------+\n| 1 + 1 |\n+-------+\n| 2 |\n+-------+\n\nDUAL is purely for the convenience of people who require that all SELECT\nstatements should have FROM and possibly other clauses. MariaDB ignores the\nclauses. MariaDB does not require FROM DUAL if no tables are referenced.\n\nFROM DUAL could be used when you only SELECT computed values, but require a\nWHERE clause, perhaps to test that a script correctly handles empty resultsets:\n\nSELECT 1 FROM DUAL WHERE FALSE;\nEmpty set (0.00 sec)\n\n\n\nURL: mariadb.com/kb/en/dual/','','https://mariadb.com/kb/en/dual/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (411,27,'EXCEPT','MariaDB starting with 10.3.0\n----------------------------\nEXCEPT was introduced in MariaDB 10.3.0.\n\nThe result of EXCEPT is all records of the left SELECT result set except\nrecords which are in right SELECT result set, i.e. it is subtraction of two\nresult sets. From MariaDB 10.6.1, MINUS is a synonym.\n\nSyntax\n\nSELECT ...\n(INTERSECT [ALL | DISTINCT] | EXCEPT [ALL | DISTINCT] | UNION [ALL |\nDISTINCT]) SELECT ...\n[(INTERSECT [ALL | DISTINCT] | EXCEPT [ALL | DISTINCT] | UNION [ALL |\nDISTINCT]) SELECT ...]\n[ORDER BY [column [, column ...]]]\n[LIMIT {[offset,] row_count | row_count OFFSET offset}]\n\nPlease note:\n\n* Brackets for explicit operation precedence are not supported; use a subquery\nin the FROM clause as a workaround).\n\nDescription\n-----------\n\nMariaDB has supported EXCEPT and INTERSECT in addition to UNION since MariaDB\n10.3.\n\nAll behavior for naming columns, ORDER BY and LIMIT is the same as for UNION.\n\nEXCEPT implicitly supposes a DISTINCT operation.\n\nThe result of EXCEPT is all records of the left SELECT result except records\nwhich are in right SELECT result set, i.e. it is subtraction of two result\nsets.\n\nEXCEPT and UNION have the same operation precedence and INTERSECT has a higher\nprecedence, unless running in Oracle mode, in which case all three have the\nsame precedence.\n\nMariaDB starting with 10.4.0\n----------------------------\n\nParentheses\n-----------\n\nFrom MariaDB 10.4.0, parentheses can be used to specify precedence. Before\nthis, a syntax error would be returned.\n\nMariaDB starting with 10.5.0\n----------------------------\n\nALL/DISTINCT\n------------\n\nEXCEPT ALL and EXCEPT DISTINCT were introduced in MariaDB 10.5.0. The ALL\noperator leaves duplicates intact, while the DISTINCT operator removes\nduplicates. DISTINCT is the default behavior if neither operator is supplied,\nand the only behavior prior to MariaDB 10.5.\n\nExamples\n--------\n\nShow customers which are not employees:\n\n(SELECT e_name AS name, email FROM customers)\nEXCEPT\n(SELECT c_name AS name, email FROM employees);\n\nDifference between UNION, EXCEPT and INTERSECT. INTERSECT ALL and EXCEPT ALL\nare available from MariaDB 10.5.0.\n\nCREATE TABLE seqs (i INT);\nINSERT INTO seqs VALUES (1),(2),(2),(3),(3),(4),(5),(6);\n\nSELECT i FROM seqs WHERE i <= 3 UNION SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n| 3 |\n| 4 |\n| 5 |\n| 6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 UNION ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n| 2 |\n| 3 |\n| 3 |\n| 3 |\n| 3 |\n| 4 |\n| 5 |\n| 6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n| 2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 3 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 3 |\n| 3 |\n+------+\n\nParentheses for specifying precedence, from MariaDB 10.4.0\n\nCREATE OR REPLACE TABLE t1 (a INT);\nCREATE OR REPLACE TABLE t2 (b INT);\nCREATE OR REPLACE TABLE t3 (c INT);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4);\nINSERT INTO t2 VALUES (5),(6);\nINSERT INTO t3 VALUES (1),(6);\n\n((SELECT a FROM t1) UNION (SELECT b FROM t2)) EXCEPT (SELECT c FROM t3);\n+------+\n| a |\n+------+\n| 2 |\n| 3 |\n| 4 |\n| 5 |\n+------+\n\n(SELECT a FROM t1) UNION ((SELECT b FROM t2) EXCEPT (SELECT c FROM t3));\n+------+\n| a |\n+------+\n| 1 |\n| 2 |\n| 3 |\n| 4 |\n| 5 |\n+------+\n\n\n\nURL: mariadb.com/kb/en/except/','','https://mariadb.com/kb/en/except/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (412,27,'FOR UPDATE','InnoDB supports row-level locking. Selected rows can be locked using\nLOCK IN SHARE MODE or FOR UPDATE. In both cases, a lock is acquired on the\nrows read by the query, and it will be released when the current transaction\nis committed.\n\nThe FOR UPDATE clause of SELECT applies only when autocommit is set to 0 or\nthe SELECT is enclosed in a transaction. A lock is acquired on the rows, and\nother transactions are prevented from writing the rows, acquire locks, and\nfrom reading them (unless their isolation level is READ UNCOMMITTED).\n\nIf autocommit is set to 1, the LOCK IN SHARE MODE and FOR UPDATE clauses have\nno effect.\n\nIf the isolation level is set to SERIALIZABLE, all plain SELECT statements are\nconverted to SELECT ... LOCK IN SHARE MODE.\n\nExample\n-------\n\nSELECT * FROM trans WHERE period=2001 FOR UPDATE;\n\n\n\nURL: mariadb.com/kb/en/for-update/','','https://mariadb.com/kb/en/for-update/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (413,27,'GROUP BY','Use the GROUP BY clause in a SELECT statement to group rows together\nthat have the same value in one or more column, or the same computed value\nusing expressions with any functions and operators except grouping functions.\nWhen you use a GROUP BY clause, you will get a single result row for each\ngroup of rows that have the same value for the expression given in GROUP BY.\n\nWhen grouping rows, grouping values are compared as if by the = operator. For\nstring values, the = operator ignores trailing whitespace and may normalize\ncharacters and ignore case, depending on the collation in use.\n\nYou can use any of the grouping functions in your select expression. Their\nvalues will be calculated based on all the rows that have been grouped\ntogether for each result row. If you select a non-grouped column or a value\ncomputed from a non-grouped column, it is undefined which row the returned\nvalue is taken from. This is not permitted if the ONLY_FULL_GROUP_BY SQL_MODE\nis used.\n\nYou can use multiple expressions in the GROUP BY clause, separated by commas.\nRows are grouped together if they match on each of the expressions.\n\nYou can also use a single integer as the grouping expression. If you use an\ninteger n, the results will be grouped by the nth column in the select\nexpression.\n\nThe WHERE clause is applied before the GROUP BY clause. It filters\nnon-aggregated rows before the rows are grouped together. To filter grouped\nrows based on aggregate values, use the HAVING clause. The HAVING clause takes\nany expression and evaluates it as a boolean, just like the WHERE clause. You\ncan use grouping functions in the HAVING clause. As with the select\nexpression, if you reference non-grouped columns in the HAVING clause, the\nbehavior is undefined.\n\nBy default, if a GROUP BY clause is present, the rows in the output will be\nsorted by the expressions used in the GROUP BY. You can also specify ASC or\nDESC (ascending, descending) after those expressions, like in ORDER BY. The\ndefault is ASC.\n\nIf you want the rows to be sorted by another field, you can add an explicit\nORDER BY. If you don\'t want the result to be ordered, you can add ORDER BY\nNULL.\n\nWITH ROLLUP\n-----------\n\nThe WITH ROLLUP modifer adds extra rows to the resultset that represent\nsuper-aggregate summaries. For a full description with examples, see SELECT\nWITH ROLLUP.\n\nGROUP BY Examples\n-----------------\n\nConsider the following table that records how many times each user has played\nand won a game:\n\nCREATE TABLE plays (name VARCHAR(16), plays INT, wins INT);\nINSERT INTO plays VALUES \n ("John", 20, 5),\n ("Robert", 22, 8),\n ("Wanda", 32, 8),\n ("Susan", 17, 3);\n\nGet a list of win counts along with a count:\n\nSELECT wins, COUNT(*) FROM plays GROUP BY wins;\n+------+----------+\n| wins | COUNT(*) |\n+------+----------+\n| 3 | 1 |\n| 5 | 1 |\n| 8 | 2 |\n+------+----------+\n3 rows in set (0.00 sec)\n\nThe GROUP BY expression can be a computed value, and can refer back to an\nidentifer specified with AS. Get a list of win averages along with a count:\n\nSELECT (wins / plays) AS winavg, COUNT(*) FROM plays GROUP BY winavg;\n+--------+----------+\n| winavg | COUNT(*) |\n+--------+----------+\n| 0.1765 | 1 |\n| 0.2500 | 2 |\n| 0.3636 | 1 |\n+--------+----------+\n3 rows in set (0.00 sec)\n\nYou can use any grouping function in the select expression. For each win\naverage as above, get a list of the average play count taken to get that\naverage:\n\nSELECT (wins / plays) AS winavg, AVG(plays) FROM plays \n GROUP BY winavg;\n+--------+------------+\n| winavg | AVG(plays) |\n+--------+------------+\n| 0.1765 | 17.0000 |\n| 0.2500 | 26.0000 |\n| 0.3636 | 22.0000 |\n+--------+------------+\n3 rows in set (0.00 sec)\n\nYou can filter on aggregate information using the HAVING clause. The HAVING\nclause is applied after GROUP BY and allows you to filter on aggregate data\nthat is not available to the WHERE clause. Restrict the above example to\nresults that involve an average number of plays over 20:\n\nSELECT (wins / plays) AS winavg, AVG(plays) FROM plays \n GROUP BY winavg HAVING AVG(plays) > 20;\n+--------+------------+\n| winavg | AVG(plays) |\n+--------+------------+\n| 0.2500 | 26.0000 |\n| 0.3636 | 22.0000 |\n+--------+------------+\n2 rows in set (0.00 sec)\n\n\n\nURL: mariadb.com/kb/en/group-by/','','https://mariadb.com/kb/en/group-by/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (414,27,'HANDLER Commands','Syntax\n------\n\nHANDLER tbl_name OPEN [ [AS] alias]\nHANDLER tbl_name READ index_name { = | >= | <= | < } (value1,value2,...)\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ index_name { FIRST | NEXT | PREV | LAST }\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name READ { FIRST | NEXT }\n [ WHERE where_condition ] [LIMIT ... ]\nHANDLER tbl_name CLOSE\n\nDescription\n-----------\n\nThe HANDLER statement provides direct access to table storage engine\ninterfaces for key lookups and key or table scans. It is available for at\nleast Aria, Memory, MyISAM and InnoDB tables (and should work with most\n\'normal\' storage engines, but not with system tables, MERGE or views).\n\nHANDLER ... OPEN opens a table, allowing it to be accessible to subsequent\nHANDLER ... READ statements. The table can either be opened using an alias\n(which must then be used by HANDLER ... READ, or a table name.\n\nThe table object is only closed when HANDLER ... CLOSE is called by the\nsession, and is not shared by other sessions.\n\nPrepared statements work with HANDLER READ, which gives a much higher\nperformance (50% speedup) as there is no parsing and all data is transformed\nin binary (without conversions to text, as with the normal protocol).\n\nThe HANDLER command does not work with partitioned tables.\n\nKey Lookup\n----------\n\nA key lookup is started with:\n\nHANDLER tbl_name READ index_name { = | >= | <= | < } (value,value) [LIMIT...]\n\nThe values stands for the value of each of the key columns. For most key types\n(except for HASH keys in MEMORY storage engine) you can use a prefix subset of\nit\'s columns.\n\nIf you are using LIMIT, then in case of >= or > then there is an implicit NEXT\nimplied, while if you are using <= or < then there is an implicit PREV implied.\n\nAfter the initial read, you can use\n\nHANDLER tbl_name READ index_name NEXT [ LIMIT ... ]\nor\nHANDLER tbl_name READ index_name PREV [ LIMIT ... ]\n\nto scan the rows in key order.\n\nNote that the row order is not defined for keys with duplicated values and\nwill vary from engine to engine.\n\nKey Scans\n---------\n\nYou can scan a table in key order by doing:\n\nHANDLER tbl_name READ index_name FIRST [ LIMIT ... ]\nHANDLER tbl_name READ index_name NEXT [ LIMIT ... ]\n\nor, if the handler supports backwards key scans (most do):\n\nHANDLER tbl_name READ index_name LAST [ LIMIT ... ]\nHANDLER tbl_name READ index_name PREV [ LIMIT ... ]\n\nTable Scans\n-----------\n\nYou can scan a table in row order by doing:\n\nHANDLER tbl_name READ FIRST [ LIMIT ... ]\nHANDLER tbl_name READ NEXT [ LIMIT ... ]\n\nLimitations\n-----------\n\nAs this is a direct interface to the storage engine, some limitations may\napply for what you can do and what happens if the table changes. Here follows\nsome of the common limitations:\n\nFinding \'Old Rows\'\n------------------\n\nHANDLER READ is not transaction safe, consistent or atomic. It\'s ok for the\nstorage engine to returns rows that existed when you started the scan but that\nwere later deleted. This can happen as the storage engine may cache rows as\npart of the scan from a previous read.\n\nYou may also find rows committed since the scan originally started.\n\nInvisible Columns\n-----------------\n\nHANDLER ... READ also reads the data of invisible-columns.\n\nSystem-Versioned Tables\n-----------------------\n\nHANDLER ... READ reads everything from system-versioned tables, and so\nincludes row_start and row_end fields, as well as all rows that have since\nbeen deleted or changed, including when history partitions are used.\n\nOther Limitations\n-----------------\n\n* If you do an ALTER TABLE, all your HANDLERs for that table are automatically\nclosed.\n* If you do an ALTER TABLE for a table that is used by some other connection\nwith HANDLER, the ALTER TABLE will wait for the HANDLER to be closed.\n* For HASH keys, you must use all key parts when searching for a row.\n* For HASH keys, you can\'t do a key scan of all values. You can only find all\nrows with the same key value.\n* While each HANDLER READ command is atomic, if you do a scan in many steps,\nthen some engines may give you error 1020 if the table changed between the\ncommands. Please refer to the specific engine handler page if this happens.\n\nError Codes\n-----------\n\n* Error 1031 (ER_ILLEGAL_HA) Table storage engine for \'t1\' doesn\'t have this\noption\nIf you get this for HANDLER OPEN it means the storage engine doesn\'t support\nHANDLER calls.\nIf you get this for HANDLER READ it means you are trying to use an incomplete\nHASH key.\n\n* Error 1020 (ER_CHECKREAD) Record has changed since last read in table \'...\'\nThis means that the table changed between two reads and the handler can\'t\nhandle this case for the given scan.\n\n\n\nURL: mariadb.com/kb/en/handler-commands/','','https://mariadb.com/kb/en/handler-commands/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (415,27,'HIGH_PRIORITY and LOW_PRIORITY','The InnoDB storage engine uses row-level locking to ensure data\nintegrity. However some storage engines (such as MEMORY, MyISAM, Aria and\nMERGE) lock the whole table to prevent conflicts. These storage engines use\ntwo separate queues to remember pending statements; one is for SELECTs and the\nother one is for write statements (INSERT, DELETE, UPDATE). By default, the\nlatter has a higher priority.\n\nTo give write operations a lower priority, the low_priority_updates server\nsystem variable can be set to ON. The option is available on both the global\nand session levels, and it can be set at startup or via the SET statement.\n\nWhen too many table locks have been set by write statements, some pending\nSELECTs are executed. The maximum number of write locks that can be acquired\nbefore this happens is determined by the max_write_lock_count server system\nvariable, which is dynamic.\n\nIf write statements have a higher priority (default), the priority of\nindividual write statements (INSERT, REPLACE, UPDATE, DELETE) can be changed\nvia the LOW_PRIORITY attribute, and the priority of a SELECT statement can be\nraised via the HIGH_PRIORITY attribute. Also, LOCK TABLES supports a\nLOW_PRIORITY attribute for WRITE locks.\n\nIf read statements have a higher priority, the priority of an INSERT can be\nchanged via the HIGH_PRIORITY attribute. However, the priority of other write\nstatements cannot be raised individually.\n\nThe use of LOW_PRIORITY or HIGH_PRIORITY for an INSERT prevents Concurrent\nInserts from being used.\n\n\n\nURL: mariadb.com/kb/en/high_priority-and-low_priority/','','https://mariadb.com/kb/en/high_priority-and-low_priority/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (416,27,'IGNORE','The IGNORE option tells the server to ignore some common errors.\n\nIGNORE can be used with the following statements:\n\n* DELETE\n* INSERT (see also INSERT IGNORE)\n* LOAD DATA INFILE\n* UPDATE\n* ALTER TABLE\n* CREATE TABLE ... SELECT\n* INSERT ... SELECT\n\nThe logic used:\n\n* Variables out of ranges are replaced with the maximum/minimum value.\n\n* SQL_MODEs STRICT_TRANS_TABLES, STRICT_ALL_TABLES, NO_ZERO_IN_DATE,\nNO_ZERO_DATE are ignored.\n\n* Inserting NULL in a NOT NULL field will insert 0 ( in a numerical\n field), 0000-00-00 ( in a date field) or an empty string ( in a character\n field).\n\n* Rows that cause a duplicate key error or break a foreign key constraint are\n not inserted, updated, or deleted.\n\nThe following errors are ignored:\n\n+----------------------+---------------------------------+--------------------+\n| Error number | Symbolic error name | Description |\n+----------------------+---------------------------------+--------------------+\n| 1022 | ER_DUP_KEY | Can\'t write; |\n| | | duplicate key in |\n| | | table \'%s\' |\n+----------------------+---------------------------------+--------------------+\n| 1048 | ER_BAD_NULL_ERROR | Column \'%s\' |\n| | | cannot be null |\n+----------------------+---------------------------------+--------------------+\n| 1062 | ER_DUP_ENTRY | Duplicate entry |\n| | | \'%s\' for key %d |\n+----------------------+---------------------------------+--------------------+\n| 1242 | ER_SUBQUERY_NO_1_ROW | Subquery returns |\n| | | more than 1 row |\n+----------------------+---------------------------------+--------------------+\n| 1264 | ER_WARN_DATA_OUT_OF_RANGE | Out of range |\n| | | value for column |\n| | | \'%s\' at row %ld |\n+----------------------+---------------------------------+--------------------+\n| 1265 | WARN_DATA_TRUNCATED | Data truncated |\n| | | for column \'%s\' |\n| | | at row %ld |\n+----------------------+---------------------------------+--------------------+\n| 1292 | ER_TRUNCATED_WRONG_VALUE | Truncated |\n| | | incorrect %s |\n| | | value: \'%s\' |\n+----------------------+---------------------------------+--------------------+\n| 1366 | ER_TRUNCATED_WRONG_VALUE_FOR_FI | Incorrect integer |\n| | LD | value |\n+----------------------+---------------------------------+--------------------+\n| 1369 | ER_VIEW_CHECK_FAILED | CHECK OPTION |\n| | | failed \'%s.%s\' |\n+----------------------+---------------------------------+--------------------+\n| 1451 | ER_ROW_IS_REFERENCED_2 | Cannot delete or |\n| | | update a parent |\n| | | row |\n+----------------------+---------------------------------+--------------------+\n| 1452 | ER_NO_REFERENCED_ROW_2 | Cannot add or |\n| | | update a child |\n| | | row: a foreign |\n| | | key constraint |\n| | | fails (%s) |\n+----------------------+---------------------------------+--------------------+\n| 1526 | ER_NO_PARTITION_FOR_GIVEN_VALUE | Table has no |\n| | | partition for |\n| | | value %s |\n+----------------------+---------------------------------+--------------------+\n| 1586 | ER_DUP_ENTRY_WITH_KEY_NAME | Duplicate entry |\n| | | \'%s\' for key \'%s\' |\n+----------------------+---------------------------------+--------------------+\n| 1591 | ER_NO_PARTITION_FOR_GIVEN_VALUE | Table has no |\n| | SILENT | partition for |\n| | | some existing |\n| | | values |\n+----------------------+---------------------------------+--------------------+\n| 1748 | ER_ROW_DOES_NOT_MATCH_GIVEN_PAR | Found a row not |\n| | ITION_SET | matching the |\n| | | given partition |\n| | | set |\n+----------------------+---------------------------------+--------------------+\n\nIgnored errors normally generate a warning.\n\nA property of the IGNORE clause consists in causing transactional engines and\nnon-transactional engines (like XtraDB and Aria) to behave the same way. For\nexample, normally a multi-row insert which tries to violate a UNIQUE contraint\nis completely rolled back on XtraDB/InnoDB, but might be partially executed on\nAria. With the IGNORE clause, the statement will be partially executed in both\nengines.\n\nDuplicate key errors also generate warnings. The OLD_MODE server variable can\nbe used to prevent this.\n\n\n\nURL: mariadb.com/kb/en/ignore/','','https://mariadb.com/kb/en/ignore/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (417,27,'INSERT','Syntax\n------\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n [, col=expr] ... ] [RETURNING select_expr\n [, select_expr ...]]\n\nOr:\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)]\n SET col={expr | DEFAULT}, ...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n [, col=expr] ... ] [RETURNING select_expr\n [, select_expr ...]]\n\nOr:\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n SELECT ...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n [, col=expr] ... ] [RETURNING select_expr\n [, select_expr ...]]\n\nThe INSERT statement is used to insert new rows into an existing table. The\nINSERT ... VALUES and INSERT ... SET forms of the statement insert rows based\non explicitly specified values. The INSERT ... SELECT form inserts rows\nselected from another table or tables. INSERT ... SELECT is discussed further\nin the INSERT ... SELECT article.\n\nThe table name can be specified in the form db_name.tbl_name or, if a default\ndatabase is selected, in the form tbl_name (see Identifier Qualifiers). This\nallows to use INSERT ... SELECT to copy rows between different databases.\n\nThe PARTITION clause can be used in both the INSERT and the SELECT part. See\nPartition Pruning and Selection for details.\n\nMariaDB starting with 10.5\n--------------------------\nThe RETURNING clause was introduced in MariaDB 10.5.\n\nThe columns list is optional. It specifies which values are explicitly\ninserted, and in which order. If this clause is not specified, all values must\nbe explicitly specified, in the same order they are listed in the table\ndefinition.\n\nThe list of value follow the VALUES or VALUE keyword (which are\ninterchangeable, regardless how much values you want to insert), and is\nwrapped by parenthesis. The values must be listed in the same order as the\ncolumns list. It is possible to specify more than one list to insert more than\none rows with a single statement. If many rows are inserted, this is a speed\noptimization.\n\nFor one-row statements, the SET clause may be more simple, because you don\'t\nneed to remember the columns order. All values are specified in the form col =\nexpr.\n\nValues can also be specified in the form of a SQL expression or subquery.\nHowever, the subquery cannot access the same table that is named in the INTO\nclause.\n\nIf you use the LOW_PRIORITY keyword, execution of the INSERT is delayed until\nno other clients are reading from the table. If you use the HIGH_PRIORITY\nkeyword, the statement has the same priority as SELECTs. This affects only\nstorage engines that use only table-level locking (MyISAM, MEMORY, MERGE).\nHowever, if one of these keywords is specified, concurrent inserts cannot be\nused. See HIGH_PRIORITY and LOW_PRIORITY clauses for details.\n\nINSERT DELAYED\n--------------\n\nFor more details on the DELAYED option, see INSERT DELAYED.\n\nHIGH PRIORITY and LOW PRIORITY\n------------------------------\n\nSee HIGH_PRIORITY and LOW_PRIORITY.\n\nDefaults and Duplicate Values\n-----------------------------\n\nSee INSERT - Default & Duplicate Values for details..\n\nINSERT IGNORE\n-------------\n\nSee INSERT IGNORE.\n\nINSERT ON DUPLICATE KEY UPDATE\n------------------------------\n\nSee INSERT ON DUPLICATE KEY UPDATE.\n\nExamples\n--------\n\nSpecifying the column names:\n\nINSERT INTO person (first_name, last_name) VALUES (\'John\', \'Doe\');\n\nInserting more than 1 row at a time:\n\nINSERT INTO tbl_name VALUES (1, "row 1"), (2, "row 2");\n\nUsing the SET clause:\n\nINSERT INTO person SET first_name = \'John\', last_name = \'Doe\';\n\nSELECTing from another table:\n\nINSERT INTO contractor SELECT * FROM person WHERE status = \'c\';\n\nSee INSERT ON DUPLICATE KEY UPDATE and INSERT IGNORE for further examples.\n\nINSERT ... RETURNING\n--------------------\n\nINSERT ... RETURNING returns a resultset of the inserted rows.\n\nThis returns the listed columns for all the rows that are inserted, or\nalternatively, the specified SELECT expression. Any SQL expressions which can\nbe calculated can be used in the select expression for the RETURNING clause,\nincluding virtual columns and aliases, expressions which use various operators\nsuch as bitwise, logical and arithmetic operators, string functions, date-time\nfunctions, numeric functions, control flow functions, secondary functions and\nstored functions. Along with this, statements which have subqueries and\nprepared statements can also be used.\n\nExamples\n--------\n\nSimple INSERT statement\n\nINSERT INTO t2 VALUES (1,\'Dog\'),(2,\'Lion\'),(3,\'Tiger\'),(4,\'Leopard\') \nRETURNING id2,id2+id2,id2&id2,id2||id2;\n+-----+---------+---------+----------+\n| id2 | id2+id2 | id2&id2 | id2||id2 |\n+-----+---------+---------+----------+\n| 1 | 2 | 1 | 1 |\n| 2 | 4 | 2 | 1 |\n| 3 | 6 | 3 | 1 |\n| 4 | 8 | 4 | 1 |\n+-----+---------+---------+----------+\n\nUsing stored functions in RETURNING\n\nDELIMITER |\nCREATE FUNCTION f(arg INT) RETURNS INT\n BEGIN\n RETURN (SELECT arg+arg);\n END|\n\nDELIMITER ;\n\nPREPARE stmt FROM "INSERT INTO t1 SET id1=1, animal1=\'Bear\' RETURNING f(id1),\nUPPER(animal1)";\n\nEXECUTE stmt;\n+---------+----------------+\n| f(id1) | UPPER(animal1) |\n+---------+----------------+\n| 2 | BEAR |\n+---------+----------------+\n\nSubqueries in the RETURNING clause that return more than one row or column\ncannot be used.\n\nAggregate functions cannot be used in the RETURNING clause. Since aggregate\nfunctions work on a set of values, and if the purpose is to get the row count,\nROW_COUNT() with SELECT can be used or it can be used in\nINSERT...SELECT...RETURNING if the table in the RETURNING clause is not the\nsame as the INSERT table.\n\n\n\nURL: mariadb.com/kb/en/insert/','','https://mariadb.com/kb/en/insert/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (418,27,'INSERT - Default &amp; Duplicate Values','Default Values\n--------------\n\nIf the SQL_MODE contains STRICT_TRANS_TABLES and you are inserting into a\ntransactional table (like InnoDB), or if the SQL_MODE contains\nSTRICT_ALL_TABLES, all NOT NULL columns which does not have a DEFAULT value\n(and is not AUTO_INCREMENT) must be explicitly referenced in INSERT\nstatements. If not, an error like this is produced:\n\nERROR 1364 (HY000): Field \'col\' doesn\'t have a default value\n\nIn all other cases, if a NOT NULL column without a DEFAULT value is not\nreferenced, an empty value will be inserted (for example, 0 for INTEGER\ncolumns and \'\' for CHAR columns). See NULL Values in MariaDB:Inserting for\nexamples.\n\nIf a NOT NULL column having a DEFAULT value is not referenced, NULL will be\ninserted.\n\nIf a NULL column having a DEFAULT value is not referenced, its default value\nwill be inserted. It is also possible to explicitly assign the default value\nusing the DEFAULT keyword or the DEFAULT() function.\n\nIf the DEFAULT keyword is used but the column does not have a DEFAULT value,\nan error like this is produced:\n\nERROR 1364 (HY000): Field \'col\' doesn\'t have a default value\n\nDuplicate Values\n----------------\n\nBy default, if you try to insert a duplicate row and there is a UNIQUE index,\nINSERT stops and an error like this is produced:\n\nERROR 1062 (23000): Duplicate entry \'dup_value\' for key \'col\'\n\nTo handle duplicates you can use the IGNORE clause, INSERT ON DUPLICATE KEY\nUPDATE or the REPLACE statement. Note that the IGNORE and DELAYED options are\nignored when you use ON DUPLICATE KEY UPDATE.\n\n\n\nURL: mariadb.com/kb/en/insert-default-duplicate-values/','','https://mariadb.com/kb/en/insert-default-duplicate-values/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (419,27,'INSERT DELAYED','Syntax\n------\n\nINSERT DELAYED ...\n\nDescription\n-----------\n\nThe DELAYED option for the INSERT statement is a MariaDB/MySQL extension to\nstandard SQL that is very useful if you have clients that cannot or need not\nwait for the INSERT to complete. This is a common situation when you use\nMariaDB for logging and you also periodically run SELECT and UPDATE statements\nthat take a long time to complete.\n\nWhen a client uses INSERT DELAYED, it gets an okay from the server at once,\nand the row is queued to be inserted when the table is not in use by any other\nthread.\n\nAnother major benefit of using INSERT DELAYED is that inserts from many\nclients are bundled together and written in one block. This is much faster\nthan performing many separate inserts.\n\nNote that INSERT DELAYED is slower than a normal INSERT if the table is not\notherwise in use. There is also the additional overhead for the server to\nhandle a separate thread for each table for which there are delayed rows. This\nmeans that you should use INSERT DELAYED only when you are really sure that\nyou need it.\n\nThe queued rows are held only in memory until they are inserted into the\ntable. This means that if you terminate mysqld forcibly (for example, with\nkill -9) or if mysqld dies unexpectedly, any queued rows that have not been\nwritten to disk are lost.\n\nThe number of concurrent INSERT DELAYED threads is limited by the\nmax_delayed_threads server system variables. If it is set to 0, INSERT DELAYED\nis disabled. The session value can be equal to the global value, or 0 to\ndisable this statement for the current session. If this limit has been\nreached, the DELAYED clause will be silently ignore for subsequent statements\n(no error will be produced).\n\nLimitations\n-----------\n\nThere are some limitations on the use of DELAYED:\n\n* INSERT DELAYED works only with MyISAM, MEMORY, ARCHIVE,\n and BLACKHOLE tables. If you execute INSERT DELAYED with another storage\nengine, you will get an error like this: ERROR 1616 (HY000): DELAYED option\nnot supported for table \'tab_name\'\n* For MyISAM tables, if there are no free blocks in the middle of the data\n file, concurrent SELECT and INSERT statements are supported. Under these\n circumstances, you very seldom need to use INSERT DELAYED\n with MyISAM.\n* INSERT DELAYED should be used only for\n INSERT statements that specify value lists. The server\n ignores DELAYED for INSERT ... SELECT\n or INSERT ... ON DUPLICATE KEY UPDATE statements.\n* Because the INSERT DELAYED statement returns immediately,\n before the rows are inserted, you cannot use\n LAST_INSERT_ID() to get the\n AUTO_INCREMENT value that the statement might generate.\n* DELAYED rows are not visible to SELECT\n statements until they actually have been inserted.\n* After INSERT DELAYED, ROW_COUNT() returns the number of the rows you tried\nto insert, not the number of the successful writes.\n* DELAYED is ignored on slave replication servers, so that \n INSERT DELAYED is treated as a normal\n INSERT on slaves. This is because\n DELAYED could cause the slave to have different data than\n the master. INSERT DELAYED statements are not safe for replication.\n* Pending INSERT DELAYED statements are lost if a table is\n write locked and ALTER TABLE is used to modify the table structure.\n* INSERT DELAYED is not supported for views. If you try, you will get an error\nlike this: ERROR 1347 (HY000): \'view_name\' is not BASE TABLE\n* INSERT DELAYED is not supported for partitioned tables.\n* INSERT DELAYED is not supported within stored programs.\n* INSERT DELAYED does not work with triggers.\n* INSERT DELAYED does not work if there is a check constraint in place.\n* INSERT DELAYED does not work if skip-new mode is active.\n\n\n\nURL: mariadb.com/kb/en/insert-delayed/','','https://mariadb.com/kb/en/insert-delayed/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (420,27,'INSERT IGNORE','Ignoring Errors\n---------------\n\nNormally INSERT stops and rolls back when it encounters an error.\n\nBy using the IGNORE keyword all errors are converted to warnings, which will\nnot stop inserts of additional rows.\n\nThe IGNORE and DELAYED options are ignored when you use ON DUPLICATE KEY\nUPDATE.\n\nPrior to MySQL and MariaDB 5.5.28, no warnings were issued for duplicate key\nerrors when using IGNORE. You can get the old behavior if you set OLD_MODE to\nNO_DUP_KEY_WARNINGS_WITH_IGNORE.\n\nExamples\n--------\n\nCREATE TABLE t1 (x INT UNIQUE);\n\nINSERT INTO t1 VALUES(1),(2);\n\nINSERT INTO t1 VALUES(2),(3);\nERROR 1062 (23000): Duplicate entry \'2\' for key \'x\'\nSELECT * FROM t1;\n+------+\n| x |\n+------+\n| 1 |\n| 2 |\n+------+\n2 rows in set (0.00 sec)\n\nINSERT IGNORE INTO t1 VALUES(2),(3);\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n\nSHOW WARNINGS;\n+---------+------+---------------------------------+\n| Level | Code | Message |\n+---------+------+---------------------------------+\n| Warning | 1062 | Duplicate entry \'2\' for key \'x\' |\n+---------+------+---------------------------------+\n\nSELECT * FROM t1;\n+------+\n| x |\n+------+\n| 1 |\n| 2 |\n| 3 |\n+------+\n\nSee INSERT ON DUPLICATE KEY UPDATE for further examples using that syntax.\n\n\n\nURL: mariadb.com/kb/en/insert-ignore/','','https://mariadb.com/kb/en/insert-ignore/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (421,27,'INSERT ON DUPLICATE KEY UPDATE','Syntax\n------\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n [, col=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)]\n SET col={expr | DEFAULT}, ...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n [, col=expr] ... ]\n\nOr:\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n SELECT ...\n [ ON DUPLICATE KEY UPDATE\n col=expr\n [, col=expr] ... ]\n\nDescription\n-----------\n\nINSERT ... ON DUPLICATE KEY UPDATE is a MariaDB/MySQL extension to the INSERT\nstatement that, if it finds a duplicate unique or primary key, will instead\nperform an UPDATE.\n\nThe row/s affected value is reported as 1 if a row is inserted, and 2 if a row\nis updated, unless the API\'s CLIENT_FOUND_ROWS flag is set.\n\nIf more than one unique index is matched, only the first is updated. It is not\nrecommended to use this statement on tables with more than one unique index.\n\nIf the table has an AUTO_INCREMENT primary key and the statement inserts or\nupdates a row, the LAST_INSERT_ID() function returns its AUTO_INCREMENT value.\n\nThe VALUES() function can only be used in a ON DUPLICATE KEY UPDATE clause and\nhas no meaning in any other context. It returns the column values from the\nINSERT portion of the statement. This function is particularly useful for\nmulti-rows inserts.\n\nThe IGNORE and DELAYED options are ignored when you use ON DUPLICATE KEY\nUPDATE.\n\nSee Partition Pruning and Selection for details on the PARTITION clause.\n\nThis statement activates INSERT and UPDATE triggers. See Trigger Overview for\ndetails.\n\nSee also a similar statement, REPLACE.\n\nExamples\n--------\n\nCREATE TABLE ins_duplicate (id INT PRIMARY KEY, animal VARCHAR(30));\nINSERT INTO ins_duplicate VALUES (1,\'Aardvark\'), (2,\'Cheetah\'), (3,\'Zebra\');\n\nIf there is no existing key, the statement runs as a regular INSERT:\n\nINSERT INTO ins_duplicate VALUES (4,\'Gorilla\') \n ON DUPLICATE KEY UPDATE animal=\'Gorilla\';\nQuery OK, 1 row affected (0.07 sec)\n\nSELECT * FROM ins_duplicate;\n+----+----------+\n| id | animal |\n+----+----------+\n| 1 | Aardvark |\n| 2 | Cheetah |\n| 3 | Zebra |\n| 4 | Gorilla |\n+----+----------+\n\nA regular INSERT with a primary key value of 1 will fail, due to the existing\nkey:\n\nINSERT INTO ins_duplicate VALUES (1,\'Antelope\');\nERROR 1062 (23000): Duplicate entry \'1\' for key \'PRIMARY\'\n\nHowever, we can use an INSERT ON DUPLICATE KEY UPDATE instead:\n\nINSERT INTO ins_duplicate VALUES (1,\'Antelope\') \n ON DUPLICATE KEY UPDATE animal=\'Antelope\';\nQuery OK, 2 rows affected (0.09 sec)\n\nNote that there are two rows reported as affected, but this refers only to the\nUPDATE.\n\nSELECT * FROM ins_duplicate;\n+----+----------+\n| id | animal |\n+----+----------+\n| 1 | Antelope |\n| 2 | Cheetah |\n| 3 | Zebra |\n| 4 | Gorilla |\n+----+----------+\n\nAdding a second unique column:\n\nALTER TABLE ins_duplicate ADD id2 INT;\nUPDATE ins_duplicate SET id2=id+10;\nALTER TABLE ins_duplicate ADD UNIQUE KEY(id2);\n\nWhere two rows match the unique keys match, only the first is updated. This\ncan be unsafe and is not recommended unless you are certain what you are doing.\n\nINSERT INTO ins_duplicate VALUES (2,\'Lion\',13) \n ON DUPLICATE KEY UPDATE animal=\'Lion\';\nQuery OK, 2 rows affected (0.004 sec)\n\nSELECT * FROM ins_duplicate;\n+----+----------+------+\n| id | animal | id2 |\n+----+----------+------+\n| 1 | Antelope | 11 |\n| 2 | Lion | 12 |\n| 3 | Zebra | 13 |\n| 4 | Gorilla | 14 |\n+----+----------+------+\n\nAlthough the third row with an id of 3 has an id2 of 13, which also matched,\nit was not updated.\n\nChanging id to an auto_increment field. If a new row is added, the\nauto_increment is moved forward. If the row is updated, it remains the same.\n\nALTER TABLE `ins_duplicate` CHANGE `id` `id` INT( 11 ) NOT NULL AUTO_INCREMENT;\nALTER TABLE ins_duplicate DROP id2;\nSELECT Auto_increment FROM INFORMATION_SCHEMA.TABLES \n WHERE TABLE_NAME=\'ins_duplicate\';\n+----------------+\n| Auto_increment |\n+----------------+\n| 5 |\n+----------------+\n\nINSERT INTO ins_duplicate VALUES (2,\'Leopard\') \n ON DUPLICATE KEY UPDATE animal=\'Leopard\';\nQuery OK, 2 rows affected (0.00 sec)\n\nSELECT Auto_increment FROM INFORMATION_SCHEMA.TABLES \n WHERE TABLE_NAME=\'ins_duplicate\';\n+----------------+\n| Auto_increment |\n+----------------+\n| 5 |\n+----------------+\n\nINSERT INTO ins_duplicate VALUES (5,\'Wild Dog\') \n ON DUPLICATE KEY UPDATE animal=\'Wild Dog\';\nQuery OK, 1 row affected (0.09 sec)\n\nSELECT * FROM ins_duplicate;\n+----+----------+\n| id | animal |\n+----+----------+\n| 1 | Antelope |\n| 2 | Leopard |\n| 3 | Zebra |\n| 4 | Gorilla |\n| 5 | Wild Dog |\n+----+----------+\n\nSELECT Auto_increment FROM INFORMATION_SCHEMA.TABLES \n WHERE TABLE_NAME=\'ins_duplicate\';\n+----------------+\n| Auto_increment |\n+----------------+\n| 6 |\n+----------------+\n\nRefering to column values from the INSERT portion of the statement:\n\nINSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6)\n ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);\n\nSee the VALUES() function for more.\n\n\n\nURL: mariadb.com/kb/en/insert-on-duplicate-key-update/','','https://mariadb.com/kb/en/insert-on-duplicate-key-update/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (422,27,'INSERT SELECT','Syntax\n------\n\nINSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]\n [INTO] tbl_name [(col_name,...)]\n SELECT ...\n [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]\n\nDescription\n-----------\n\nWith INSERT ... SELECT, you can quickly insert many rows into a table from one\nor more other tables. For example:\n\nINSERT INTO tbl_temp2 (fld_id)\n SELECT tbl_temp1.fld_order_id\n FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;\n\ntbl_name can also be specified in the form db_name.tbl_name (see Identifier\nQualifiers). This allows to copy rows between different databases.\n\nIf the new table has a primary key or UNIQUE indexes, you can use IGNORE to\nhandle duplicate key errors during the query. The newer values will not be\ninserted if an identical value already exists.\n\nREPLACE can be used instead of INSERT to prevent duplicates on UNIQUE indexes\nby deleting old values. In that case, ON DUPLICATE KEY UPDATE cannot be used.\n\nINSERT ... SELECT works for tables which already exist. To create a table for\na given resultset, you can use CREATE TABLE ... SELECT.\n\n\n\nURL: mariadb.com/kb/en/insert-select/','','https://mariadb.com/kb/en/insert-select/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (423,27,'INTERSECT','MariaDB starting with 10.3.0\n----------------------------\nINTERSECT was introduced in MariaDB 10.3.0.\n\nThe result of an intersect is the intersection of right and left SELECT\nresults, i.e. only records that are present in both result sets will be\nincluded in the result of the operation.\n\nSyntax\n------\n\nSELECT ...\n(INTERSECT [ALL | DISTINCT] | EXCEPT [ALL | DISTINCT] | UNION [ALL |\nDISTINCT]) SELECT ...\n[(INTERSECT [ALL | DISTINCT] | EXCEPT [ALL | DISTINCT] | UNION [ALL |\nDISTINCT]) SELECT ...]\n[ORDER BY [column [, column ...]]]\n[LIMIT {[offset,] row_count | row_count OFFSET offset}]\n\nDescription\n-----------\n\nMariaDB has supported INTERSECT (as well as EXCEPT) in addition to UNION since\nMariaDB 10.3.\n\nAll behavior for naming columns, ORDER BY and LIMIT is the same as for UNION.\n\nINTERSECT implicitly supposes a DISTINCT operation.\n\nThe result of an intersect is the intersection of right and left SELECT\nresults, i.e. only records that are present in both result sets will be\nincluded in the result of the operation.\n\nINTERSECT has higher precedence than UNION and EXCEPT (unless running running\nin Oracle mode, in which case all three have the same precedence). If possible\nit will be executed linearly but if not it will be translated to a subquery in\nthe FROM clause:\n\n(select a,b from t1)\nunion\n(select c,d from t2)\nintersect\n(select e,f from t3)\nunion\n(select 4,4);\n\nwill be translated to:\n\n(select a,b from t1)\nunion\nselect c,d from\n ((select c,d from t2)\n intersect\n (select e,f from t3)) dummy_subselect\nunion\n(select 4,4)\n\nMariaDB starting with 10.4.0\n----------------------------\n\nParentheses\n-----------\n\nFrom MariaDB 10.4.0, parentheses can be used to specify precedence. Before\nthis, a syntax error would be returned.\n\nMariaDB starting with 10.5.0\n----------------------------\n\nALL/DISTINCT\n------------\n\nINTERSECT ALL and INTERSECT DISTINCT were introduced in MariaDB 10.5.0. The\nALL operator leaves duplicates intact, while the DISTINCT operator removes\nduplicates. DISTINCT is the default behavior if neither operator is supplied,\nand the only behavior prior to MariaDB 10.5.\n\nExamples\n--------\n\nShow customers which are employees:\n\n(SELECT e_name AS name, email FROM employees)\nINTERSECT\n(SELECT c_name AS name, email FROM customers);\n\nDifference between UNION, EXCEPT and INTERSECT. INTERSECT ALL and EXCEPT ALL\nare available from MariaDB 10.5.0.\n\nCREATE TABLE seqs (i INT);\nINSERT INTO seqs VALUES (1),(2),(2),(3),(3),(4),(5),(6);\n\nSELECT i FROM seqs WHERE i <= 3 UNION SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n| 3 |\n| 4 |\n| 5 |\n| 6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 UNION ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n| 2 |\n| 3 |\n| 3 |\n| 3 |\n| 3 |\n| 4 |\n| 5 |\n| 6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n| 2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 3 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 3 |\n| 3 |\n+------+\n\nParentheses for specifying precedence, from MariaDB 10.4.0\n\nCREATE OR REPLACE TABLE t1 (a INT);\nCREATE OR REPLACE TABLE t2 (b INT);\nCREATE OR REPLACE TABLE t3 (c INT);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4);\nINSERT INTO t2 VALUES (5),(6);\nINSERT INTO t3 VALUES (1),(6);\n\n((SELECT a FROM t1) UNION (SELECT b FROM t2)) INTERSECT (SELECT c FROM t3);\n+------+\n| a |\n+------+\n| 1 |\n| 6 |\n+------+\n\n(SELECT a FROM t1) UNION ((SELECT b FROM t2) INTERSECT (SELECT c FROM t3));\n+------+\n| a |\n+------+\n| 1 |\n| 2 |\n| 3 |\n| 4 |\n| 6 |\n+------+\n\n\n\nURL: mariadb.com/kb/en/intersect/','','https://mariadb.com/kb/en/intersect/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (424,27,'JOIN Syntax','Description\n-----------\n\nMariaDB supports the following JOIN syntaxes for the table_references part of\nSELECT statements and multiple-table DELETE and UPDATE statements:\n\ntable_references:\n table_reference [, table_reference] ...\n\ntable_reference:\n table_factor\n | join_table\n\ntable_factor:\n tbl_name [PARTITION (partition_list)]\n [query_system_time_period_specification] [[AS] alias] [index_hint_list]\n | table_subquery [query_system_time_period_specification] [AS] alias\n | ( table_references )\n | { ON table_reference LEFT OUTER JOIN table_reference\n ON conditional_expr }\n\njoin_table:\n table_reference [INNER | CROSS] JOIN table_factor [join_condition]\n | table_reference STRAIGHT_JOIN table_factor\n | table_reference STRAIGHT_JOIN table_factor ON conditional_expr\n | table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference join_condition\n | table_reference NATURAL [{LEFT|RIGHT} [OUTER]] JOIN table_factor\n\njoin_condition:\n ON conditional_expr\n | USING (column_list)\n\nquery_system_time_period_specification:\n FOR SYSTEM_TIME AS OF point_in_time\n | FOR SYSTEM_TIME BETWEEN point_in_time AND point_in_time\n | FOR SYSTEM_TIME FROM point_in_time TO point_in_time\n | FOR SYSTEM_TIME ALL\n\npoint_in_time:\n [TIMESTAMP] expression\n | TRANSACTION expression\n\nindex_hint_list:\n index_hint [, index_hint] ...\n\nindex_hint:\n USE {INDEX|KEY}\n [{FOR {JOIN|ORDER BY|GROUP BY}] ([index_list])\n | IGNORE {INDEX|KEY}\n [{FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n | FORCE {INDEX|KEY}\n [{FOR {JOIN|ORDER BY|GROUP BY}] (index_list)\n\nindex_list:\n index_name [, index_name] ...\n\nA table reference is also known as a join expression.\n\nEach table can also be specified as db_name.tabl_name. This allows to write\nqueries which involve multiple databases. See Identifier Qualifiers for syntax\ndetails.\n\nThe syntax of table_factor is extended in comparison with the SQL Standard.\nThe latter accepts only table_reference, not a list of them inside a pair of\nparentheses.\n\nThis is a conservative extension if we consider each comma in a list of\ntable_reference items as equivalent to an inner join. For example:\n\nSELECT * FROM t1 LEFT JOIN (t2, t3, t4)\n ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n\nis equivalent to:\n\nSELECT * FROM t1 LEFT JOIN (t2 CROSS JOIN t3 CROSS JOIN t4)\n ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)\n\nIn MariaDB, CROSS JOIN is a syntactic equivalent to INNER JOIN (they can\nreplace each other). In standard SQL, they are not equivalent. INNER JOIN is\nused with an ON clause, CROSS JOIN is used otherwise.\n\nIn general, parentheses can be ignored in join expressions containing only\ninner join operations. MariaDB also supports nested joins (see\nhttp://dev.mysql.com/doc/refman/5.1/en/nested-join-optimization.html).\n\nSee System-versioned tables for more information about FOR SYSTEM_TIME syntax.\n\nIndex hints can be specified to affect how the MariaDB optimizer makes use of\nindexes. For more information, see How to force query plans.\n\nExamples\n--------\n\nSELECT left_tbl.*\n FROM left_tbl LEFT JOIN right_tbl ON left_tbl.id = right_tbl.id\n WHERE right_tbl.id IS NULL;\n\n\n\nURL: mariadb.com/kb/en/join-syntax/','','https://mariadb.com/kb/en/join-syntax/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (425,27,'LIMIT','Description\n-----------\n\nUse the LIMIT clause to restrict the number of returned rows. When you use a\nsingle integer n with LIMIT, the first n rows will be returned. Use the ORDER\nBY clause to control which rows come first. You can also select a number of\nrows after an offset using either of the following:\n\nLIMIT offset, row_count\nLIMIT row_count OFFSET offset\n\nWhen you provide an offset m with a limit n, the first m rows will be ignored,\nand the following n rows will be returned.\n\nExecuting an UPDATE with the LIMIT clause is not safe for replication. LIMIT 0\nis an exception to this rule (see MDEV-6170).\n\nThere is a LIMIT ROWS EXAMINED optimization which provides the means to\nterminate the execution of SELECT statements which examine too many rows, and\nthus use too many resources. See LIMIT ROWS EXAMINED.\n\nMulti-Table Updates\n-------------------\n\nMariaDB starting with 10.3.2\n----------------------------\nUntil MariaDB 10.3.1, it was not possible to use LIMIT (or ORDER BY) in a\nmulti-table UPDATE statement. This restriction was lifted in MariaDB 10.3.2.\n\nGROUP_CONCAT\n------------\n\nMariaDB starting with 10.3.2\n----------------------------\nStarting from MariaDB 10.3.3, it is possible to use LIMIT with GROUP_CONCAT().\n\nExamples\n--------\n\nCREATE TABLE members (name VARCHAR(20));\nINSERT INTO members VALUES(\'Jagdish\'),(\'Kenny\'),(\'Rokurou\'),(\'Immaculada\');\n\nSELECT * FROM members;\n+------------+\n| name |\n+------------+\n| Jagdish |\n| Kenny |\n| Rokurou |\n| Immaculada |\n+------------+\n\nSelect the first two names (no ordering specified):\n\nSELECT * FROM members LIMIT 2;\n+---------+\n| name |\n+---------+\n| Jagdish |\n| Kenny |\n+---------+\n\nAll the names in alphabetical order:\n\nSELECT * FROM members ORDER BY name;\n+------------+\n| name |\n+------------+\n| Immaculada |\n| Jagdish |\n| Kenny |\n| Rokurou |\n+------------+\n\nThe first two names, ordered alphabetically:\n\nSELECT * FROM members ORDER BY name LIMIT 2;\n+------------+\n| name |\n+------------+\n| Immaculada |\n| Jagdish |\n+------------+\n\nThe third name, ordered alphabetically (the first name would be offset zero,\nso the third is offset two):\n\nSELECT * FROM members ORDER BY name LIMIT 2,1;\n+-------+\n| name |\n+-------+\n| Kenny |\n+-------+\n\nFrom MariaDB 10.3.2, LIMIT can be used in a multi-table update:\n\nCREATE TABLE warehouse (product_id INT, qty INT);\nINSERT INTO warehouse VALUES (1,100),(2,100),(3,100),(4,100);\n\nCREATE TABLE store (product_id INT, qty INT);\nINSERT INTO store VALUES (1,5),(2,5),(3,5),(4,5);\n\nUPDATE warehouse,store SET warehouse.qty = warehouse.qty-2, store.qty =\nstore.qty+2 \n WHERE (warehouse.product_id = store.product_id AND store.product_id >= 1)\n ORDER BY store.product_id DESC LIMIT 2;\n\nSELECT * FROM warehouse;\n+------------+------+\n| product_id | qty |\n+------------+------+\n| 1 | 100 |\n| 2 | 100 |\n| 3 | 98 |\n| 4 | 98 |\n+------------+------+\n\nSELECT * FROM store;\n+------------+------+\n| product_id | qty |\n+------------+------+\n| 1 | 5 |\n| 2 | 5 |\n| 3 | 7 |\n| 4 | 7 |\n+------------+------+\n\nFrom MariaDB 10.3.3, LIMIT can be used with GROUP_CONCAT, so, for example,\ngiven the following table:\n\nCREATE TABLE d (dd DATE, cc INT);\n\nINSERT INTO d VALUES (\'2017-01-01\',1);\nINSERT INTO d VALUES (\'2017-01-02\',2);\nINSERT INTO d VALUES (\'2017-01-04\',3);\n\nthe following query:\n\nSELECT SUBSTRING_INDEX(GROUP_CONCAT(CONCAT_WS(":",dd,cc) ORDER BY cc\nDESC),",",1) FROM d;\n+----------------------------------------------------------------------------+\n| SUBSTRING_INDEX(GROUP_CONCAT(CONCAT_WS(":",dd,cc) ORDER BY cc DESC),",",1) |\n+----------------------------------------------------------------------------+\n| 2017-01-04:3 |\n+----------------------------------------------------------------------------+\n\ncan be more simply rewritten as:\n\nSELECT GROUP_CONCAT(CONCAT_WS(":",dd,cc) ORDER BY cc DESC LIMIT 1) FROM d;\n+-------------------------------------------------------------+\n| GROUP_CONCAT(CONCAT_WS(":",dd,cc) ORDER BY cc DESC LIMIT 1) |\n+-------------------------------------------------------------+\n| 2017-01-04:3 |\n+-------------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/limit/','','https://mariadb.com/kb/en/limit/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (426,27,'LOAD DATA INFILE','Syntax\n------\n\nLOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n [REPLACE | IGNORE]\n INTO TABLE tbl_name\n [CHARACTER SET charset_name]\n [{FIELDS | COLUMNS}\n [TERMINATED BY \'string\']\n [[OPTIONALLY] ENCLOSED BY \'char\']\n [ESCAPED BY \'char\']\n ]\n [LINES\n [STARTING BY \'string\']\n [TERMINATED BY \'string\']\n ]\n [IGNORE number LINES]\n [(col_name_or_user_var,...)]\n [SET col_name = expr,...]\n\nDescription\n-----------\n\nLOAD DATA INFILE is unsafe for statement-based replication.\n\nReads rows from a text file into the designated table on the database at a\nvery high speed. The file name must be given as a literal string.\n\nFiles are written to disk using the SELECT INTO OUTFILE statement. You can\nthen read the files back into a table using the LOAD DATA INFILE statement.\nThe FIELDS and LINES clauses are the same in both statements. These clauses\nare optional, but if both are specified then the FIELDS clause must precede\nLINES.\n\nExecuting this statement activates INSERT triggers.\n\nOne must have the FILE privilege to be able to execute LOAD DATA. This is the\nensure the normal users will not attempt to read system files.\n\nNote that MariaDB\'s systemd unit file restricts access to /home, /root, and\n/run/user by default. See Configuring access to home directories.\n\nLOAD DATA LOCAL INFILE\n----------------------\n\nWhen you execute the LOAD DATA INFILE statement, MariaDB Server attempts to\nread the input file from its own file system. In contrast, when you execute\nthe LOAD DATA LOCAL INFILE statement, the client attempts to read the input\nfile from its file system, and it sends the contents of the input file to the\nMariaDB Server. This allows you to load files from the client\'s local file\nsystem into the database.\n\nIn the event that you don\'t want to permit this operation (such as for\nsecurity reasons), you can disable the LOAD DATA LOCAL INFILE statement on\neither the server or the client.\n\n* The LOAD DATA LOCAL INFILE statement can be disabled on the server by\nsetting the local_infile system variable to 0.\n* The LOAD DATA LOCAL INFILE statement can be disabled on the client. If you\nare using MariaDB Connector/C, this can be done by unsetting the\nCLIENT_LOCAL_FILES capability flag with the mysql_real_connect function or by\nunsetting the MYSQL_OPT_LOCAL_INFILE option with mysql_optionsv function. If\nyou are using a different client or client library, then see the documentation\nfor your specific client or client library to determine how it handles the\nLOAD DATA LOCAL INFILE statement.\n\nIf the LOAD DATA LOCAL INFILE statement is disabled by either the server or\nthe client and if the user attempts to execute it, then the server will cause\nthe statement to fail with the following error message:\n\nThe used command is not allowed with this MariaDB version\n\nNote that it is not entirely accurate to say that the MariaDB version does not\nsupport the command. It would be more accurate to say that the MariaDB\nconfiguration does not support the command. See MDEV-20500 for more\ninformation.\n\nFrom MariaDB 10.5.2, the error message is more accurate:\n\nThe used command is not allowed because the MariaDB server or client \n has disabled the local infile capability\n\nREPLACE and IGNORE\n------------------\n\nIn cases where you load data from a file into a table that already contains\ndata and has a primary key, you may encounter issues where the statement\nattempts to insert a row with a primary key that already exists. When this\nhappens, the statement fails with Error 1064, protecting the data already on\nthe table. In cases where you want MariaDB to overwrite duplicates, use the\nREPLACE keyword.\n\nThe REPLACE keyword works like the REPLACE statement. Here, the statement\nattempts to load the data from the file. If the row does not exist, it adds it\nto the table. If the row contains an existing Primary Key, it replaces the\ntable data. That is, in the event of a conflict, it assumes the file contains\nthe desired row.\n\nThis operation can cause a degradation in load speed by a factor of 20 or more\nif the part that has already been loaded is larger than the capacity of the\nInnoDB Buffer Pool. This happens because it causes a lot of turnaround in the\nbuffer pool.\n\nUse the IGNORE keyword when you want to skip any rows that contain a\nconflicting primary key. Here, the statement attempts to load the data from\nthe file. If the row does not exist, it adds it to the table. If the row\ncontains an existing primary key, it ignores the addition request and moves on\nto the next. That is, in the event of a conflict, it assumes the table\ncontains the desired row.\n\nCharacter-sets\n--------------\n\nWhen the statement opens the file, it attempts to read the contents using the\ndefault character-set, as defined by the character_set_database system\nvariable.\n\nIn the cases where the file was written using a character-set other than the\ndefault, you can specify the character-set to use with the CHARACTER SET\nclause in the statement. It ignores character-sets specified by the SET NAMES\nstatement and by the character_set_client system variable. Setting the\nCHARACTER SET clause to a value of binary indicates "no conversion."\n\nThe statement interprets all fields in the file as having the same\ncharacter-set, regardless of the column data type. To properly interpret file\ncontents, you must ensure that it was written with the correct character-set.\nIf you write a data file with mysqldump -T or with the SELECT INTO OUTFILE\nstatement with the mysql client, be sure to use the --default-character-set\noption, so that the output is written with the desired character-set.\n\nWhen using mixed character sets, use the CHARACTER SET clause in both SELECT\nINTO OUTFILE and LOAD DATA INFILE to ensure that MariaDB correctly interprets\nthe escape sequences.\n\nThe character_set_filesystem system variable controls the interpretation of\nthe filename.\n\nIt is currently not possible to load data files that use the ucs2 character\nset.\n\nPreprocessing Inputs\n--------------------\n\ncol_name_or_user_var can be a column name, or a user variable. In the case of\na variable, the SET statement can be used to preprocess the value before\nloading into the table.\n\nPriority and Concurrency\n------------------------\n\nIn storage engines that perform table-level locking (MyISAM, MEMORY and\nMERGE), using the LOW_PRIORITY keyword, MariaDB delays insertions until no\nother clients are reading from the table. Alternatively, when using the MyISAM\nstorage engine, you can use the CONCURRENT keyword to perform concurrent\ninsertion.\n\nThe LOW_PRIORITY and CONCURRENT keywords are mutually exclusive. They cannot\nbe used in the same statement.\n\nProgress Reporting\n------------------\n\nThe LOAD DATA INFILE statement supports progress reporting. You may find this\nuseful when dealing with long-running operations. Using another client you can\nissue a SHOW PROCESSLIST query to check the progress of the data load.\n\nUsing mariadb-import/mysqlimport\n--------------------------------\n\nMariaDB ships with a separate utility for loading data from files:\nmariadb-import (or mysqlimport before MariaDB 10.5). It operates by sending\nLOAD DATA INFILE statements to the server.\n\nUsing mariadb-import/mysqlimport you can compress the file using the\n--compress option, to get better performance over slow networks, providing\nboth the client and server support the compressed protocol. Use the --local\noption to load from the local file system.\n\nIndexing\n--------\n\nIn cases where the storage engine supports ALTER TABLE... DISABLE KEYS\nstatements (MyISAM and Aria), the LOAD DATA INFILE statement automatically\ndisables indexes during the execution.\n\nExamples\n--------\n\nYou have a file with this content (note the the separator is \',\', not tab,\nwhich is the default):\n\n2,2\n3,3\n4,4\n5,5\n6,8\n\nCREATE TABLE t1 (a int, b int, c int, d int);\nLOAD DATA LOCAL INFILE \n \'/tmp/loaddata7.dat\' into table t1 fields terminated by \',\' (a,b) set c=a+b;\nSELECT * FROM t1;\n+------+------+------+\n| a | b | c |\n+------+------+------+\n| 2 | 2 | 4 |\n| 3 | 3 | 6 |\n| 4 | 4 | 8 |\n| 5 | 5 | 10 |\n| 6 | 8 | 14 |\n+------+------+------+\n\nAnother example, given the following data (the separator is a tab):\n\n1 a\n2 b\n\nThe value of the first column is doubled before loading:\n\nLOAD DATA INFILE \'ld.txt\' INTO TABLE ld (@i,v) SET i=@i*2;\n\nSELECT * FROM ld;\n+------+------+\n| i | v |\n+------+------+\n| 2 | a |\n| 4 | b |\n+------+------+\n\n\n\nURL: mariadb.com/kb/en/load-data-infile/','','https://mariadb.com/kb/en/load-data-infile/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (427,27,'LOAD XML','Syntax\n------\n\nLOAD XML [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE \'file_name\'\n [REPLACE | IGNORE]\n INTO TABLE [db_name.]tbl_name\n [CHARACTER SET charset_name]\n [ROWS IDENTIFIED BY \'<tagname>\']\n [IGNORE number {LINES | ROWS}]\n [(column_or_user_var,...)]\n [SET col_name = expr,...]\n\nDescription\n-----------\n\nThe LOAD XML statement reads data from an XML file into a table. The file_name\nmust be given as a literal string. The tagname in the optional ROWS IDENTIFIED\nBY clause must also be given as a literal string, and must be surrounded by\nangle brackets (< and >).\n\nLOAD XML acts as the complement of running the mysql client in XML output mode\n(that is, starting the client with the --xml option). To write data from a\ntable to an XML file, use a command such as the following one from the system\nshell:\n\nshell> mysql --xml -e \'SELECT * FROM mytable\' > file.xml\n\nTo read the file back into a table, use LOAD XML INFILE. By default, the <row>\nelement is considered to be the equivalent of a database table row; this can\nbe changed using the ROWS IDENTIFIED BY clause.\n\nThis statement supports three different XML formats:\n\n* Column names as attributes and column values as attribute values:\n\n<row column1="value1" column2="value2" .../>\n\n* Column names as tags and column values as the content of these tags:\n\n<row>\n <column1>value1</column1>\n <column2>value2</column2>\n</row>\n\n* Column names are the name attributes of <field> tags, and values are\n the contents of these tags:\n\n<row>\n <field name=\'column1\'>value1</field>\n <field name=\'column2\'>value2</field>\n</row>\n\nThis is the format used by other tools, such as mysqldump.\n\nAll 3 formats can be used in the same XML file; the import routine\nautomatically detects the format for each row and interprets it correctly.\nTags are matched based on the tag or attribute name and the column name.\n\nThe following clauses work essentially the same way for LOAD XML as they do\nfor LOAD DATA:\n\n* LOW_PRIORITY or CONCURRENT\n* LOCAL\n* REPLACE or IGNORE\n* CHARACTER SET\n* (column_or_user_var,...)\n* SET\n\nSee LOAD DATA for more information about these clauses.\n\nThe IGNORE number LINES or IGNORE number ROWS clause causes the first number\nrows in the XML file to be skipped. It is analogous to the LOAD DATA\nstatement\'s IGNORE ... LINES clause.\n\nIf the LOW_PRIORITY keyword is used, insertions are delayed until no other\nclients are reading from the table. The CONCURRENT keyword allowes the use of\nconcurrent inserts. These clauses cannot be specified together.\n\nThis statement activates INSERT triggers.\n\n\n\nURL: mariadb.com/kb/en/load-xml/','','https://mariadb.com/kb/en/load-xml/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (428,27,'LOCK IN SHARE MODE','InnoDB supports row-level locking. Selected rows can be locked using\nLOCK IN SHARE MODE or FOR UPDATE. In both cases, a lock is acquired on the\nrows read by the query, and it will be released when the current transaction\nis committed.\n\nWhen LOCK IN SHARE MODE is specified in a SELECT statement, MariaDB will wait\nuntil all transactions that have modified the rows are committed. Then, a\nwrite lock is acquired. All transactions can read the rows, but if they want\nto modify them, they have to wait until your transaction is committed.\n\nIf autocommit is set to 1, the LOCK IN SHARE MODE and FOR UPDATE clauses have\nno effect.\n\n\n\nURL: mariadb.com/kb/en/lock-in-share-mode/','','https://mariadb.com/kb/en/lock-in-share-mode/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (429,27,'Non-Recursive Common Table Expressions Overview','Common Table Expressions (CTEs) are a standard SQL feature, and are\nessentially temporary named result sets. There are two kinds of CTEs:\nNon-Recursive, which this article covers; and Recursive.\n\nMariaDB starting with 10.2.1\n----------------------------\nCommon table expressions were introduced in MariaDB 10.2.1.\n\nNon-Recursive CTEs\n------------------\n\nThe WITH keyword signifies a CTE. It is given a name, followed by a body (the\nmain query) as follows:\n\nCTEs are similar to derived tables. For example\n\nWITH engineers AS \n ( SELECT * FROM employees\n WHERE dept = \'Engineering\' )\n\nSELECT * FROM engineers\nWHERE ...\n\nSELECT * FROM\n ( SELECT * FROM employees\n WHERE dept = \'Engineering\' ) AS engineers\nWHERE\n...\n\nA non-recursive CTE is basically a query-local VIEW. There are several\nadvantages and caveats to them. The syntax is more readable than nested FROM\n(SELECT ...). A CTE can refer to another and it can be referenced from\nmultiple places.\n\nA CTE referencing Another CTE\n-----------------------------\n\nUsing this format makes for a more readable SQL than a nested FROM(SELECT ...)\nclause. Below is an example of this:\n\nWITH engineers AS (\nSELECT * FROM employees\nWHERE dept IN(\'Development\',\'Support\') ),\neu_engineers AS ( SELECT * FROM engineers WHERE country IN(\'NL\',...) )\nSELECT\n...\nFROM eu_engineers;\n\nMultiple Uses of a CTE\n----------------------\n\nThis can be an \'anti-self join\', for example:\n\nWITH engineers AS (\nSELECT * FROM employees\nWHERE dept IN(\'Development\',\'Support\') )\n\nSELECT * FROM engineers E1\nWHERE NOT EXISTS\n (SELECT 1 FROM engineers E2\n WHERE E2.country=E1.country\n AND E2.name <> E1.name );\n\nOr, for year-over-year comparisons, for example:\n\nWITH sales_product_year AS (\nSELECT product, YEAR(ship_date) AS year,\nSUM(price) AS total_amt\nFROM item_sales\nGROUP BY product, year )\n\nSELECT *\nFROM sales_product_year CUR,\nsales_product_year PREV,\nWHERE CUR.product=PREV.product \nAND CUR.year=PREV.year + 1 \nAND CUR.total_amt > PREV.total_amt\n\nAnother use is to compare individuals against their group. Below is an example\nof how this might be executed:\n\nWITH sales_product_year AS (\nSELECT product,\nYEAR(ship_date) AS year,\nSUM(price) AS total_amt\nFROM item_sales\nGROUP BY product, year\n)\n\nSELECT * \nFROM sales_product_year S1\nWHERE\ntotal_amt > \n (SELECT 0.1 * SUM(total_amt)\n FROM sales_product_year S2\n WHERE S2.year = S1.year)\n\n\n\nURL: mariadb.com/kb/en/non-recursive-common-table-expressions-overview/','','https://mariadb.com/kb/en/non-recursive-common-table-expressions-overview/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (430,27,'ORDER BY','Description\n-----------\n\nUse the ORDER BY clause to order a resultset, such as that are returned from a\nSELECT statement. You can specify just a column or use any expression with\nfunctions. If you are using the GROUP BY clause, you can use grouping\nfunctions in ORDER BY. Ordering is done after grouping.\n\nYou can use multiple ordering expressions, separated by commas. Rows will be\nsorted by the first expression, then by the second expression if they have the\nsame value for the first, and so on.\n\nYou can use the keywords ASC and DESC after each ordering expression to force\nthat ordering to be ascending or descending, respectively. Ordering is\nascending by default.\n\nYou can also use a single integer as the ordering expression. If you use an\ninteger n, the results will be ordered by the nth column in the select\nexpression.\n\nWhen string values are compared, they are compared as if by the STRCMP\nfunction. STRCMP ignores trailing whitespace and may normalize characters and\nignore case, depending on the collation in use.\n\nDuplicated entries in the ORDER BY clause are removed.\n\nORDER BY can also be used to order the activities of a DELETE or UPDATE\nstatement (usually with the LIMIT clause).\n\nMariaDB starting with 10.3.2\n----------------------------\nUntil MariaDB 10.3.1, it was not possible to use ORDER BY (or LIMIT) in a\nmulti-table UPDATE statement. This restriction was lifted in MariaDB 10.3.2.\n\nMariaDB starting with 10.5\n--------------------------\nFrom MariaDB 10.5, MariaDB allows packed sort keys and values of non-sorted\nfields in the sort buffer. This can make filesort temporary files much smaller\nwhen VARCHAR, CHAR or BLOBs are used, notably speeding up some ORDER BY sorts.\n\nExamples\n--------\n\nCREATE TABLE seq (i INT, x VARCHAR(1));\nINSERT INTO seq VALUES (1,\'a\'), (2,\'b\'), (3,\'b\'), (4,\'f\'), (5,\'e\');\n\nSELECT * FROM seq ORDER BY i;\n+------+------+\n| i | x |\n+------+------+\n| 1 | a |\n| 2 | b |\n| 3 | b |\n| 4 | f |\n| 5 | e |\n+------+------+\n\nSELECT * FROM seq ORDER BY i DESC;\n+------+------+\n| i | x |\n+------+------+\n| 5 | e |\n| 4 | f |\n| 3 | b |\n| 2 | b |\n| 1 | a |\n+------+------+\n\nSELECT * FROM seq ORDER BY x,i;\n+------+------+\n| i | x |\n+------+------+\n| 1 | a |\n| 2 | b |\n| 3 | b |\n| 5 | e |\n| 4 | f |\n+------+------+\n\nORDER BY in an UPDATE statement, in conjunction with LIMIT:\n\nUPDATE seq SET x=\'z\' WHERE x=\'b\' ORDER BY i DESC LIMIT 1;\n\nSELECT * FROM seq;\n+------+------+\n| i | x |\n+------+------+\n| 1 | a |\n| 2 | b |\n| 3 | z |\n| 4 | f |\n| 5 | e |\n+------+------+\n\nFrom MariaDB 10.3.2, ORDER BY can be used in a multi-table update:\n\nCREATE TABLE warehouse (product_id INT, qty INT);\nINSERT INTO warehouse VALUES (1,100),(2,100),(3,100),(4,100);\n\nCREATE TABLE store (product_id INT, qty INT);\nINSERT INTO store VALUES (1,5),(2,5),(3,5),(4,5);\n\nUPDATE warehouse,store SET warehouse.qty = warehouse.qty-2, store.qty =\nstore.qty+2 \n WHERE (warehouse.product_id = store.product_id AND store.product_id >= 1)\n ORDER BY store.product_id DESC LIMIT 2;\n\nSELECT * FROM warehouse;\n+------------+------+\n| product_id | qty |\n+------------+------+\n| 1 | 100 |\n| 2 | 100 |\n| 3 | 98 |\n| 4 | 98 |\n+------------+------+\n\nSELECT * FROM store;\n+------------+------+\n| product_id | qty |\n+------------+------+\n| 1 | 5 |\n| 2 | 5 |\n| 3 | 7 |\n| 4 | 7 |\n+------------+------+\n\n\n\nURL: mariadb.com/kb/en/order-by/','','https://mariadb.com/kb/en/order-by/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (431,27,'PROCEDURE','The PROCEDURE clause of SELECT passes the whole result set to a\nProcedure which will process it. These Procedures are not Stored Procedures,\nand can only be written in the C language, so it is necessary to recompile the\nserver.\n\nCurrently, the only available procedure is ANALYSE, which examines the\nresultset and suggests the optimal datatypes for each column. It is defined in\nthe sql/sql_analyse.cc file, and can be used as an example to create more\nProcedures.\n\nThis clause cannot be used in a view\'s definition.\n\n\n\nURL: mariadb.com/kb/en/procedure/','','https://mariadb.com/kb/en/procedure/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (432,27,'Recursive Common Table Expressions Overview','MariaDB starting with 10.2.2\n----------------------------\nRecursive Common Table Expressions have been supported since MariaDB 10.2.2.\n\nCommon Table Expressions (CTEs) are a standard SQL feature, and are\nessentially temporary named result sets. CTEs first appeared in the SQL\nstandard in 1999, and the first implementations began appearing in 2007.\n\nThere are two kinds of CTEs:\n\n* Non-recursive\n* Recursive, which this article covers.\n\nSQL is generally poor at recursive structures.\n\nCTEs permit a query to reference itself. A recursive CTE will repeatedly\nexecute subsets of the data until it obtains the complete result set. This\nmakes it particularly useful for handing hierarchical or tree-structured data.\nmax_recursive_iterations avoids infinite loops.\n\nSyntax example\n--------------\n\nWITH RECURSIVE signifies a recursive CTE. It is given a name, followed by a\nbody (the main query) as follows:\n\nComputation\n-----------\n\nGiven the following structure:\n\nFirst execute the anchor part of the query:\n\nNext, execute the recursive part of the query:\n\nSummary so far\n--------------\n\nwith recursive R as (\n select anchor_data\n union [all]\n select recursive_part\n from R, ...\n)\nselect ...\n\n* Compute anchor_data\n* Compute recursive_part to get the new data\n* if (new data is non-empty) goto 2;\n\nCAST to avoid truncating data\n-----------------------------\n\nAs currently implemented by MariaDB and by the SQL Standard, data may be\ntruncated if not correctly cast. It is necessary to CAST the column to the\ncorrect width if the CTE\'s recursive part produces wider values for a column\nthan the CTE\'s nonrecursive part. Some other DBMS give an error in this\nsituation, and MariaDB\'s behavior may change in future - see MDEV-12325. See\nthe examples below.\n\nExamples\n--------\n\nTransitive closure - determining bus destinations\n-------------------------------------------------\n\nSample data:\n\nCREATE TABLE bus_routes (origin varchar(50), dst varchar(50));\nINSERT INTO bus_routes VALUES \n (\'New York\', \'Boston\'),\n (\'Boston\', \'New York\'),\n (\'New York\', \'Washington\'),\n (\'Washington\', \'Boston\'),\n (\'Washington\', \'Raleigh\');\n\nNow, we want to return the bus destinations with New York as the origin:\n\nWITH RECURSIVE bus_dst as ( \n SELECT origin as dst FROM bus_routes WHERE origin=\'New York\'\n UNION\n SELECT bus_routes.dst FROM bus_routes JOIN bus_dst ON bus_dst.dst=\nbus_routes.origin \n) \nSELECT * FROM bus_dst;\n+------------+\n| dst |\n+------------+\n| New York |\n| Boston |\n| Washington |\n| Raleigh |\n+------------+\n\nThe above example is computed as follows:\n\nFirst, the anchor data is calculated:\n\n* Starting from New York\n* Boston and Washington are added\n\nNext, the recursive part:\n\n* Starting from Boston and then Washington\n* Raleigh is added\n* UNION excludes nodes that are already present.\n\nComputing paths - determining bus routes\n----------------------------------------\n\nThis time, we are trying to get bus routes such as “New York -> Washington ->\nRaleigh”.\n\nUsing the same sample data as the previous example:\n\nWITH RECURSIVE paths (cur_path, cur_dest) AS (\n SELECT origin, origin FROM bus_routes WHERE origin=\'New York\'\n UNION\n SELECT CONCAT(paths.cur_path, \',\', bus_routes.dst), bus_routes.dst\n FROM paths\n JOIN bus_routes\n ON paths.cur_dest = bus_routes.origin AND\n NOT FIND_IN_SET(bus_routes.dst, paths.cur_path)\n) \nSELECT * FROM paths;\n+-----------------------------+------------+\n| cur_path | cur_dest |\n+-----------------------------+------------+\n| New York | New York |\n| New York,Boston | Boston |\n| New York,Washington | Washington |\n| New York,Washington,Boston | Boston |\n| New York,Washington,Raleigh | Raleigh |\n+-----------------------------+------------+\n\nCAST to avoid data truncation\n-----------------------------\n\nIn the following example, data is truncated because the results are not\nspecifically cast to a wide enough type:\n\nWITH RECURSIVE tbl AS (\n SELECT NULL AS col\n UNION\n SELECT "THIS NEVER SHOWS UP" AS col FROM tbl\n)\nSELECT col FROM tbl\n+------+\n| col |\n+------+\n| NULL |\n| |\n+------+\n\nExplicitly use CAST to overcome this:\n\nWITH RECURSIVE tbl AS (\n SELECT CAST(NULL AS CHAR(50)) AS col\n UNION SELECT "THIS NEVER SHOWS UP" AS col FROM tbl\n) \nSELECT * FROM tbl;\n+---------------------+\n| col |\n+---------------------+\n| NULL |\n| THIS NEVER SHOWS UP |\n+---------------------+\n\n\n\nURL: mariadb.com/kb/en/recursive-common-table-expressions-overview/','','https://mariadb.com/kb/en/recursive-common-table-expressions-overview/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (433,27,'REPLACE','Syntax\n------\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n {VALUES | VALUE} ({expr | DEFAULT},...),(...),...\n[RETURNING select_expr \n [, select_expr ...]]\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name [PARTITION (partition_list)]\n SET col={expr | DEFAULT}, ...\n[RETURNING select_expr \n [, select_expr ...]]\n\nOr:\n\nREPLACE [LOW_PRIORITY | DELAYED]\n [INTO] tbl_name [PARTITION (partition_list)] [(col,...)]\n SELECT ...\n[RETURNING select_expr \n [, select_expr ...]]\n\nDescription\n-----------\n\nREPLACE works exactly like INSERT, except that if an old row in the table has\nthe same value as a new row for a PRIMARY KEY or a UNIQUE index, the old row\nis deleted before the new row is inserted. If the table has more than one\nUNIQUE keys, it is possible that the new row conflicts with more than one row.\nIn this case, all conflicting rows will be deleted.\n\nThe table name can be specified in the form db_name.tbl_name or, if a default\ndatabase is selected, in the form tbl_name (see Identifier Qualifiers). This\nallows to use REPLACE ... SELECT to copy rows between different databases.\n\nMariaDB starting with 10.5.0\n----------------------------\nThe RETURNING clause was introduced in MariaDB 10.5.0\n\nBasically it works like this:\n\nBEGIN;\nSELECT 1 FROM t1 WHERE key=# FOR UPDATE;\nIF found-row\n DELETE FROM t1 WHERE key=# ;\nENDIF\nINSERT INTO t1 VALUES (...);\nEND;\n\nThe above can be replaced with:\n\nREPLACE INTO t1 VALUES (...)\n\nREPLACE is a MariaDB/MySQL extension to the SQL standard. It either inserts,\nor deletes and inserts. For other MariaDB/MySQL extensions to standard SQL ---\nthat also handle duplicate values --- see IGNORE and INSERT ON DUPLICATE KEY\nUPDATE.\n\nNote that unless the table has a PRIMARY KEY or UNIQUE index, using a REPLACE\nstatement makes no sense. It becomes equivalent to INSERT, because there is no\nindex to be used to determine whether a new row duplicates another.\n\nValues for all columns are taken from the values sSee Partition Pruning and\nSelection for details.pecified in the REPLACE statement. Any missing columns\nare set to their default values, just as happens for INSERT. You cannot refer\nto values from the current row and use them in the new row. If you use an\nassignment such as \'SET col = col + 1\', the reference to the column name on\nthe right hand side is treated as DEFAULT(col), so the assignment is\nequivalent to \'SET col = DEFAULT(col) + 1\'.\n\nTo use REPLACE, you must have both the INSERT and DELETE privileges for the\ntable.\n\nThere are some gotchas you should be aware of, before using REPLACE:\n\n* If there is an AUTO_INCREMENT field, a new value will be generated.\n* If there are foreign keys, ON DELETE action will be activated by REPLACE.\n* Triggers on DELETE and INSERT will be activated by REPLACE.\n\nTo avoid some of these behaviors, you can use INSERT ... ON DUPLICATE KEY\nUPDATE.\n\nThis statement activates INSERT and DELETE triggers. See Trigger Overview for\ndetails.\n\nPARTITION\n---------\n\nSee Partition Pruning and Selection for details.\n\nREPLACE RETURNING\n-----------------\n\nREPLACE ... RETURNING returns a resultset of the replaced rows.\n\nThis returns the listed columns for all the rows that are replaced, or\nalternatively, the specified SELECT expression. Any SQL expressions which can\nbe calculated can be used in the select expression for the RETURNING clause,\nincluding virtual columns and aliases, expressions which use various operators\nsuch as bitwise, logical and arithmetic operators, string functions, date-time\nfunctions, numeric functions, control flow functions, secondary functions and\nstored functions. Along with this, statements which have subqueries and\nprepared statements can also be used.\n\nExamples\n--------\n\nSimple REPLACE statement\n\nREPLACE INTO t2 VALUES (1,\'Leopard\'),(2,\'Dog\') RETURNING id2, id2+id2 \nas Total ,id2|id2, id2&&id2;\n+-----+-------+---------+----------+\n| id2 | Total | id2|id2 | id2&&id2 |\n+-----+-------+---------+----------+\n| 1 | 2 | 1 | 1 |\n| 2 | 4 | 2 | 1 |\n+-----+-------+---------+----------+\n\nUsing stored functions in RETURNING\n\nDELIMITER |\nCREATE FUNCTION f(arg INT) RETURNS INT\n BEGIN\n RETURN (SELECT arg+arg);\n END|\n\nDELIMITER ;\nPREPARE stmt FROM "REPLACE INTO t2 SET id2=3, animal2=\'Fox\' RETURNING f2(id2),\nUPPER(animal2)";\n\nEXECUTE stmt;\n+---------+----------------+\n| f2(id2) | UPPER(animal2) |\n+---------+----------------+\n| 6 | FOX |\n+---------+----------------+\n\nSubqueries in the statement\n\nREPLACE INTO t1 SELECT * FROM t2 RETURNING (SELECT id2 FROM t2 WHERE \nid2 IN (SELECT id2 FROM t2 WHERE id2=1)) AS new_id;\n+--------+\n| new_id |\n+--------+\n| 1 |\n| 1 |\n| 1 |\n| 1 |\n+--------+\n\nSubqueries in the RETURNING clause that return more than one row or column\ncannot be used..\n\nAggregate functions cannot be used in the RETURNING clause. Since aggregate\nfunctions work on a set of values and if the purpose is to get the row count,\nROW_COUNT() with SELECT can be used, or it can be used in REPLACE...SEL==\nDescription\n\nREPLACE ... RETURNING returns a resultset of the replaced rows.\n\nThis returns the listed columns for all the rows that are replaced, or\nalternatively, the specified SELECT expression. Any SQL expressions which can\nbe calculated can be used in the select expression for the RETURNING clause,\nincluding virtual columns and aliases, expressions which use various operators\nsuch as bitwise, logical and arithmetic operators, string functions, date-time\nfunctions, numeric functions, control flow functions, secondary functions and\nstored functions. Along with this, statements which have subqueries and\nprepared statements can also be used.\n\nExamples\n--------\n\nSimple REPLACE statement\n\nREPLACE INTO t2 VALUES (1,\'Leopard\'),(2,\'Dog\') RETURNING id2, id2+id2 \nas Total ,id2|id2, id2&&id2;\n+-----+-------+---------+----------+\n| id2 | Total | id2|id2 | id2&&id2 |\n+-----+-------+---------+----------+\n| 1 | 2 | 1 | 1 |\n| 2 | 4 | 2 | 1 |\n+-----+-------+---------+----------+\n\nUsing stored functions in RETURNING\n\nDELIMITER |\nCREATE FUNCTION f(arg INT) RETURNS INT\n BEGIN\n RETURN (SELECT arg+arg);\n END|\n\nDELIMITER ;\nPREPARE stmt FROM "REPLACE INTO t2 SET id2=3, animal2=\'Fox\' RETURNING f2(id2),\nUPPER(animal2)";\n\nEXECUTE stmt;\n+---------+----------------+\n| f2(id2) | UPPER(animal2) |\n+---------+----------------+\n| 6 | FOX |\n+---------+----------------+\n\nSubqueries in the statement\n\nREPLACE INTO t1 SELECT * FROM t2 RETURNING (SELECT id2 FROM t2 WHERE \nid2 IN (SELECT id2 FROM t2 WHERE id2=1)) AS new_id;\n+--------+\n| new_id |\n+--------+\n| 1 |\n| 1 |\n| 1 |\n| 1 |\n+--------+\n\nSubqueries in the RETURNING clause that return more than one row or column\ncannot be used..\n\nAggregate functions cannot be used in the RETURNING clause. Since aggregate\nfunctions work on a set of values and if the purpose is to get the row count,\nROW_COUNT() with SELECT can be used, or it can be used in\nREPLACE...SELECT...RETURNING if the table in the RETURNING clause is not the\nsame as the REPLACE table. ECT...RETURNING if the table in the RETURNING\nclause is not the same as the REPLACE table.\n\n\n\nURL: mariadb.com/kb/en/replace/','','https://mariadb.com/kb/en/replace/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (434,27,'SELECT','Syntax\n------\n\nSELECT\n [ALL | DISTINCT | DISTINCTROW]\n [HIGH_PRIORITY]\n [STRAIGHT_JOIN]\n [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]\n [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]\n select_expr [, select_expr ...]\n [ FROM table_references\n [WHERE where_condition]\n [GROUP BY {col_name | expr | position} [ASC | DESC], ... [WITH ROLLUP]]\n [HAVING where_condition]\n [ORDER BY {col_name | expr | position} [ASC | DESC], ...]\n [LIMIT {[offset,] row_count | row_count OFFSET offset [ROWS EXAMINED\nrows_limit] } |\n [OFFSET start { ROW | ROWS }]\n [FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } { ONLY | WITH TIES }]\n]\n procedure|[PROCEDURE procedure_name(argument_list)]\n [INTO OUTFILE \'file_name\' [CHARACTER SET charset_name] [export_options] |\n INTO DUMPFILE \'file_name\' | INTO var_name [, var_name] ]\n [FOR UPDATE lock_option | LOCK IN SHARE MODE lock_option]\nexport_options:\n [{FIELDS | COLUMNS}\n [TERMINATED BY \'string\']\n [[OPTIONALLY] ENCLOSED BY \'char\']\n [ESCAPED BY \'char\']\n ]\n [LINES\n [STARTING BY \'string\']\n [TERMINATED BY \'string\']\n ]\nlock_option:\n [WAIT n | NOWAIT | SKIP LOCKED]\n\nDescription\n-----------\n\nSELECT is used to retrieve rows selected from one or more tables, and can\ninclude UNION statements and subqueries.\n\n* Each select_expr expression indicates a column or data that you want to\nretrieve. You\nmust have at least one select expression. See Select Expressions below.\n\n* The FROM clause indicates the table or tables from which to retrieve rows.\nUse either a single table name or a JOIN expression. See JOIN\nfor details. If no table is involved, FROM DUAL can be specified.\n\n* Each table can also be specified as db_name.tabl_name. Each column can also\nbe specified as tbl_name.col_name or even db_name.tbl_name.col_name. This\nallows one to write queries which involve multiple databases. See Identifier\nQualifiers for syntax details.\n\n* The WHERE clause, if given, indicates the condition or\n conditions that rows must satisfy to be selected.\n where_condition is an expression that evaluates to true for\n each row to be selected. The statement selects all rows if there is no WHERE\n clause.\nIn the WHERE clause, you can use any of the functions and\n operators that MariaDB supports, except for aggregate (summary) functions.\nSee Functions and Operators and Functions and Modifiers for use with GROUP BY\n(aggregate).\n\n* Use the ORDER BY clause to order the results.\n\n* Use the LIMIT clause allows you to restrict the results to only\na certain number of rows, optionally with an offset.\n\n* Use the GROUP BY and HAVING clauses to group\nrows together when they have columns or computed values in common.\n\nSELECT can also be used to retrieve rows computed without reference to any\ntable.\n\nSelect Expressions\n------------------\n\nA SELECT statement must contain one or more select expressions, separated by\ncommas. Each select expression can be one of the following:\n\n* The name of a column.\n* Any expression using functions and operators.\n* * to select all columns from all tables in the FROM clause.\n* tbl_name.* to select all columns from just the table tbl_name.\n\nWhen specifying a column, you can either use just the column name or qualify\nthe column name with the name of the table using tbl_name.col_name. The\nqualified form is useful if you are joining multiple tables in the FROM\nclause. If you do not qualify the column names when selecting from multiple\ntables, MariaDB will try to find the column in each table. It is an error if\nthat column name exists in multiple tables.\n\nYou can quote column names using backticks. If you are qualifying column names\nwith table names, quote each part separately as `tbl_name`.`col_name`.\n\nIf you use any grouping functions in any of the select expressions, all rows\nin your results will be implicitly grouped, as if you had used GROUP BY NULL.\n\nDISTINCT\n--------\n\nA query may produce some identical rows. By default, all rows are retrieved,\neven when their values are the same. To explicitly specify that you want to\nretrieve identical rows, use the ALL option. If you want duplicates to be\nremoved from the resultset, use the DISTINCT option. DISTINCTROW is a synonym\nfor DISTINCT. See also COUNT DISTINCT and SELECT UNIQUE in Oracle mode.\n\nINTO\n----\n\nThe INTO clause is used to specify that the query results should be written to\na file or variable.\n\n* SELECT INTO OUTFILE - formatting and writing the result to an external file.\n* SELECT INTO DUMPFILE - binary-safe writing of the unformatted results to an\nexternal file.\n* SELECT INTO Variable - selecting and setting variables.\n\nThe reverse of SELECT INTO OUTFILE is LOAD DATA.\n\nLIMIT\n-----\n\nRestricts the number of returned rows. See LIMIT and LIMIT ROWS EXAMINED for\ndetails.\n\nLOCK IN SHARE MODE/FOR UPDATE\n-----------------------------\n\nSee LOCK IN SHARE MODE and FOR UPDATE for details on the respective locking\nclauses.\n\nOFFSET ... FETCH\n----------------\n\nMariaDB starting with 10.6\n--------------------------\nSee SELECT ... OFFSET ... FETCH.\n\nORDER BY\n--------\n\nOrder a resultset. See ORDER BY for details.\n\nPARTITION\n---------\n\nSpecifies to the optimizer which partitions are relevant for the query. Other\npartitions will not be read. See Partition Pruning and Selection for details.\n\nPROCEDURE\n---------\n\nPasses the whole result set to a C Procedure. See PROCEDURE and PROCEDURE\nANALYSE (the only built-in procedure not requiring the server to be\nrecompiled).\n\nSKIP LOCKED\n-----------\n\nMariaDB starting with 10.6\n--------------------------\nThe SKIP LOCKED clause was introduced in MariaDB 10.6.0.\n\nThis causes those rows that couldn\'t be locked (LOCK IN SHARE MODE or FOR\nUPDATE) to be excluded from the result set. An explicit NOWAIT is implied\nhere. This is only implemented on InnoDB tables and ignored otherwise.\n\nSQL_CALC_FOUND_ROWS\n-------------------\n\nWhen SQL_CALC_FOUND_ROWS is used, then MariaDB will calculate how many rows\nwould have been in the result, if there would be no LIMIT clause. The result\ncan be found by calling the function FOUND_ROWS() in your next sql statement.\n\nmax_statement_time clause\n-------------------------\n\nBy using max_statement_time in conjunction with SET STATEMENT, it is possible\nto limit the execution time of individual queries. For example:\n\nSET STATEMENT max_statement_time=100 FOR \n SELECT field1 FROM table_name ORDER BY field1;\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nExamples\n--------\n\nSELECT f1,f2 FROM t1 WHERE (f3<=10) AND (f4=\'y\');\n\nSee Getting Data from MariaDB (Beginner tutorial), or the various\nsub-articles, for more examples.\n\n\n\nURL: mariadb.com/kb/en/select/','','https://mariadb.com/kb/en/select/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (435,27,'SELECT INTO DUMPFILE','Syntax\n------\n\nSELECT ... INTO DUMPFILE \'file_path\'\n\nDescription\n-----------\n\nSELECT ... INTO DUMPFILE is a SELECT clause which writes the resultset into a\nsingle unformatted row, without any separators, in a file. The results will\nnot be returned to the client.\n\nfile_path can be an absolute path, or a relative path starting from the data\ndirectory. It can only be specified as a string literal, not as a variable.\nHowever, the statement can be dynamically composed and executed as a prepared\nstatement to work around this limitation.\n\nThis statement is binary-safe and so is particularly useful for writing BLOB\nvalues to file. It can be used, for example, to copy an image or an audio\ndocument from the database to a file. SELECT ... INTO FILE can be used to save\na text file.\n\nThe file must not exist. It cannot be overwritten. A user needs the FILE\nprivilege to run this statement. Also, MariaDB needs permission to write files\nin the specified location. If the secure_file_priv system variable is set to a\nnon-empty directory name, the file can only be written to that directory.\n\nSince MariaDB 5.1, the character_set_filesystem system variable has controlled\ninterpretation of file names that are given as literal strings.\n\nExample\n-------\n\nSELECT _utf8\'Hello world!\' INTO DUMPFILE \'/tmp/world\';\n\nSELECT LOAD_FILE(\'/tmp/world\') AS world;\n+--------------+\n| world |\n+--------------+\n| Hello world! |\n+--------------+\n\n\n\nURL: mariadb.com/kb/en/select-into-dumpfile/','','https://mariadb.com/kb/en/select-into-dumpfile/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (436,27,'SELECT INTO OUTFILE','Syntax\n------\n\nSELECT ... INTO OUTFILE \'file_name\'\n [CHARACTER SET charset_name]\n [export_options]\n\nexport_options:\n [{FIELDS | COLUMNS}\n [TERMINATED BY \'string\']\n [[OPTIONALLY] ENCLOSED BY \'char\']\n [ESCAPED BY \'char\']\n ]\n [LINES\n [STARTING BY \'string\']\n [TERMINATED BY \'string\']\n ]\n\nDescription\n-----------\n\nSELECT INTO OUTFILE writes the resulting rows to a file, and allows the use of\ncolumn and row terminators to specify a particular output format. The default\nis to terminate fields with tabs (\t) and lines with newlines (\n).\n\nThe file must not exist. It cannot be overwritten. A user needs the FILE\nprivilege to run this statement. Also, MariaDB needs permission to write files\nin the specified location. If the secure_file_priv system variable is set to a\nnon-empty directory name, the file can only be written to that directory.\n\nThe LOAD DATA INFILE statement complements SELECT INTO OUTFILE.\n\nCharacter-sets\n--------------\n\nThe CHARACTER SET clause specifies the character set in which the results are\nto be written. Without the clause, no conversion takes place (the binary\ncharacter set). In this case, if there are multiple character sets, the output\nwill contain these too, and may not easily be able to be reloaded.\n\nIn cases where you have two servers using different character-sets, using\nSELECT INTO OUTFILE to transfer data from one to the other can have unexpected\nresults. To ensure that MariaDB correctly interprets the escape sequences, use\nthe CHARACTER SET clause on both the SELECT INTO OUTFILE statement and the\nsubsequent LOAD DATA INFILE statement.\n\nExample\n-------\n\nThe following example produces a file in the CSV format:\n\nSELECT customer_id, firstname, surname INTO OUTFILE \'/exportdata/customers.txt\'\n FIELDS TERMINATED BY \',\' OPTIONALLY ENCLOSED BY \'"\'\n LINES TERMINATED BY \'\n\'\n FROM customers;\n\n\n\nURL: mariadb.com/kb/en/select-into-outfile/','','https://mariadb.com/kb/en/select-into-outfile/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (437,27,'SELECT WITH ROLLUP','Syntax\n------\n\nSee SELECT for the full syntax.\n\nDescription\n-----------\n\nThe WITH ROLLUP modifier adds extra rows to the resultset that represent\nsuper-aggregate summaries. The super-aggregated column is represented by a\nNULL value. Multiple aggregates over different columns will be added if there\nare multiple GROUP BY columns.\n\nThe LIMIT clause can be used at the same time, and is applied after the WITH\nROLLUP rows have been added.\n\nWITH ROLLUP cannot be used with ORDER BY. Some sorting is still possible by\nusing ASC or DESC clauses with the GROUP BY column, although the\nsuper-aggregate rows will always be added last.\n\nExamples\n--------\n\nThese examples use the following sample table\n\nCREATE TABLE booksales ( \n country VARCHAR(35), genre ENUM(\'fiction\',\'non-fiction\'), year YEAR, sales\nINT);\n\nINSERT INTO booksales VALUES\n (\'Senegal\',\'fiction\',2014,12234), (\'Senegal\',\'fiction\',2015,15647),\n (\'Senegal\',\'non-fiction\',2014,64980), (\'Senegal\',\'non-fiction\',2015,78901),\n (\'Paraguay\',\'fiction\',2014,87970), (\'Paraguay\',\'fiction\',2015,76940),\n (\'Paraguay\',\'non-fiction\',2014,8760), (\'Paraguay\',\'non-fiction\',2015,9030);\n\nThe addition of the WITH ROLLUP modifier in this example adds an extra row\nthat aggregates both years:\n\nSELECT year, SUM(sales) FROM booksales GROUP BY year;\n+------+------------+\n| year | SUM(sales) |\n+------+------------+\n| 2014 | 173944 |\n| 2015 | 180518 |\n+------+------------+\n2 rows in set (0.08 sec)\n\nSELECT year, SUM(sales) FROM booksales GROUP BY year WITH ROLLUP;\n+------+------------+\n| year | SUM(sales) |\n+------+------------+\n| 2014 | 173944 |\n| 2015 | 180518 |\n| NULL | 354462 |\n+------+------------+\n\nIn the following example, each time the genre, the year or the country change,\nanother super-aggregate row is added:\n\nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year, genre;\n+----------+------+-------------+------------+\n| country | year | genre | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2014 | fiction | 87970 |\n| Paraguay | 2014 | non-fiction | 8760 |\n| Paraguay | 2015 | fiction | 76940 |\n| Paraguay | 2015 | non-fiction | 9030 |\n| Senegal | 2014 | fiction | 12234 |\n| Senegal | 2014 | non-fiction | 64980 |\n| Senegal | 2015 | fiction | 15647 |\n| Senegal | 2015 | non-fiction | 78901 |\n+----------+------+-------------+------------+\n\nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year, genre WITH ROLLUP;\n+----------+------+-------------+------------+\n| country | year | genre | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2014 | fiction | 87970 |\n| Paraguay | 2014 | non-fiction | 8760 |\n| Paraguay | 2014 | NULL | 96730 |\n| Paraguay | 2015 | fiction | 76940 |\n| Paraguay | 2015 | non-fiction | 9030 |\n| Paraguay | 2015 | NULL | 85970 |\n| Paraguay | NULL | NULL | 182700 |\n| Senegal | 2014 | fiction | 12234 |\n| Senegal | 2014 | non-fiction | 64980 |\n| Senegal | 2014 | NULL | 77214 |\n| Senegal | 2015 | fiction | 15647 |\n| Senegal | 2015 | non-fiction | 78901 |\n| Senegal | 2015 | NULL | 94548 |\n| Senegal | NULL | NULL | 171762 |\n| NULL | NULL | NULL | 354462 |\n+----------+------+-------------+------------+\n\nThe LIMIT clause, applied after WITH ROLLUP:\n\nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year, genre WITH ROLLUP LIMIT 4;\n+----------+------+-------------+------------+\n| country | year | genre | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2014 | fiction | 87970 |\n| Paraguay | 2014 | non-fiction | 8760 |\n| Paraguay | 2014 | NULL | 96730 |\n| Paraguay | 2015 | fiction | 76940 |\n+----------+------+-------------+------------+\n\nSorting by year descending:\n\nSELECT country, year, genre, SUM(sales) \n FROM booksales GROUP BY country, year DESC, genre WITH ROLLUP;\n+----------+------+-------------+------------+\n| country | year | genre | SUM(sales) |\n+----------+------+-------------+------------+\n| Paraguay | 2015 | fiction | 76940 |\n| Paraguay | 2015 | non-fiction | 9030 |\n| Paraguay | 2015 | NULL | 85970 |\n| Paraguay | 2014 | fiction | 87970 |\n| Paraguay | 2014 | non-fiction | 8760 |\n| Paraguay | 2014 | NULL | 96730 |\n| Paraguay | NULL | NULL | 182700 |\n| Senegal | 2015 | fiction | 15647 |\n| Senegal | 2015 | non-fiction | 78901 |\n| Senegal | 2015 | NULL | 94548 |\n| Senegal | 2014 | fiction | 12234 |\n| Senegal | 2014 | non-fiction | 64980 |\n| Senegal | 2014 | NULL | 77214 |\n| Senegal | NULL | NULL | 171762 |\n| NULL | NULL | NULL | 354462 |\n+----------+------+-------------+------------+\n\n\n\nURL: mariadb.com/kb/en/select-with-rollup/','','https://mariadb.com/kb/en/select-with-rollup/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (438,27,'UNION','UNION is used to combine the results from multiple SELECT statements\ninto a single result set.\n\nSyntax\n------\n\nSELECT ...\nUNION [ALL | DISTINCT] SELECT ...\n[UNION [ALL | DISTINCT] SELECT ...]\n[ORDER BY [column [, column ...]]]\n[LIMIT {[offset,] row_count | row_count OFFSET offset}]\n\nDescription\n-----------\n\nUNION is used to combine the results from multiple SELECT statements into a\nsingle result set.\n\nThe column names from the first SELECT statement are used as the column names\nfor the results returned. Selected columns listed in corresponding positions\nof each SELECT statement should have the same data type. (For example, the\nfirst column selected by the first statement should have the same type as the\nfirst column selected by the other statements.)\n\nIf they don\'t, the type and length of the columns in the result take into\naccount the values returned by all of the SELECTs, so there is no need for\nexplicit casting. Note that currently this is not the case for recursive CTEs\n- see MDEV-12325.\n\nTable names can be specified as db_name.tbl_name. This permits writing UNIONs\nwhich involve multiple databases. See Identifier Qualifiers for syntax details.\n\nUNION queries cannot be used with aggregate functions.\n\nEXCEPT and UNION have the same operation precedence and INTERSECT has a higher\nprecedence, unless running in Oracle mode, in which case all three have the\nsame precedence.\n\nALL/DISTINCT\n------------\n\nThe ALL keyword causes duplicate rows to be preserved. The DISTINCT keyword\n(the default if the keyword is omitted) causes duplicate rows to be removed by\nthe results.\n\nUNION ALL and UNION DISTINCT can both be present in a query. In this case,\nUNION DISTINCT will override any UNION ALLs to its left.\n\nMariaDB starting with 10.1.1\n----------------------------\nUntil MariaDB 10.1.1, all UNION ALL statements required the server to create a\ntemporary table. Since MariaDB 10.1.1, the server can in most cases execute\nUNION ALL without creating a temporary table, improving performance (see\nMDEV-334).\n\nORDER BY and LIMIT\n------------------\n\nIndividual SELECTs can contain their own ORDER BY and LIMIT clauses. In this\ncase, the individual queries need to be wrapped between parentheses. However,\nthis does not affect the order of the UNION, so they only are useful to limit\nthe record read by one SELECT.\n\nThe UNION can have global ORDER BY and LIMIT clauses, which affect the whole\nresultset. If the columns retrieved by individual SELECT statements have an\nalias (AS), the ORDER BY must use that alias, not the real column names.\n\nHIGH_PRIORITY\n-------------\n\nSpecifying a query as HIGH_PRIORITY will not work inside a UNION. If applied\nto the first SELECT, it will be ignored. Applying to a later SELECT results in\na syntax error:\n\nERROR 1234 (42000): Incorrect usage/placement of \'HIGH_PRIORITY\'\n\nSELECT ... INTO ...\n-------------------\n\nIndividual SELECTs cannot be written INTO DUMPFILE or INTO OUTFILE. If the\nlast SELECT statement specifies INTO DUMPFILE or INTO OUTFILE, the entire\nresult of the UNION will be written. Placing the clause after any other SELECT\nwill result in a syntax error.\n\nIf the result is a single row, SELECT ... INTO @var_name can also be used.\n\nMariaDB starting with 10.4.0\n----------------------------\n\nParentheses\n-----------\n\nFrom MariaDB 10.4.0, parentheses can be used to specify precedence. Before\nthis, a syntax error would be returned.\n\nExamples\n--------\n\nUNION between tables having different column names:\n\n(SELECT e_name AS name, email FROM employees)\nUNION\n(SELECT c_name AS name, email FROM customers);\n\nSpecifying the UNION\'s global order and limiting total rows:\n\n(SELECT name, email FROM employees)\nUNION\n(SELECT name, email FROM customers)\nORDER BY name LIMIT 10;\n\nAdding a constant row:\n\n(SELECT \'John Doe\' AS name, \'john.doe@example.net\' AS email)\nUNION\n(SELECT name, email FROM customers);\n\nDiffering types:\n\nSELECT CAST(\'x\' AS CHAR(1)) UNION SELECT REPEAT(\'y\',4);\n+----------------------+\n| CAST(\'x\' AS CHAR(1)) |\n+----------------------+\n| x |\n| yyyy |\n+----------------------+\n\nReturning the results in order of each individual SELECT by use of a sort\ncolumn:\n\n(SELECT 1 AS sort_column, e_name AS name, email FROM employees)\nUNION\n(SELECT 2, c_name AS name, email FROM customers) ORDER BY sort_column;\n\nDifference between UNION, EXCEPT and INTERSECT. INTERSECT ALL and EXCEPT ALL\nare available from MariaDB 10.5.0.\n\nCREATE TABLE seqs (i INT);\nINSERT INTO seqs VALUES (1),(2),(2),(3),(3),(4),(5),(6);\n\nSELECT i FROM seqs WHERE i <= 3 UNION SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n| 3 |\n| 4 |\n| 5 |\n| 6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 UNION ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n| 2 |\n| 3 |\n| 3 |\n| 3 |\n| 3 |\n| 4 |\n| 5 |\n| 6 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 EXCEPT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 1 |\n| 2 |\n| 2 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 3 |\n+------+\n\nSELECT i FROM seqs WHERE i <= 3 INTERSECT ALL SELECT i FROM seqs WHERE i>=3;\n+------+\n| i |\n+------+\n| 3 |\n| 3 |\n+------+\n\nParentheses for specifying precedence, from MariaDB 10.4.0\n\nCREATE OR REPLACE TABLE t1 (a INT);\nCREATE OR REPLACE TABLE t2 (b INT);\nCREATE OR REPLACE TABLE t3 (c INT);\n\nINSERT INTO t1 VALUES (1),(2),(3),(4);\nINSERT INTO t2 VALUES (5),(6);\nINSERT INTO t3 VALUES (1),(6);\n\n((SELECT a FROM t1) UNION (SELECT b FROM t2)) INTERSECT (SELECT c FROM t3);\n+------+\n| a |\n+------+\n| 1 |\n| 6 |\n+------+\n\n(SELECT a FROM t1) UNION ((SELECT b FROM t2) INTERSECT (SELECT c FROM t3));\n+------+\n| a |\n+------+\n| 1 |\n| 2 |\n| 3 |\n| 4 |\n| 6 |\n+------+\n\n\n\nURL: mariadb.com/kb/en/union/','','https://mariadb.com/kb/en/union/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (439,27,'UPDATE','Syntax\n------\n\nSingle-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_reference \n [PARTITION (partition_list)]\n [FOR PORTION OF period FROM expr1 TO expr2]\n SET col1={expr1|DEFAULT} [,col2={expr2|DEFAULT}] ...\n [WHERE where_condition]\n [ORDER BY ...]\n [LIMIT row_count]\n\nMultiple-table syntax:\n\nUPDATE [LOW_PRIORITY] [IGNORE] table_references\n SET col1={expr1|DEFAULT} [, col2={expr2|DEFAULT}] ...\n [WHERE where_condition]\n\nDescription\n-----------\n\nFor the single-table syntax, the UPDATE statement updates columns of existing\nrows in the named table with new values. The SET clause indicates which\ncolumns to modify and the values they should be given. Each value can be given\nas an expression, or the keyword DEFAULT to set a column explicitly to its\ndefault value. The WHERE clause, if given, specifies the conditions that\nidentify which rows to update. With no WHERE clause, all rows are updated. If\nthe ORDER BY clause is specified, the rows are updated in the order that is\nspecified. The LIMIT clause places a limit on the number of rows that can be\nupdated.\n\nUntil MariaDB 10.3.2, for the multiple-table syntax, UPDATE updates rows in\neach table named in table_references that satisfy the conditions. In this\ncase, ORDER BY and LIMIT cannot be used. This restriction was lifted in\nMariaDB 10.3.2 and both clauses can be used with multiple-table updates. An\nUPDATE can also reference tables which are located in different databases; see\nIdentifier Qualifiers for the syntax.\n\nwhere_condition is an expression that evaluates to true for each row to be\nupdated.\n\ntable_references and where_condition are as specified as described in SELECT.\n\nFor single-table updates, assignments are evaluated in left-to-right order,\nwhile for multi-table updates, there is no guarantee of a particular order. If\nthe SIMULTANEOUS_ASSIGNMENT sql_mode (available from MariaDB 10.3.5) is set,\nUPDATE statements evaluate all assignments simultaneously.\n\nYou need the UPDATE privilege only for columns referenced in an UPDATE that\nare actually updated. You need only the SELECT privilege for any columns that\nare read but not modified. See GRANT.\n\nThe UPDATE statement supports the following modifiers:\n\n* If you use the LOW_PRIORITY keyword, execution of\n the UPDATE is delayed until no other clients are reading from\n the table. This affects only storage engines that use only table-level\n locking (MyISAM, MEMORY, MERGE). See HIGH_PRIORITY and LOW_PRIORITY clauses\nfor details.\n* If you use the IGNORE keyword, the update statement does \n not abort even if errors occur during the update. Rows for which\n duplicate-key conflicts occur are not updated. Rows for which columns are\n updated to values that would cause data conversion errors are updated to the\n closest valid values instead.\n\nPARTITION\n---------\n\nSee Partition Pruning and Selection for details.\n\nFOR PORTION OF\n--------------\n\nMariaDB starting with 10.4.3\n----------------------------\nSee Application Time Periods - Updating by Portion.\n\nUPDATE Statements With the Same Source and Target\n-------------------------------------------------\n\nMariaDB starting with 10.3.2\n----------------------------\nFrom MariaDB 10.3.2, UPDATE statements may have the same source and target.\n\nFor example, given the following table:\n\nDROP TABLE t1;\nCREATE TABLE t1 (c1 INT, c2 INT);\nINSERT INTO t1 VALUES (10,10), (20,20);\n\nUntil MariaDB 10.3.1, the following UPDATE statement would not work:\n\nUPDATE t1 SET c1=c1+1 WHERE c2=(SELECT MAX(c2) FROM t1);\nERROR 1093 (HY000): Table \'t1\' is specified twice, \n both as a target for \'UPDATE\' and as a separate source for data\n\nFrom MariaDB 10.3.2, the statement executes successfully:\n\nUPDATE t1 SET c1=c1+1 WHERE c2=(SELECT MAX(c2) FROM t1);\n\nSELECT * FROM t1;\n+------+------+\n| c1 | c2 |\n+------+------+\n| 10 | 10 |\n| 21 | 20 |\n+------+------+\n\nExample\n-------\n\nSingle-table syntax:\n\nUPDATE table_name SET column1 = value1, column2 = value2 WHERE id=100;\n\nMultiple-table syntax:\n\nUPDATE tab1, tab2 SET tab1.column1 = value1, tab1.column2 = value2 WHERE\ntab1.id = tab2.id;\n\n\n\nURL: mariadb.com/kb/en/update/','','https://mariadb.com/kb/en/update/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (440,27,'WITH','MariaDB starting with 10.2.1\n----------------------------\nCommon Table Expressions were introduced in MariaDB 10.2.1.\n\nSyntax\n------\n\nWITH [RECURSIVE] table_reference [(columns_list)] AS (\n SELECT ...\n)\n[CYCLE cycle_column_list RESTRICT]\nSELECT ...\n\nDescription\n-----------\n\nThe WITH keyword signifies a Common Table Expression (CTE). It allows you to\nrefer to a subquery expression many times in a query, as if having a temporary\ntable that only exists for the duration of a query.\n\nThere are two kinds of CTEs:\n\n* Non-Recursive\n* Recursive (signified by the RECURSIVE keyword, supported since MariaDB\n10.2.2)\n\nYou can use table_reference as any normal table in the external SELECT part.\nYou can also use WITH in subqueries, as well as with EXPLAIN and SELECT.\n\nPoorly-formed recursive CTEs can in theory cause infinite loops. The\nmax_recursive_iterations system variable limits the number of recursions.\n\nCYCLE ... RESTRICT\n------------------\n\nMariaDB starting with 10.5.2\n----------------------------\nThe CYCLE clause enables CTE cycle detection, avoiding excessive or infinite\nloops, MariaDB supports a relaxed, non-standard grammar.\n\nThe SQL Standard permits a CYCLE clause, as follows:\n\nWITH RECURSIVE ... (\n ...\n)\nCYCLE <cycle column list>\nSET <cycle mark column> TO <cycle mark value> DEFAULT <non-cycle mark value>\nUSING <path column>\n\nwhere all clauses are mandatory.\n\nMariaDB does not support this, but from 10.5.2 permits a non-standard relaxed\ngrammar, as follows:\n\nWITH RECURSIVE ... (\n ...\n)\nCYCLE <cycle column list> RESTRICT\n\nWith the use of CYCLE ... RESTRICT it makes no difference whether the CTE uses\nUNION ALL or UNION DISTINCT anymore. UNION ALL means "all rows, but without\ncycles", which is exactly what the CYCLE clause enables. And UNION DISTINCT\nmeans all rows should be different, which, again, is what will happen — as\nuniqueness is enforced over a subset of columns, complete rows will\nautomatically all be different.\n\nExamples\n--------\n\nBelow is an example with the WITH at the top level:\n\nWITH t AS (SELECT a FROM t1 WHERE b >= \'c\') \n SELECT * FROM t2, t WHERE t2.c = t.a;\n\nThe example below uses WITH in a subquery:\n\nSELECT t1.a, t1.b FROM t1, t2\n WHERE t1.a > t2.c\n AND t2.c IN(WITH t AS (SELECT * FROM t1 WHERE t1.a < 5)\n SELECT t2.c FROM t2, t WHERE t2.c = t.a);\n\nBelow is an example of a Recursive CTE:\n\nWITH RECURSIVE ancestors AS \n ( SELECT * FROM folks\n WHERE name="Alex"\n UNION\n SELECT f.*\n FROM folks AS f, ancestors AS a\n WHERE f.id = a.father OR f.id = a.mother )\nSELECT * FROM ancestors;\n\nTake the following structure, and data,\n\nCREATE TABLE t1 (from_ int, to_ int);\nINSERT INTO t1 VALUES (1,2), (1,100), (2,3), (3,4), (4,1);\nSELECT * FROM t1;\n+-------+------+\n| from_ | to_ |\n+-------+------+\n| 1 | 2 |\n| 1 | 100 |\n| 2 | 3 |\n| 3 | 4 |\n| 4 | 1 |\n+-------+------+\n\nGiven the above, the following query would theoretically result in an infinite\nloop due to the last record in t1 (note that max_recursive_iterations is set\nto 10 for the purposes of this example, to avoid the excessive number of\ncycles):\n\nSET max_recursive_iterations=10;\n\nWITH RECURSIVE cte (depth, from_, to_) AS ( \n SELECT 0,1,1 UNION DISTINCT SELECT depth+1, t1.from_, t1.to_\n FROM t1, cte WHERE t1.from_ = cte.to_\n) \nSELECT * FROM cte;\n+-------+-------+------+\n| depth | from_ | to_ |\n+-------+-------+------+\n| 0 | 1 | 1 |\n| 1 | 1 | 2 |\n| 1 | 1 | 100 |\n| 2 | 2 | 3 |\n| 3 | 3 | 4 |\n| 4 | 4 | 1 |\n| 5 | 1 | 2 |\n| 5 | 1 | 100 |\n| 6 | 2 | 3 |\n| 7 | 3 | 4 |\n| 8 | 4 | 1 |\n| 9 | 1 | 2 |\n| 9 | 1 | 100 |\n| 10 | 2 | 3 |\n+-------+-------+------+\n\nHowever, the CYCLE ... RESTRICT clause (from MariaDB 10.5.2) can overcome this:\n\nWITH RECURSIVE cte (depth, from_, to_) AS ( \n SELECT 0,1,1 UNION SELECT depth+1, t1.from_, t1.to_\n FROM t1, cte WHERE t1.from_ = cte.to_\n) \nCYCLE from_, to_ RESTRICT \nSELECT * FROM cte;\n+-------+-------+------+\n| depth | from_ | to_ |\n+-------+-------+------+\n| 0 | 1 | 1 |\n| 1 | 1 | 2 |\n| 1 | 1 | 100 |\n| 2 | 2 | 3 |\n| 3 | 3 | 4 |\n| 4 | 4 | 1 |\n+-------+-------+------+\n\n\n\nURL: mariadb.com/kb/en/with/','','https://mariadb.com/kb/en/with/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (441,28,'DESCRIBE','Syntax\n------\n\n{DESCRIBE | DESC} tbl_name [col_name | wild]\n\nDescription\n-----------\n\nDESCRIBE provides information about the columns in a table. It is a shortcut\nfor SHOW COLUMNS FROM. These statements also display information for views.\n\ncol_name can be a column name, or a string containing the SQL "%" and "_"\nwildcard characters to obtain output only for the columns with names matching\nthe string. There is no need to enclose the string within quotes unless it\ncontains spaces or other special characters.\n\nDESCRIBE city;\n+------------+----------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+------------+----------+------+-----+---------+----------------+\n| Id | int(11) | NO | PRI | NULL | auto_increment |\n| Name | char(35) | YES | | NULL | |\n| Country | char(3) | NO | UNI | | |\n| District | char(20) | YES | MUL | | |\n| Population | int(11) | YES | | NULL | |\n+------------+----------+------+-----+---------+----------------+\n\nThe description for SHOW COLUMNS provides more information about the output\ncolumns.\n\n\n\nURL: mariadb.com/kb/en/describe/','','https://mariadb.com/kb/en/describe/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (442,28,'EXPLAIN','Syntax\n------\n\nEXPLAIN tbl_name [col_name | wild]\n\nOr\n\nEXPLAIN [EXTENDED | PARTITIONS | FORMAT=JSON] \n {SELECT select_options | UPDATE update_options | DELETE delete_options}\n\nDescription\n-----------\n\nThe EXPLAIN statement can be used either as a synonym for DESCRIBE or as a way\nto obtain information about how MariaDB executes a SELECT, UPDATE or DELETE\nstatement:\n\n* \'EXPLAIN tbl_name\' is synonymous with \n \'DESCRIBE tbl_name\' or\n \'SHOW COLUMNS FROM tbl_name\'.\n* When you precede a SELECT, UPDATE or a DELETE statement with the keyword \n EXPLAIN, MariaDB displays information from the optimizer\n about the query execution plan. That is, MariaDB explains how it would\n process the SELECT, UPDATE or DELETE, including information about how tables\n are joined and in which order. EXPLAIN EXTENDED can be\n used to provide additional information.\n* EXPLAIN PARTITIONS is useful only when examining queries involving\npartitioned tables. For details, see Partition pruning and selection.\n* ANALYZE statement performs the query as well as producing EXPLAIN output,\nand provides actual as well as estimated statistics.\n* EXPLAIN output can be printed in the slow query log. See EXPLAIN in the Slow\nQuery Log for details.\n\nSHOW EXPLAIN shows the output of a running statement. In some cases, its\noutput can be closer to reality than EXPLAIN.\n\nThe ANALYZE statement runs a statement and returns information about its\nexecution plan. It also shows additional columns, to check how much the\noptimizer\'s estimation about filtering and found rows are close to reality.\n\nThere is an online EXPLAIN Analyzer that you can use to share EXPLAIN and\nEXPLAIN EXTENDED output with others.\n\nEXPLAIN can acquire metadata locks in the same way that SELECT does, as it\nneeds to know table metadata and, sometimes, data as well.\n\nColumns in EXPLAIN ... SELECT\n-----------------------------\n\n+--------------------------------------+--------------------------------------+\n| Column name | Description |\n+--------------------------------------+--------------------------------------+\n| id | Sequence number that shows in which |\n| | order tables are joined. |\n+--------------------------------------+--------------------------------------+\n| select_type | What kind of SELECT the table comes |\n| | from. |\n+--------------------------------------+--------------------------------------+\n| table | Alias name of table. Materialized |\n| | temporary tables for sub queries |\n| | are named <subquery#> |\n+--------------------------------------+--------------------------------------+\n| type | How rows are found from the table |\n| | (join type). |\n+--------------------------------------+--------------------------------------+\n| possible_keys | keys in table that could be used to |\n| | find rows in the table |\n+--------------------------------------+--------------------------------------+\n| key | The name of the key that is used to |\n| | retrieve rows. NULL is no key was |\n| | used. |\n+--------------------------------------+--------------------------------------+\n| key_len | How many bytes of the key that was |\n| | used (shows if we are using only |\n| | parts of the multi-column key). |\n+--------------------------------------+--------------------------------------+\n| ref | The reference that is used as the |\n| | key value. |\n+--------------------------------------+--------------------------------------+\n| rows | An estimate of how many rows we |\n| | will find in the table for each key |\n| | lookup. |\n+--------------------------------------+--------------------------------------+\n| Extra | Extra information about this join. |\n+--------------------------------------+--------------------------------------+\n\nHere are descriptions of the values for some of the more complex columns in\nEXPLAIN ... SELECT:\n\n"Select_type" Column\n--------------------\n\nThe select_type column can have the following values:\n\n+-----------------+-----------------------------------+-----------------------+\n| Value | Description | Comment |\n+-----------------+-----------------------------------+-----------------------+\n| DEPENDENT | The SUBQUERY is DEPENDENT. | |\n| SUBQUERY | | |\n+-----------------+-----------------------------------+-----------------------+\n| DEPENDENT UNION | The UNION is DEPENDENT. | |\n+-----------------+-----------------------------------+-----------------------+\n| DERIVED | The SELECT is DERIVED from the | |\n| | PRIMARY. | |\n+-----------------+-----------------------------------+-----------------------+\n| MATERIALIZED | The SUBQUERY is MATERIALIZED. | Materialized tables |\n| | | will be populated at |\n| | | first access and |\n| | | will be accessed by |\n| | | the primary key (= |\n| | | one key lookup). |\n| | | Number of rows in |\n| | | EXPLAIN shows the |\n| | | cost of populating |\n| | | the table |\n+-----------------+-----------------------------------+-----------------------+\n| PRIMARY | The SELECT is a PRIMARY one. | |\n+-----------------+-----------------------------------+-----------------------+\n| SIMPLE | The SELECT is a SIMPLE one. | |\n+-----------------+-----------------------------------+-----------------------+\n| SUBQUERY | The SELECT is a SUBQUERY of the | |\n| | PRIMARY. | |\n+-----------------+-----------------------------------+-----------------------+\n| UNCACHEABLE | The SUBQUERY is UNCACHEABLE. | |\n| SUBQUERY | | |\n+-----------------+-----------------------------------+-----------------------+\n| UNCACHEABLE | The UNION is UNCACHEABLE. | |\n| UNION | | |\n+-----------------+-----------------------------------+-----------------------+\n| UNION | The SELECT is a UNION of the | |\n| | PRIMARY. | |\n+-----------------+-----------------------------------+-----------------------+\n| UNION RESULT | The result of the UNION. | |\n+-----------------+-----------------------------------+-----------------------+\n| LATERAL DERIVED | The SELECT uses a Lateral | |\n| | Derived optimization | |\n+-----------------+-----------------------------------+-----------------------+\n\n"Type" Column\n-------------\n\nThis column contains information on how the table is accessed.\n\n+------------------------+----------------------------------------------------+\n| Value | Description |\n+------------------------+----------------------------------------------------+\n| ALL | A full table scan is done for the table (all rows |\n| | are read). This is bad if the table is large and |\n| | the table is joined against a previous table! |\n| | This happens when the optimizer could not find |\n| | any usable index to access rows. |\n+------------------------+----------------------------------------------------+\n| const | There is only one possibly matching row in the |\n| | table. The row is read before the optimization |\n| | phase and all columns in the table are treated as |\n| | constants. |\n+------------------------+----------------------------------------------------+\n| eq_ref | A unique index is used to find the rows. This is |\n| | the best possible plan to find the row. |\n+------------------------+----------------------------------------------------+\n| fulltext | A fulltext index is used to access the rows. |\n+------------------------+----------------------------------------------------+\n| index_merge | A \'range\' access is done for for several index |\n| | and the found rows are merged. The key column |\n| | shows which keys are used. |\n+------------------------+----------------------------------------------------+\n| index_subquery | This is similar as ref, but used for sub queries |\n| | that are transformed to key lookups. |\n+------------------------+----------------------------------------------------+\n| index | A full scan over the used index. Better than ALL |\n| | but still bad if index is large and the table is |\n| | joined against a previous table. |\n+------------------------+----------------------------------------------------+\n| range | The table will be accessed with a key over one or |\n| | more value ranges. |\n+------------------------+----------------------------------------------------+\n| ref_or_null | Like \'ref\' but in addition another search for the |\n| | \'null\' value is done if the first value was not |\n| | found. This happens usually with sub queries. |\n+------------------------+----------------------------------------------------+\n| ref | A non unique index or prefix of an unique index |\n| | is used to find the rows. Good if the prefix |\n| | doesn\'t match many rows. |\n+------------------------+----------------------------------------------------+\n| system | The table has 0 or 1 rows. |\n+------------------------+----------------------------------------------------+\n| unique_subquery | This is similar as eq_ref, but used for sub |\n| | queries that are transformed to key lookups |\n+------------------------+----------------------------------------------------+\n\n"Extra" Column\n--------------\n\nThis column consists of one or more of the following values, separated by \';\'\n\nNote that some of these values are detected after the optimization phase.\n\nThe optimization phase can do the following changes to the WHERE clause:\n\n* Add the expressions from the ON and USING clauses to the WHERE\n clause.\n* Constant propagation: If there is column=constant, replace all column\n instances with this constant.\n* Replace all columns from \'const\' tables with their values.\n* Remove the used key columns from the WHERE (as this will be tested as\n part of the key lookup).\n* Remove impossible constant sub expressions.\n For example WHERE \'(a=1 and a=2) OR b=1\' becomes \'b=1\'.\n* Replace columns with other columns that has identical values:\n Example: WHERE a=b and a=c may be treated\n as \'WHERE a=b and a=c and b=c\'.\n* Add extra conditions to detect impossible row conditions earlier. This\n happens mainly with OUTER JOIN where we in some cases add detection\n of NULL values in the WHERE (Part of \'Not exists\' optimization).\n This can cause an unexpected \'Using where\' in the Extra column.\n* For each table level we remove expressions that have already been tested when\n we read the previous row. Example: When joining tables t1 with t2\n using the following WHERE \'t1.a=1 and t1.a=t2.b\', we don\'t have to\n test \'t1.a=1\' when checking rows in t2 as we already know that this\n expression is true.\n\n+------------------------+----------------------------------------------------+\n| Value | Description |\n+------------------------+----------------------------------------------------+\n| const row not found | The table was a system table (a table with should |\n| | exactly one row), but no row was found. |\n+------------------------+----------------------------------------------------+\n| Distinct | If distinct optimization (remove duplicates) was |\n| | used. This is marked only for the last table in |\n| | the SELECT. |\n+------------------------+----------------------------------------------------+\n| Full scan on NULL key | The table is a part of the sub query and if the |\n| | value that is used to match the sub query will be |\n| | NULL, we will do a full table scan. |\n+------------------------+----------------------------------------------------+\n| Impossible HAVING | The used HAVING clause is always false so the |\n| | SELECT will return no rows. |\n+------------------------+----------------------------------------------------+\n| Impossible WHERE | The used WHERE clause is always false so the |\n| noticed after reading | SELECT will return no rows. This case was |\n| const tables. | detected after we had read all \'const\' tables and |\n| | used the column values as constant in the WHERE |\n| | clause. For example: WHERE const_column=5 and |\n| | const_column had a value of 4. |\n+------------------------+----------------------------------------------------+\n| Impossible WHERE | The used WHERE clause is always false so the |\n| | SELECT will return no rows. For example: WHERE 1=2 |\n+------------------------+----------------------------------------------------+\n| No matching min/max | During early optimization of MIN()/MAX() values |\n| row | it was detected that no row could match the WHERE |\n| | clause. The MIN()/MAX() function will return NULL. |\n+------------------------+----------------------------------------------------+\n| no matching row in | The table was a const table (a table with only |\n| const table | one possible matching row), but no row was found. |\n+------------------------+----------------------------------------------------+\n| No tables used | The SELECT was a sub query that did not use any |\n| | tables. For example a there was no FROM clause or |\n| | a FROM DUAL clause. |\n+------------------------+----------------------------------------------------+\n| Not exists | Stop searching after more row if we find one |\n| | single matching row. This optimization is used |\n| | with LEFT JOIN where one is explicitly searching |\n| | for rows that doesn\'t exists in the LEFT JOIN |\n| | TABLE. Example: SELECT * FROM t1 LEFT JOIN t2 on |\n| | (...) WHERE t2.not_null_column IS NULL. As |\n| | t2.not_null_column can only be NULL if there was |\n| | no matching row for on condition, we can stop |\n| | searching if we find a single matching row. |\n+------------------------+----------------------------------------------------+\n| Open_frm_only | For information_schema tables. Only the frm |\n| | (table definition file was opened) was opened for |\n| | each matching row. |\n+------------------------+----------------------------------------------------+\n| Open_full_table | For information_schema tables. A full table open |\n| | for each matching row is done to retrieve the |\n| | requested information. (Slow) |\n+------------------------+----------------------------------------------------+\n| Open_trigger_only | For information_schema tables. Only the trigger |\n| | file definition was opened for each matching row. |\n+------------------------+----------------------------------------------------+\n| Range checked for | This only happens when there was no good default |\n| each record (index | index to use but there may some index that could |\n| map: ...) | be used when we can treat all columns from |\n| | previous table as constants. For each row |\n| | combination the optimizer will decide which index |\n| | to use (if any) to fetch a row from this table. |\n| | This is not fast, but faster than a full table |\n| | scan that is the only other choice. The index map |\n| | is a bitmask that shows which index are |\n| | considered for each row condition. |\n+------------------------+----------------------------------------------------+\n| Scanned 0/1/all | For information_schema tables. Shows how many |\n| databases | times we had to do a directory scan. |\n+------------------------+----------------------------------------------------+\n| Select tables | All tables in the join was optimized away. This |\n| optimized away | happens when we are only using COUNT(*), MIN() |\n| | and MAX() functions in the SELECT and we where |\n| | able to replace all of these with constants. |\n+------------------------+----------------------------------------------------+\n| Skip_open_table | For information_schema tables. The queried table |\n| | didn\'t need to be opened. |\n+------------------------+----------------------------------------------------+\n| unique row not found | The table was detected to be a const table (a |\n| | table with only one possible matching row) during |\n| | the early optimization phase, but no row was |\n| | found. |\n+------------------------+----------------------------------------------------+\n| Using filesort | Filesort is needed to resolve the query. This |\n| | means an extra phase where we first collect all |\n| | columns to sort, sort them with a disk based |\n| | merge sort and then use the sorted set to |\n| | retrieve the rows in sorted order. If the column |\n| | set is small, we store all the columns in the |\n| | sort file to not have to go to the database to |\n| | retrieve them again. |\n+------------------------+----------------------------------------------------+\n| Using index | Only the index is used to retrieve the needed |\n| | information from the table. There is no need to |\n| | perform an extra seek to retrieve the actual |\n| | record. |\n+------------------------+----------------------------------------------------+\n| Using index condition | Like \'Using where\' but the where condition is |\n| | pushed down to the table engine for internal |\n| | optimization at the index level. |\n+------------------------+----------------------------------------------------+\n| Using index | Like \'Using index condition\' but in addition we |\n| condition(BKA) | use batch key access to retrieve rows. |\n+------------------------+----------------------------------------------------+\n| Using index for | The index is being used to resolve a GROUP BY or |\n| group-by | DISTINCT query. The rows are not read. This is |\n| | very efficient if the table has a lot of |\n| | identical index entries as duplicates are quickly |\n| | jumped over. |\n+------------------------+----------------------------------------------------+\n| Using intersect(...) | For index_merge joins. Shows which index are part |\n| | of the intersect. |\n+------------------------+----------------------------------------------------+\n| Using join buffer | We store previous row combinations in a row |\n| | buffer to be able to match each row against all |\n| | of the rows combinations in the join buffer at |\n| | one go. |\n+------------------------+----------------------------------------------------+\n| Using sort_union(...) | For index_merge joins. Shows which index are part |\n| | of the union. |\n+------------------------+----------------------------------------------------+\n| Using temporary | A temporary table is created to hold the result. |\n| | This typically happens if you are using GROUP BY, |\n| | DISTINCT or ORDER BY. |\n+------------------------+----------------------------------------------------+\n| Using where | A WHERE expression (in additional to the possible |\n| | key lookup) is used to check if the row should be |\n| | accepted. If you don\'t have \'Using where\' |\n| | together with a join type of ALL, you are |\n| | probably doing something wrong! |\n+------------------------+----------------------------------------------------+\n| Using where with | Like \'Using where\' but the where condition is |\n| pushed condition | pushed down to the table engine for internal |\n| | optimization at the row level. |\n+------------------------+----------------------------------------------------+\n| Using buffer | The UPDATE statement will first buffer the rows, |\n| | and then run the updates, rather than do updates |\n| | on the fly. See Using Buffer UPDATE Algorithm for |\n| | a detailed explanation. |\n+------------------------+----------------------------------------------------+\n\nEXPLAIN EXTENDED\n----------------\n\nThe EXTENDED keyword adds another column, filtered, to the output. This is a\npercentage estimate of the table rows that will be filtered by the condition.\n\nAn EXPLAIN EXTENDED will always throw a warning, as it adds extra Message\ninformation to a subsequent SHOW WARNINGS statement. This includes what the\nSELECT query would look like after optimizing and rewriting rules are applied\nand how the optimizer qualifies columns and tables.\n\nExamples\n--------\n\nAs synonym for DESCRIBE or SHOW COLUMNS FROM:\n\nDESCRIBE city;\n+------------+----------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+------------+----------+------+-----+---------+----------------+\n| Id | int(11) | NO | PRI | NULL | auto_increment |\n| Name | char(35) | YES | | NULL | |\n| Country | char(3) | NO | UNI | | |\n| District | char(20) | YES | MUL | | |\n| Population | int(11) | YES | | NULL | |\n+------------+----------+------+-----+---------+----------------+\n\nA simple set of examples to see how EXPLAIN can identify poor index usage:\n\nCREATE TABLE IF NOT EXISTS `employees_example` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `first_name` varchar(30) NOT NULL,\n `last_name` varchar(40) NOT NULL,\n `position` varchar(25) NOT NULL,\n `home_address` varchar(50) NOT NULL,\n `home_phone` varchar(12) NOT NULL,\n `employee_code` varchar(25) NOT NULL,\n PRIMARY KEY (`id`),\n UNIQUE KEY `employee_code` (`employee_code`),\n KEY `first_name` (`first_name`,`last_name`)\n) ENGINE=Aria;\n\nINSERT INTO `employees_example` (`first_name`, `last_name`, `position`,\n`home_address`, `home_phone`, `employee_code`)\n VALUES\n (\'Mustapha\', \'Mond\', \'Chief Executive Officer\', \'692 Promiscuous Plaza\',\n\'326-555-3492\', \'MM1\'),\n (\'Henry\', \'Foster\', \'Store Manager\', \'314 Savage Circle\', \'326-555-3847\',\n\'HF1\'),\n (\'Bernard\', \'Marx\', \'Cashier\', \'1240 Ambient Avenue\', \'326-555-8456\', \'BM1\'),\n (\'Lenina\', \'Crowne\', \'Cashier\', \'281 Bumblepuppy Boulevard\', \'328-555-2349\',\n\'LC1\'),\n (\'Fanny\', \'Crowne\', \'Restocker\', \'1023 Bokanovsky Lane\', \'326-555-6329\',\n\'FC1\'),\n (\'Helmholtz\', \'Watson\', \'Janitor\', \'944 Soma Court\', \'329-555-2478\', \'HW1\');\n\nSHOW INDEXES FROM employees_example;\n+-------------------+------------+---------------+--------------+--------------\n+-----------+-------------+----------+--------+------+------------+---------+--\n------------+\n| Table | Non_unique | Key_name | Seq_in_index | Column_name \n | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |\nIndex_comment |\n+-------------------+------------+---------------+--------------+--------------\n+-----------+-------------+----------+--------+------+------------+---------+--\n------------+\n| employees_example | 0 | PRIMARY | 1 | id \n | A | 7 | NULL | NULL | | BTREE | |\n |\n| employees_example | 0 | employee_code | 1 |\nemployee_code | A | 7 | NULL | NULL | | BTREE \n | | |\n| employees_example | 1 | first_name | 1 | first_name \n | A | NULL | NULL | NULL | | BTREE | |\n |\n| employees_example | 1 | first_name | 2 | last_name \n | A | NULL | NULL | NULL | | BTREE | |\n |\n+-------------------+------------+---------------+--------------+--------------\n+-----------+-------------+----------+--------+------+------------+---------+--\n------------+\n\nSELECT on a primary key:\n\nEXPLAIN SELECT * FROM employees_example WHERE id=1;\n+------+-------------+-------------------+-------+---------------+---------+---\n-----+-------+------+-------+\n| id | select_type | table | type | possible_keys | key |\nkey_len | ref | rows | Extra |\n+------+-------------+-------------------+-------+---------------+---------+---\n-----+-------+------+-------+\n| 1 | SIMPLE | employees_example | const | PRIMARY | PRIMARY | 4\n | const | 1 | |\n+------+-------------+-------------------+-------+---------------+---------+---\n-----+-------+------+-------+\n\nThe type is const, which means that only one possible result could be\nreturned. Now, returning the same record but searching by their phone number:\n\nEXPLAIN SELECT * FROM employees_example WHERE home_phone=\'326-555-3492\';\n+------+-------------+-------------------+------+---------------+------+-------\n-+------+------+-------------+\n| id | select_type | table | type | possible_keys | key |\nkey_len | ref | rows | Extra |\n+------+-------------+-------------------+------+---------------+------+-------\n-+------+------+-------------+\n| 1 | SIMPLE | employees_example | ALL | NULL | NULL | NULL \n | NULL | 6 | Using where |\n+------+-------------+-------------------+------+---------------+------+-------\n-+------+------+-------------+\n\nHere, the type is All, which means no index could be used. Looking at the rows\ncount, a full table scan (all six rows) had to be performed in order to\nretrieve the record. If it\'s a requirement to search by phone number, an index\nwill have to be created.\n\nSHOW EXPLAIN example:\n\nSHOW EXPLAIN FOR 1;\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n| id | select_type | table | type | possible_keys | key | key_len | ref |\nrows | Extra |\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n| 1 | SIMPLE | tbl | index | NULL | a | 5 | NULL |\n1000107 | Using index |\n+------+-------------+-------+-------+---------------+------+---------+------+-\n-------+-------------+\n1 row in set, 1 warning (0.00 sec)\n\nExample of ref_or_null Optimization\n-----------------------------------\n\nSELECT * FROM table_name\n WHERE key_column=expr OR key_column IS NULL;\n\nref_or_null is something that often happens when you use subqueries with NOT\nIN as then one has to do an extra check for NULL values if the first value\ndidn\'t have a matching row.\n\n\n\nURL: mariadb.com/kb/en/explain/','','https://mariadb.com/kb/en/explain/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (443,28,'EXPLAIN ANALYZE','The syntax for the EXPLAIN ANALYZE feature was changed to ANALYZE\nstatement, available since MariaDB 10.1.0. See ANALYZE statement.\n\n\n\nURL: mariadb.com/kb/en/explain-analyze/','','https://mariadb.com/kb/en/explain-analyze/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (444,28,'ANALYZE FORMAT=JSON','ANALYZE FORMAT=JSON is a mix of the EXPLAIN FORMAT=JSON and ANALYZE\nstatement features. The ANALYZE FORMAT=JSON $statement will execute\n$statement, and then print the output of EXPLAIN FORMAT=JSON, amended with\ndata from the query execution.\n\nBasic Execution Data\n--------------------\n\nYou can get the following also from tabular ANALYZE statement form:\n\n* r_rows is provided for any node that reads rows. It shows how many rows\nwere read, on average \n* r_filtered is provided whenever there is a condition that is checked. It\nshows the percentage of rows left after checking the condition.\n\nAdvanced Execution Data\n-----------------------\n\nThe most important data not available in the regular tabula ANALYZE statement\nare:\n\n* r_loops field. This shows how many times the node was executed. Most query\nplan elements have this field.\n* r_total_time_ms field. It shows how much time in total was spent executing\nthis node. If the node has subnodes, their execution time is included.\n* r_buffer_size field. Query plan nodes that make use of buffers report the\nsize of buffer that was was used.\n\nData About Individual Query Plan Nodes\n--------------------------------------\n\n* filesort node reports whether sorting was done with LIMIT n parameter, and\nhow many rows were in the sort result. \n* block-nl-join node has r_loops field, which allows to tell whether Using\njoin buffer was efficient \n* range-checked-for-each-record reports counters that show the result of the\ncheck. \n* expression-cache is used for subqueries, and it reports how many times the\ncache was used, and what cache hit ratio was.\n* union_result node has r_rows so one can see how many rows were produced\nafter UNION operation\n* and so forth\n\nUse Cases\n---------\n\nSee Examples of ANALYZE FORMAT=JSON.\n\n\n\nURL: mariadb.com/kb/en/analyze-format-json/','','https://mariadb.com/kb/en/analyze-format-json/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (445,28,'ANALYZE FORMAT=JSON Examples','Example #1\n----------\n\nCustomers who have ordered more than 1M goods.\n\nANALYZE FORMAT=JSON\nSELECT COUNT(*)\nFROM customer\nWHERE\n (SELECT SUM(o_totalprice) FROM orders WHERE o_custkey=c_custkey) > 1000*1000;\n\nThe query takes 40 seconds over cold cache\n\nEXPLAIN: {\n "query_block": {\n "select_id": 1,\n "r_loops": 1,\n "r_total_time_ms": 39872,\n "table": {\n "table_name": "customer",\n "access_type": "index",\n "key": "i_c_nationkey",\n "key_length": "5",\n "used_key_parts": ["c_nationkey"],\n "r_loops": 1,\n "rows": 150303,\n "r_rows": 150000,\n "r_total_time_ms": 270.3,\n "filtered": 100,\n "r_filtered": 60.691,\n "attached_condition": "((subquery#2) > <cache>((1000 * 1000)))",\n "using_index": true\n },\n "subqueries": [\n {\n "query_block": {\n "select_id": 2,\n "r_loops": 150000,\n "r_total_time_ms": 39531,\n "table": {\n "table_name": "orders",\n "access_type": "ref",\n "possible_keys": ["i_o_custkey"],\n "key": "i_o_custkey",\n "key_length": "5",\n "used_key_parts": ["o_custkey"],\n "ref": ["dbt3sf1.customer.c_custkey"],\n "r_loops": 150000,\n "rows": 7,\n "r_rows": 10,\n "r_total_time_ms": 39208,\n "filtered": 100,\n "r_filtered": 100\n }\n }\n }\n ]\n }\n}\nANALYZE shows that 39.2 seconds were spent in the subquery, which was executed\n150K times (for every row of outer table).\n\n\n\nURL: mariadb.com/kb/en/analyze-formatjson-examples/','','https://mariadb.com/kb/en/analyze-formatjson-examples/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (446,30,'CONTAINS','Syntax\n------\n\nContains(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether a geometry g1 completely contains geometry\ng2. CONTAINS() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_CONTAINS() uses object shapes.\n\nThis tests the opposite relationship to Within().\n\n\n\nURL: mariadb.com/kb/en/contains/','','https://mariadb.com/kb/en/contains/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (447,30,'CROSSES','Syntax\n------\n\nCrosses(g1,g2)\n\nDescription\n-----------\n\nReturns 1 if g1 spatially crosses g2. Returns NULL if g1 is a Polygon or a\nMultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise, returns 0.\n\nThe term spatially crosses denotes a spatial relation between two given\ngeometries that has the following properties:\n\n* The two geometries intersect\n* Their intersection results in a geometry that has a dimension that is one\n less than the maximum dimension of the two given geometries\n* Their intersection is not equal to either of the two given geometries\n\nCROSSES() is based on the original MySQL implementation, and uses object\nbounding rectangles, while ST_CROSSES() uses object shapes.\n\n\n\nURL: mariadb.com/kb/en/crosses/','','https://mariadb.com/kb/en/crosses/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (448,30,'DISJOINT','Syntax\n------\n\nDisjoint(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether g1 is spatially disjoint from (does not\nintersect) g2.\n\nDISJOINT() tests the opposite relationship to INTERSECTS().\n\nDISJOINT() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_DISJOINT() uses object shapes.\n\n\n\nURL: mariadb.com/kb/en/disjoint/','','https://mariadb.com/kb/en/disjoint/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (449,30,'EQUALS','Syntax\n------\n\nEquals(g1,g2)\n\nFrom MariaDB 10.2.3:\n\nMBREQUALS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether g1 is spatially equal to g2.\n\nEQUALS() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_EQUALS() uses object shapes.\n\nFrom MariaDB 10.2.3, MBREQUALS is a synonym for Equals.\n\n\n\nURL: mariadb.com/kb/en/equals/','','https://mariadb.com/kb/en/equals/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (450,30,'INTERSECTS','Syntax\n------\n\nINTERSECTS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 spatially intersects geometry\ng2.\n\nINTERSECTS() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_INTERSECTS() uses object shapes.\n\nINTERSECTS() tests the opposite relationship to DISJOINT().\n\n\n\nURL: mariadb.com/kb/en/intersects/','','https://mariadb.com/kb/en/intersects/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (451,30,'OVERLAPS','Syntax\n------\n\nOVERLAPS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether g1 spatially overlaps g2. The term\nspatially overlaps is used if two geometries intersect and their intersection\nresults in a geometry of the same dimension but not equal to either of the\ngiven geometries.\n\nOVERLAPS() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_OVERLAPS() uses object shapes.\n\n\n\nURL: mariadb.com/kb/en/overlaps/','','https://mariadb.com/kb/en/overlaps/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (452,30,'ST_CONTAINS','Syntax\n------\n\nST_CONTAINS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether a geometry g1 completely contains geometry\ng2.\n\nST_CONTAINS() uses object shapes, while CONTAINS(), based on the original\nMySQL implementation, uses object bounding rectangles.\n\nST_CONTAINS tests the opposite relationship to ST_WITHIN().\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60, 125 100, 175\n150))\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'POINT(174 149)\');\n\nSELECT ST_CONTAINS(@g1,@g2);\n+----------------------+\n| ST_CONTAINS(@g1,@g2) |\n+----------------------+\n| 1 |\n+----------------------+\n\nSET @g2 = ST_GEOMFROMTEXT(\'POINT(175 151)\');\n\nSELECT ST_CONTAINS(@g1,@g2);\n+----------------------+\n| ST_CONTAINS(@g1,@g2) |\n+----------------------+\n| 0 |\n+----------------------+\n\n\n\nURL: mariadb.com/kb/en/st-contains/','','https://mariadb.com/kb/en/st-contains/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (453,30,'ST_CROSSES','Syntax\n------\n\nST_CROSSES(g1,g2)\n\nDescription\n-----------\n\nReturns 1 if geometry g1 spatially crosses geometry g2. Returns NULL if g1 is\na Polygon or a MultiPolygon, or if g2 is a Point or a MultiPoint. Otherwise,\nreturns 0.\n\nThe term spatially crosses denotes a spatial relation between two given\ngeometries that has the following properties:\n\n* The two geometries intersect\n* Their intersection results in a geometry that has a dimension that is one\n less than the maximum dimension of the two given geometries\n* Their intersection is not equal to either of the two given geometries\n\nST_CROSSES() uses object shapes, while CROSSES(), based on the original MySQL\nimplementation, uses object bounding rectangles.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(174 149, 176 151)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60, 125 100, 175\n150))\');\n\nSELECT ST_CROSSES(@g1,@g2);\n+---------------------+\n| ST_CROSSES(@g1,@g2) |\n+---------------------+\n| 1 |\n+---------------------+\n\nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(176 149, 176 151)\');\n\nSELECT ST_CROSSES(@g1,@g2);\n+---------------------+\n| ST_CROSSES(@g1,@g2) |\n+---------------------+\n| 0 |\n+---------------------+\n\n\n\nURL: mariadb.com/kb/en/st-crosses/','','https://mariadb.com/kb/en/st-crosses/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (454,30,'ST_DIFFERENCE','Syntax\n------\n\nST_DIFFERENCE(g1,g2)\n\nDescription\n-----------\n\nReturns a geometry representing the point set difference of the given geometry\nvalues.\n\nExample\n-------\n\nSET @g1 = POINT(10,10), @g2 = POINT(20,20);\n\nSELECT ST_AsText(ST_Difference(@g1, @g2));\n+------------------------------------+\n| ST_AsText(ST_Difference(@g1, @g2)) |\n+------------------------------------+\n| POINT(10 10) |\n+------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_difference/','','https://mariadb.com/kb/en/st_difference/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (455,30,'ST_DISJOINT','Syntax\n------\n\nST_DISJOINT(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 is spatially disjoint from\n(does not intersect with) geometry g2.\n\nST_DISJOINT() uses object shapes, while DISJOINT(), based on the original\nMySQL implementation, uses object bounding rectangles.\n\nST_DISJOINT() tests the opposite relationship to ST_INTERSECTS().\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(0 0)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 0, 0 2)\');\n\nSELECT ST_DISJOINT(@g1,@g2);\n+----------------------+\n| ST_DISJOINT(@g1,@g2) |\n+----------------------+\n| 1 |\n+----------------------+\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(0 0, 0 2)\');\n\nSELECT ST_DISJOINT(@g1,@g2);\n+----------------------+\n| ST_DISJOINT(@g1,@g2) |\n+----------------------+\n| 0 |\n+----------------------+\n\n\n\nURL: mariadb.com/kb/en/st_disjoint/','','https://mariadb.com/kb/en/st_disjoint/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (456,30,'ST_DISTANCE','Syntax\n------\n\nST_DISTANCE(g1,g2)\n\nDescription\n-----------\n\nReturns the distance between two geometries, or null if not given valid inputs.\n\nExample\n-------\n\nSELECT ST_Distance(POINT(1,2),POINT(2,2));\n+------------------------------------+\n| ST_Distance(POINT(1,2),POINT(2,2)) |\n+------------------------------------+\n| 1 |\n+------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_distance/','','https://mariadb.com/kb/en/st_distance/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (457,30,'ST_EQUALS','Syntax\n------\n\nST_EQUALS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 is spatially equal to geometry\ng2.\n\nST_EQUALS() uses object shapes, while EQUALS(), based on the original MySQL\nimplementation, uses object bounding rectangles.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'LINESTRING(174 149, 176 151)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(176 151, 174 149)\');\n\nSELECT ST_EQUALS(@g1,@g2);\n+--------------------+\n| ST_EQUALS(@g1,@g2) |\n+--------------------+\n| 1 |\n+--------------------+\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(0 2)\');\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 0)\');\n\nSELECT ST_EQUALS(@g1,@g2);\n+--------------------+\n| ST_EQUALS(@g1,@g2) |\n+--------------------+\n| 0 |\n+--------------------+\n\n\n\nURL: mariadb.com/kb/en/st-equals/','','https://mariadb.com/kb/en/st-equals/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (458,30,'ST_INTERSECTS','Syntax\n------\n\nST_INTERSECTS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 spatially intersects geometry\ng2.\n\nST_INTERSECTS() uses object shapes, while INTERSECTS(), based on the original\nMySQL implementation, uses object bounding rectangles.\n\nST_INTERSECTS() tests the opposite relationship to ST_DISJOINT().\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(0 0)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(0 0, 0 2)\');\n\nSELECT ST_INTERSECTS(@g1,@g2);\n+------------------------+\n| ST_INTERSECTS(@g1,@g2) |\n+------------------------+\n| 1 |\n+------------------------+\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 0, 0 2)\');\n\nSELECT ST_INTERSECTS(@g1,@g2);\n+------------------------+\n| ST_INTERSECTS(@g1,@g2) |\n+------------------------+\n| 0 |\n+------------------------+\n\n\n\nURL: mariadb.com/kb/en/st-intersects/','','https://mariadb.com/kb/en/st-intersects/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (459,30,'ST_LENGTH','Syntax\n------\n\nST_LENGTH(ls)\n\nDescription\n-----------\n\nReturns as a double-precision number the length of the LineString value ls in\nits associated spatial reference.\n\nExamples\n--------\n\nSET @ls = \'LineString(1 1,2 2,3 3)\';\n\nSELECT ST_LENGTH(ST_GeomFromText(@ls));\n+---------------------------------+\n| ST_LENGTH(ST_GeomFromText(@ls)) |\n+---------------------------------+\n| 2.82842712474619 |\n+---------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_length/','','https://mariadb.com/kb/en/st_length/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (460,30,'ST_OVERLAPS','Syntax\n------\n\nST_OVERLAPS(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 spatially overlaps geometry g2.\n\nThe term spatially overlaps is used if two geometries intersect and their\nintersection results in a geometry of the same dimension but not equal to\neither of the given geometries.\n\nST_OVERLAPS() uses object shapes, while OVERLAPS(), based on the original\nMySQL implementation, uses object bounding rectangles.\n\n\n\nURL: mariadb.com/kb/en/st-overlaps/','','https://mariadb.com/kb/en/st-overlaps/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (461,30,'ST_TOUCHES','Syntax\n------\n\nST_TOUCHES(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 spatially touches geometry g2.\nTwo geometries spatially touch if the interiors of the geometries do not\nintersect, but the boundary of one of the geometries intersects either the\nboundary or the interior of the other.\n\nST_TOUCHES() uses object shapes, while TOUCHES(), based on the original MySQL\nimplementation, uses object bounding rectangles.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 0)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'LINESTRING(2 0, 0 2)\');\n\nSELECT ST_TOUCHES(@g1,@g2);\n+---------------------+\n| ST_TOUCHES(@g1,@g2) |\n+---------------------+\n| 1 |\n+---------------------+\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(2 1)\');\n\nSELECT ST_TOUCHES(@g1,@g2);\n+---------------------+\n| ST_TOUCHES(@g1,@g2) |\n+---------------------+\n| 0 |\n+---------------------+\n\n\n\nURL: mariadb.com/kb/en/st-touches/','','https://mariadb.com/kb/en/st-touches/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (462,30,'ST_WITHIN','Syntax\n------\n\nST_WITHIN(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether geometry g1 is spatially within geometry g2.\n\nThis tests the opposite relationship as ST_CONTAINS().\n\nST_WITHIN() uses object shapes, while WITHIN(), based on the original MySQL\nimplementation, uses object bounding rectangles.\n\nExamples\n--------\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(174 149)\');\n\nSET @g2 = ST_GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60, 125 100, 175\n150))\');\n\nSELECT ST_WITHIN(@g1,@g2);\n+--------------------+\n| ST_WITHIN(@g1,@g2) |\n+--------------------+\n| 1 |\n+--------------------+\n\nSET @g1 = ST_GEOMFROMTEXT(\'POINT(176 151)\');\n\nSELECT ST_WITHIN(@g1,@g2);\n+--------------------+\n| ST_WITHIN(@g1,@g2) |\n+--------------------+\n| 0 |\n+--------------------+\n\n\n\nURL: mariadb.com/kb/en/st-within/','','https://mariadb.com/kb/en/st-within/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (463,30,'TOUCHES','Syntax\n------\n\nTouches(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether g1 spatially touches g2. Two geometries\nspatially touch if the interiors of the geometries do not intersect, but the\nboundary of one of the geometries intersects either the boundary or the\ninterior of the other.\n\nTOUCHES() is based on the original MySQL implementation and uses object\nbounding rectangles, while ST_TOUCHES() uses object shapes.\n\n\n\nURL: mariadb.com/kb/en/touches/','','https://mariadb.com/kb/en/touches/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (464,30,'WITHIN','Syntax\n------\n\nWithin(g1,g2)\n\nDescription\n-----------\n\nReturns 1 or 0 to indicate whether g1 is spatially within g2. This tests the\nopposite relationship as Contains().\n\nWITHIN() is based on the original MySQL implementation, and uses object\nbounding rectangles, while ST_WITHIN() uses object shapes.\n\nExamples\n--------\n\nSET @g1 = GEOMFROMTEXT(\'POINT(174 149)\');\nSET @g2 = GEOMFROMTEXT(\'POINT(176 151)\');\nSET @g3 = GEOMFROMTEXT(\'POLYGON((175 150, 20 40, 50 60, 125 100, 175 150))\');\n\nSELECT within(@g1,@g3);\n+-----------------+\n| within(@g1,@g3) |\n+-----------------+\n| 1 |\n+-----------------+\n\nSELECT within(@g2,@g3);\n+-----------------+\n| within(@g2,@g3) |\n+-----------------+\n| 0 |\n+-----------------+\n\n\n\nURL: mariadb.com/kb/en/within/','','https://mariadb.com/kb/en/within/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (465,31,'ADDDATE','Syntax\n------\n\nADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days)\n\nDescription\n-----------\n\nWhen invoked with the INTERVAL form of the second argument, ADDDATE() is a\nsynonym for DATE_ADD(). The related function SUBDATE() is a synonym for\nDATE_SUB(). For information on the INTERVAL unit argument, see the discussion\nfor DATE_ADD().\n\nWhen invoked with the days form of the second argument, MariaDB treats it as\nan integer number of days to be added to expr.\n\nExamples\n--------\n\nSELECT DATE_ADD(\'2008-01-02\', INTERVAL 31 DAY);\n+-----------------------------------------+\n| DATE_ADD(\'2008-01-02\', INTERVAL 31 DAY) |\n+-----------------------------------------+\n| 2008-02-02 |\n+-----------------------------------------+\n\nSELECT ADDDATE(\'2008-01-02\', INTERVAL 31 DAY);\n+----------------------------------------+\n| ADDDATE(\'2008-01-02\', INTERVAL 31 DAY) |\n+----------------------------------------+\n| 2008-02-02 |\n+----------------------------------------+\n\nSELECT ADDDATE(\'2008-01-02\', 31);\n+---------------------------+\n| ADDDATE(\'2008-01-02\', 31) |\n+---------------------------+\n| 2008-02-02 |\n+---------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n ("2007-01-30 21:31:07"),\n ("1983-10-15 06:42:51"),\n ("2011-04-21 12:34:56"),\n ("2011-10-30 06:31:41"),\n ("2011-01-30 14:03:25"),\n ("2004-10-07 11:19:34");\n\nSELECT d, ADDDATE(d, 10) from t1;\n+---------------------+---------------------+\n| d | ADDDATE(d, 10) |\n+---------------------+---------------------+\n| 2007-01-30 21:31:07 | 2007-02-09 21:31:07 |\n| 1983-10-15 06:42:51 | 1983-10-25 06:42:51 |\n| 2011-04-21 12:34:56 | 2011-05-01 12:34:56 |\n| 2011-10-30 06:31:41 | 2011-11-09 06:31:41 |\n| 2011-01-30 14:03:25 | 2011-02-09 14:03:25 |\n| 2004-10-07 11:19:34 | 2004-10-17 11:19:34 |\n+---------------------+---------------------+\n\nSELECT d, ADDDATE(d, INTERVAL 10 HOUR) from t1;\n+---------------------+------------------------------+\n| d | ADDDATE(d, INTERVAL 10 HOUR) |\n+---------------------+------------------------------+\n| 2007-01-30 21:31:07 | 2007-01-31 07:31:07 |\n| 1983-10-15 06:42:51 | 1983-10-15 16:42:51 |\n| 2011-04-21 12:34:56 | 2011-04-21 22:34:56 |\n| 2011-10-30 06:31:41 | 2011-10-30 16:31:41 |\n| 2011-01-30 14:03:25 | 2011-01-31 00:03:25 |\n| 2004-10-07 11:19:34 | 2004-10-07 21:19:34 |\n+---------------------+------------------------------+\n\n\n\nURL: mariadb.com/kb/en/adddate/','','https://mariadb.com/kb/en/adddate/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (466,31,'ADDTIME','Syntax\n------\n\nADDTIME(expr1,expr2)\n\nDescription\n-----------\n\nADDTIME() adds expr2 to expr1 and returns the result. expr1 is a time or\ndatetime expression, and expr2 is a time expression.\n\nExamples\n--------\n\nSELECT ADDTIME(\'2007-12-31 23:59:59.999999\', \'1 1:1:1.000002\');\n+---------------------------------------------------------+\n| ADDTIME(\'2007-12-31 23:59:59.999999\', \'1 1:1:1.000002\') |\n+---------------------------------------------------------+\n| 2008-01-02 01:01:01.000001 |\n+---------------------------------------------------------+\n\nSELECT ADDTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n+-----------------------------------------------+\n| ADDTIME(\'01:00:00.999999\', \'02:00:00.999998\') |\n+-----------------------------------------------+\n| 03:00:01.999997 |\n+-----------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/addtime/','','https://mariadb.com/kb/en/addtime/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (467,31,'CONVERT_TZ','Syntax\n------\n\nCONVERT_TZ(dt,from_tz,to_tz)\n\nDescription\n-----------\n\nCONVERT_TZ() converts a datetime value dt from the time zone given by from_tz\nto the time zone given by to_tz and returns the resulting value.\n\nIn order to use named time zones, such as GMT, MET or Africa/Johannesburg, the\ntime_zone tables must be loaded (see mysql_tzinfo_to_sql).\n\nNo conversion will take place if the value falls outside of the supported\nTIMESTAMP range (\'1970-01-01 00:00:01\' to \'2038-01-19 05:14:07\' UTC) when\nconverted from from_tz to UTC.\n\nThis function returns NULL if the arguments are invalid (or named time zones\nhave not been loaded).\n\nSee time zones for more information.\n\nExamples\n--------\n\nSELECT CONVERT_TZ(\'2016-01-01 12:00:00\',\'+00:00\',\'+10:00\');\n+-----------------------------------------------------+\n| CONVERT_TZ(\'2016-01-01 12:00:00\',\'+00:00\',\'+10:00\') |\n+-----------------------------------------------------+\n| 2016-01-01 22:00:00 |\n+-----------------------------------------------------+\n\nUsing named time zones (with the time zone tables loaded):\n\nSELECT CONVERT_TZ(\'2016-01-01 12:00:00\',\'GMT\',\'Africa/Johannesburg\');\n+---------------------------------------------------------------+\n| CONVERT_TZ(\'2016-01-01 12:00:00\',\'GMT\',\'Africa/Johannesburg\') |\n+---------------------------------------------------------------+\n| 2016-01-01 14:00:00 |\n+---------------------------------------------------------------+\n\nThe value is out of the TIMESTAMP range, so no conversion takes place:\n\nSELECT CONVERT_TZ(\'1969-12-31 22:00:00\',\'+00:00\',\'+10:00\');\n+-----------------------------------------------------+\n| CONVERT_TZ(\'1969-12-31 22:00:00\',\'+00:00\',\'+10:00\') |\n+-----------------------------------------------------+\n| 1969-12-31 22:00:00 |\n+-----------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/convert_tz/','','https://mariadb.com/kb/en/convert_tz/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (468,31,'CURDATE','Syntax\n------\n\nCURDATE()\nCURRENT_DATE\nCURRENT_DATE()\n\nDescription\n-----------\n\nCURDATE returns the current date as a value in \'YYYY-MM-DD\' or YYYYMMDD\nformat, depending on whether the function is used in a string or numeric\ncontext.\n\nCURRENT_DATE and CURRENT_DATE() are synonyms.\n\nExamples\n--------\n\nSELECT CURDATE();\n+------------+\n| CURDATE() |\n+------------+\n| 2019-03-05 |\n+------------+\n\nIn a numeric context (note this is not performing date calculations):\n\nSELECT CURDATE() +0;\n+--------------+\n| CURDATE() +0 |\n+--------------+\n| 20190305 |\n+--------------+\n\nData calculation:\n\nSELECT CURDATE() - INTERVAL 5 DAY;\n+----------------------------+\n| CURDATE() - INTERVAL 5 DAY |\n+----------------------------+\n| 2019-02-28 |\n+----------------------------+\n\n\n\nURL: mariadb.com/kb/en/curdate/','','https://mariadb.com/kb/en/curdate/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (469,31,'CURRENT_DATE','Syntax\n------\n\nCURRENT_DATE, CURRENT_DATE()\n\nDescription\n-----------\n\nCURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE().\n\n\n\nURL: mariadb.com/kb/en/current_date/','','https://mariadb.com/kb/en/current_date/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (470,31,'CURRENT_TIME','Syntax\n------\n\nCURRENT_TIME\nCURRENT_TIME([precision])\n\nDescription\n-----------\n\nCURRENT_TIME and CURRENT_TIME() are synonyms for CURTIME().\n\n\n\nURL: mariadb.com/kb/en/current_time/','','https://mariadb.com/kb/en/current_time/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (471,31,'CURRENT_TIMESTAMP','Syntax\n------\n\nCURRENT_TIMESTAMP\nCURRENT_TIMESTAMP([precision])\n\nDescription\n-----------\n\nCURRENT_TIMESTAMP and CURRENT_TIMESTAMP() are synonyms for NOW().\n\n\n\nURL: mariadb.com/kb/en/current_timestamp/','','https://mariadb.com/kb/en/current_timestamp/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (472,31,'CURTIME','Syntax\n------\n\nCURTIME([precision])\n\nDescription\n-----------\n\nReturns the current time as a value in \'HH:MM:SS\' or HHMMSS.uuuuuu format,\ndepending on whether the function is used in a string or numeric context. The\nvalue is expressed in the current time zone.\n\nThe optional precision determines the microsecond precision. See Microseconds\nin MariaDB.\n\nExamples\n--------\n\nSELECT CURTIME();\n+-----------+\n| CURTIME() |\n+-----------+\n| 12:45:39 |\n+-----------+\n\nSELECT CURTIME() + 0;\n+---------------+\n| CURTIME() + 0 |\n+---------------+\n| 124545.000000 |\n+---------------+\n\nWith precision:\n\nSELECT CURTIME(2);\n+-------------+\n| CURTIME(2) |\n+-------------+\n| 09:49:08.09 |\n+-------------+\n\n\n\nURL: mariadb.com/kb/en/curtime/','','https://mariadb.com/kb/en/curtime/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (473,31,'DATE FUNCTION','Syntax\n------\n\nDATE(expr)\n\nDescription\n-----------\n\nExtracts the date part of the date or datetime expression expr.\n\nExamples\n--------\n\nSELECT DATE(\'2013-07-18 12:21:32\');\n+-----------------------------+\n| DATE(\'2013-07-18 12:21:32\') |\n+-----------------------------+\n| 2013-07-18 |\n+-----------------------------+\n\nError Handling\n--------------\n\nUntil MariaDB 5.5.32, some versions of MariaDB returned 0000-00-00 when passed\nan invalid date. From 5.5.32, NULL is returned.\n\n\n\nURL: mariadb.com/kb/en/date-function/','','https://mariadb.com/kb/en/date-function/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (474,31,'DATEDIFF','Syntax\n------\n\nDATEDIFF(expr1,expr2)\n\nDescription\n-----------\n\nDATEDIFF() returns (expr1 – expr2) expressed as a value in days from one date\nto the other. expr1 and expr2 are date or date-and-time expressions. Only the\ndate parts of the values are used in the calculation.\n\nExamples\n--------\n\nSELECT DATEDIFF(\'2007-12-31 23:59:59\',\'2007-12-30\');\n+----------------------------------------------+\n| DATEDIFF(\'2007-12-31 23:59:59\',\'2007-12-30\') |\n+----------------------------------------------+\n| 1 |\n+----------------------------------------------+\n\nSELECT DATEDIFF(\'2010-11-30 23:59:59\',\'2010-12-31\');\n+----------------------------------------------+\n| DATEDIFF(\'2010-11-30 23:59:59\',\'2010-12-31\') |\n+----------------------------------------------+\n| -31 |\n+----------------------------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n ("2007-01-30 21:31:07"),\n ("1983-10-15 06:42:51"),\n ("2011-04-21 12:34:56"),\n ("2011-10-30 06:31:41"),\n ("2011-01-30 14:03:25"),\n ("2004-10-07 11:19:34");\n\nSELECT NOW();\n+---------------------+\n| NOW() |\n+---------------------+\n| 2011-05-23 10:56:05 |\n+---------------------+\n\nSELECT d, DATEDIFF(NOW(),d) FROM t1;\n+---------------------+-------------------+\n| d | DATEDIFF(NOW(),d) |\n+---------------------+-------------------+\n| 2007-01-30 21:31:07 | 1574 |\n| 1983-10-15 06:42:51 | 10082 |\n| 2011-04-21 12:34:56 | 32 |\n| 2011-10-30 06:31:41 | -160 |\n| 2011-01-30 14:03:25 | 113 |\n| 2004-10-07 11:19:34 | 2419 |\n+---------------------+-------------------+\n\n\n\nURL: mariadb.com/kb/en/datediff/','','https://mariadb.com/kb/en/datediff/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (475,31,'DATE_ADD','Syntax\n------\n\nDATE_ADD(date,INTERVAL expr unit)\n\nDescription\n-----------\n\nPerforms date arithmetic. The date argument specifies the starting date or\ndatetime value. expr is an expression specifying the interval value to be\nadded or subtracted from the starting date. expr is a string; it may start\nwith a "-" for negative intervals. unit is a keyword indicating the units in\nwhich the expression should be interpreted. See Date and Time Units for a\ncomplete list of permitted units.\n\nExamples\n--------\n\nSELECT \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND;\n+-------------------------------------------+\n| \'2008-12-31 23:59:59\' + INTERVAL 1 SECOND |\n+-------------------------------------------+\n| 2009-01-01 00:00:00 |\n+-------------------------------------------+\n\nSELECT INTERVAL 1 DAY + \'2008-12-31\';\n+-------------------------------+\n| INTERVAL 1 DAY + \'2008-12-31\' |\n+-------------------------------+\n| 2009-01-01 |\n+-------------------------------+\n\nSELECT \'2005-01-01\' - INTERVAL 1 SECOND;\n+----------------------------------+\n| \'2005-01-01\' - INTERVAL 1 SECOND |\n+----------------------------------+\n| 2004-12-31 23:59:59 |\n+----------------------------------+\n\nSELECT DATE_ADD(\'2000-12-31 23:59:59\', INTERVAL 1 SECOND);\n+----------------------------------------------------+\n| DATE_ADD(\'2000-12-31 23:59:59\', INTERVAL 1 SECOND) |\n+----------------------------------------------------+\n| 2001-01-01 00:00:00 |\n+----------------------------------------------------+\n\nSELECT DATE_ADD(\'2010-12-31 23:59:59\', INTERVAL 1 DAY);\n+-------------------------------------------------+\n| DATE_ADD(\'2010-12-31 23:59:59\', INTERVAL 1 DAY) |\n+-------------------------------------------------+\n| 2011-01-01 23:59:59 |\n+-------------------------------------------------+\n\nSELECT DATE_ADD(\'2100-12-31 23:59:59\', INTERVAL \'1:1\' MINUTE_SECOND);\n+---------------------------------------------------------------+\n| DATE_ADD(\'2100-12-31 23:59:59\', INTERVAL \'1:1\' MINUTE_SECOND) |\n+---------------------------------------------------------------+\n| 2101-01-01 00:01:00 |\n+---------------------------------------------------------------+\n\nSELECT DATE_ADD(\'1900-01-01 00:00:00\', INTERVAL \'-1 10\' DAY_HOUR);\n+------------------------------------------------------------+\n| DATE_ADD(\'1900-01-01 00:00:00\', INTERVAL \'-1 10\' DAY_HOUR) |\n+------------------------------------------------------------+\n| 1899-12-30 14:00:00 |\n+------------------------------------------------------------+\n\nSELECT DATE_ADD(\'1992-12-31 23:59:59.000002\', INTERVAL \'1.999999\'\nSECOND_MICROSECOND);\n+------------------------------------------------------------------------------\n-+\n| DATE_ADD(\'1992-12-31 23:59:59.000002\', INTERVAL \'1.999999\'\nSECOND_MICROSECOND) |\n+------------------------------------------------------------------------------\n-+\n| 1993-01-01 00:00:01.000001 \n |\n+------------------------------------------------------------------------------\n-+\n\n\n\nURL: mariadb.com/kb/en/date_add/','','https://mariadb.com/kb/en/date_add/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (476,31,'DATE_FORMAT','Syntax\n------\n\nDATE_FORMAT(date, format[, locale])\n\nDescription\n-----------\n\nFormats the date value according to the format string.\n\nThe language used for the names is controlled by the value of the\nlc_time_names system variable. See server locale for more on the supported\nlocales.\n\nThe options that can be used by DATE_FORMAT(), as well as its inverse\nSTR_TO_DATE() and the FROM_UNIXTIME() function, are:\n\n+---------------------------+-------------------------------------------------+\n| Option | Description |\n+---------------------------+-------------------------------------------------+\n| %a | Short weekday name in current locale (Variable |\n| | lc_time_names). |\n+---------------------------+-------------------------------------------------+\n| %b | Short form month name in current locale. For |\n| | locale en_US this is one of: |\n| | Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov or |\n| | Dec. |\n+---------------------------+-------------------------------------------------+\n| %c | Month with 1 or 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %D | Day with English suffix \'th\', \'nd\', \'st\' or |\n| | \'rd\'\'. (1st, 2nd, 3rd...). |\n+---------------------------+-------------------------------------------------+\n| %d | Day with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %e | Day with 1 or 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %f | Microseconds 6 digits. |\n+---------------------------+-------------------------------------------------+\n| %H | Hour with 2 digits between 00-23. |\n+---------------------------+-------------------------------------------------+\n| %h | Hour with 2 digits between 01-12. |\n+---------------------------+-------------------------------------------------+\n| %I | Hour with 2 digits between 01-12. |\n+---------------------------+-------------------------------------------------+\n| %i | Minute with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %j | Day of the year (001-366) |\n+---------------------------+-------------------------------------------------+\n| %k | Hour with 1 digits between 0-23. |\n+---------------------------+-------------------------------------------------+\n| %l | Hour with 1 digits between 1-12. |\n+---------------------------+-------------------------------------------------+\n| %M | Full month name in current locale (Variable |\n| | lc_time_names). |\n+---------------------------+-------------------------------------------------+\n| %m | Month with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %p | AM/PM according to current locale (Variable |\n| | lc_time_names). |\n+---------------------------+-------------------------------------------------+\n| %r | Time in 12 hour format, followed by AM/PM. |\n| | Short for \'%I:%i:%S %p\'. |\n+---------------------------+-------------------------------------------------+\n| %S | Seconds with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %s | Seconds with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %T | Time in 24 hour format. Short for \'%H:%i:%S\'. |\n+---------------------------+-------------------------------------------------+\n| %U | Week number (00-53), when first day of the |\n| | week is Sunday. |\n+---------------------------+-------------------------------------------------+\n| %u | Week number (00-53), when first day of the |\n| | week is Monday. |\n+---------------------------+-------------------------------------------------+\n| %V | Week number (01-53), when first day of the |\n| | week is Sunday. Used with %X. |\n+---------------------------+-------------------------------------------------+\n| %v | Week number (01-53), when first day of the |\n| | week is Monday. Used with %x. |\n+---------------------------+-------------------------------------------------+\n| %W | Full weekday name in current locale (Variable |\n| | lc_time_names). |\n+---------------------------+-------------------------------------------------+\n| %w | Day of the week. 0 = Sunday, 6 = Saturday. |\n+---------------------------+-------------------------------------------------+\n| %X | Year with 4 digits when first day of the week |\n| | is Sunday. Used with %V. |\n+---------------------------+-------------------------------------------------+\n| %x | Year with 4 digits when first day of the week |\n| | is Monday. Used with %v. |\n+---------------------------+-------------------------------------------------+\n| %Y | Year with 4 digits. |\n+---------------------------+-------------------------------------------------+\n| %y | Year with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %# | For str_to_date(), skip all numbers. |\n+---------------------------+-------------------------------------------------+\n| %. | For str_to_date(), skip all punctation |\n| | characters. |\n+---------------------------+-------------------------------------------------+\n| %@ | For str_to_date(), skip all alpha characters. |\n+---------------------------+-------------------------------------------------+\n| %% | A literal % character. |\n+---------------------------+-------------------------------------------------+\n\nTo get a date in one of the standard formats, GET_FORMAT() can be used.\n\nExamples\n--------\n\nSELECT DATE_FORMAT(\'2009-10-04 22:23:00\', \'%W %M %Y\');\n+------------------------------------------------+\n| DATE_FORMAT(\'2009-10-04 22:23:00\', \'%W %M %Y\') |\n+------------------------------------------------+\n| Sunday October 2009 |\n+------------------------------------------------+\n\nSELECT DATE_FORMAT(\'2007-10-04 22:23:00\', \'%H:%i:%s\');\n+------------------------------------------------+\n| DATE_FORMAT(\'2007-10-04 22:23:00\', \'%H:%i:%s\') |\n+------------------------------------------------+\n| 22:23:00 |\n+------------------------------------------------+\n\nSELECT DATE_FORMAT(\'1900-10-04 22:23:00\', \'%D %y %a %d %m %b %j\');\n+------------------------------------------------------------+\n| DATE_FORMAT(\'1900-10-04 22:23:00\', \'%D %y %a %d %m %b %j\') |\n+------------------------------------------------------------+\n| 4th 00 Thu 04 10 Oct 277 |\n+------------------------------------------------------------+\n\nSELECT DATE_FORMAT(\'1997-10-04 22:23:00\', \'%H %k %I %r %T %S %w\');\n+------------------------------------------------------------+\n| DATE_FORMAT(\'1997-10-04 22:23:00\', \'%H %k %I %r %T %S %w\') |\n+------------------------------------------------------------+\n| 22 22 10 10:23:00 PM 22:23:00 00 6 |\n+------------------------------------------------------------+\n\nSELECT DATE_FORMAT(\'1999-01-01\', \'%X %V\');\n+------------------------------------+\n| DATE_FORMAT(\'1999-01-01\', \'%X %V\') |\n+------------------------------------+\n| 1998 52 |\n+------------------------------------+\n\nSELECT DATE_FORMAT(\'2006-06-00\', \'%d\');\n+---------------------------------+\n| DATE_FORMAT(\'2006-06-00\', \'%d\') |\n+---------------------------------+\n| 00 |\n+---------------------------------+\n\nMariaDB starting with 10.3.2\n----------------------------\nOptionally, the locale can be explicitly specified as the third DATE_FORMAT()\nargument. Doing so makes the function independent from the session settings,\nand the three argument version of DATE_FORMAT() can be used in virtual indexed\nand persistent generated-columns:\n\nSELECT DATE_FORMAT(\'2006-01-01\', \'%W\', \'el_GR\');\n+------------------------------------------+\n| DATE_FORMAT(\'2006-01-01\', \'%W\', \'el_GR\') |\n+------------------------------------------+\n| Κυριακή |\n+------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/date_format/','','https://mariadb.com/kb/en/date_format/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (477,31,'DATE_SUB','Syntax\n------\n\nDATE_SUB(date,INTERVAL expr unit)\n\nDescription\n-----------\n\nPerforms date arithmetic. The date argument specifies the starting date or\ndatetime value. expr is an expression specifying the interval value to be\nadded or subtracted from the starting date. expr is a string; it may start\nwith a "-" for negative intervals. unit is a keyword indicating the units in\nwhich the expression should be interpreted. See Date and Time Units for a\ncomplete list of permitted units.\n\nSee also DATE_ADD().\n\nExamples\n--------\n\nSELECT DATE_SUB(\'1998-01-02\', INTERVAL 31 DAY);\n+-----------------------------------------+\n| DATE_SUB(\'1998-01-02\', INTERVAL 31 DAY) |\n+-----------------------------------------+\n| 1997-12-02 |\n+-----------------------------------------+\n\nSELECT DATE_SUB(\'2005-01-01 00:00:00\', INTERVAL \'1 1:1:1\' DAY_SECOND);\n+----------------------------------------------------------------+\n| DATE_SUB(\'2005-01-01 00:00:00\', INTERVAL \'1 1:1:1\' DAY_SECOND) |\n+----------------------------------------------------------------+\n| 2004-12-30 22:58:59 |\n+----------------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/date_sub/','','https://mariadb.com/kb/en/date_sub/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (478,31,'DAY','Syntax\n------\n\nDAY(date)\n\nDescription\n-----------\n\nDAY() is a synonym for DAYOFMONTH().\n\n\n\nURL: mariadb.com/kb/en/day/','','https://mariadb.com/kb/en/day/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (479,31,'DAYNAME','Syntax\n------\n\nDAYNAME(date)\n\nDescription\n-----------\n\nReturns the name of the weekday for date. The language used for the name is\ncontrolled by the value of the lc_time_names system variable. See server\nlocale for more on the supported locales.\n\nExamples\n--------\n\nSELECT DAYNAME(\'2007-02-03\');\n+-----------------------+\n| DAYNAME(\'2007-02-03\') |\n+-----------------------+\n| Saturday |\n+-----------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n ("2007-01-30 21:31:07"),\n ("1983-10-15 06:42:51"),\n ("2011-04-21 12:34:56"),\n ("2011-10-30 06:31:41"),\n ("2011-01-30 14:03:25"),\n ("2004-10-07 11:19:34");\n\nSELECT d, DAYNAME(d) FROM t1;\n+---------------------+------------+\n| d | DAYNAME(d) |\n+---------------------+------------+\n| 2007-01-30 21:31:07 | Tuesday |\n| 1983-10-15 06:42:51 | Saturday |\n| 2011-04-21 12:34:56 | Thursday |\n| 2011-10-30 06:31:41 | Sunday |\n| 2011-01-30 14:03:25 | Sunday |\n| 2004-10-07 11:19:34 | Thursday |\n+---------------------+------------+\n\nChanging the locale:\n\nSET lc_time_names = \'fr_CA\';\n\nSELECT DAYNAME(\'2013-04-01\');\n+-----------------------+\n| DAYNAME(\'2013-04-01\') |\n+-----------------------+\n| lundi |\n+-----------------------+\n\n\n\nURL: mariadb.com/kb/en/dayname/','','https://mariadb.com/kb/en/dayname/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (480,31,'DAYOFMONTH','Syntax\n------\n\nDAYOFMONTH(date)\n\nDescription\n-----------\n\nReturns the day of the month for date, in the range 1 to 31, or 0 for dates\nsuch as \'0000-00-00\' or \'2008-00-00\' which have a zero day part.\n\nDAY() is a synonym.\n\nExamples\n--------\n\nSELECT DAYOFMONTH(\'2007-02-03\');\n+--------------------------+\n| DAYOFMONTH(\'2007-02-03\') |\n+--------------------------+\n| 3 |\n+--------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n ("2007-01-30 21:31:07"),\n ("1983-10-15 06:42:51"),\n ("2011-04-21 12:34:56"),\n ("2011-10-30 06:31:41"),\n ("2011-01-30 14:03:25"),\n ("2004-10-07 11:19:34");\n\nSELECT d FROM t1 where DAYOFMONTH(d) = 30;\n+---------------------+\n| d |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n+---------------------+\n\n\n\nURL: mariadb.com/kb/en/dayofmonth/','','https://mariadb.com/kb/en/dayofmonth/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (481,31,'DAYOFWEEK','Syntax\n------\n\nDAYOFWEEK(date)\n\nDescription\n-----------\n\nReturns the day of the week index for the date (1 = Sunday, 2 = Monday, ..., 7\n= Saturday). These index values correspond to the ODBC standard.\n\nThis contrasts with WEEKDAY() which follows a different index numbering (0 =\nMonday, 1 = Tuesday, ... 6 = Sunday).\n\nExamples\n--------\n\nSELECT DAYOFWEEK(\'2007-02-03\');\n+-------------------------+\n| DAYOFWEEK(\'2007-02-03\') |\n+-------------------------+\n| 7 |\n+-------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n ("2007-01-30 21:31:07"),\n ("1983-10-15 06:42:51"),\n ("2011-04-21 12:34:56"),\n ("2011-10-30 06:31:41"),\n ("2011-01-30 14:03:25"),\n ("2004-10-07 11:19:34");\n\nSELECT d, DAYNAME(d), DAYOFWEEK(d), WEEKDAY(d) from t1;\n+---------------------+------------+--------------+------------+\n| d | DAYNAME(d) | DAYOFWEEK(d) | WEEKDAY(d) |\n+---------------------+------------+--------------+------------+\n| 2007-01-30 21:31:07 | Tuesday | 3 | 1 |\n| 1983-10-15 06:42:51 | Saturday | 7 | 5 |\n| 2011-04-21 12:34:56 | Thursday | 5 | 3 |\n| 2011-10-30 06:31:41 | Sunday | 1 | 6 |\n| 2011-01-30 14:03:25 | Sunday | 1 | 6 |\n| 2004-10-07 11:19:34 | Thursday | 5 | 3 |\n+---------------------+------------+--------------+------------+\n\n\n\nURL: mariadb.com/kb/en/dayofweek/','','https://mariadb.com/kb/en/dayofweek/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (482,31,'DAYOFYEAR','Syntax\n------\n\nDAYOFYEAR(date)\n\nDescription\n-----------\n\nReturns the day of the year for date, in the range 1 to 366.\n\nExamples\n--------\n\nSELECT DAYOFYEAR(\'2018-02-16\');\n+-------------------------+\n| DAYOFYEAR(\'2018-02-16\') |\n+-------------------------+\n| 47 |\n+-------------------------+\n\n\n\nURL: mariadb.com/kb/en/dayofyear/','','https://mariadb.com/kb/en/dayofyear/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (483,31,'EXTRACT','Syntax\n------\n\nEXTRACT(unit FROM date)\n\nDescription\n-----------\n\nThe EXTRACT() function extracts the required unit from the date. See Date and\nTime Units for a complete list of permitted units.\n\nIn MariaDB 10.0.7 and MariaDB 5.5.35, EXTRACT (HOUR FROM ...) was changed to\nreturn a value from 0 to 23, adhering to the SQL standard. Until MariaDB\n10.0.6 and MariaDB 5.5.34, and in all versions of MySQL at least as of MySQL\n5.7, it could return a value > 23. HOUR() is not a standard function, so\ncontinues to adhere to the old behaviour inherited from MySQL.\n\nExamples\n--------\n\nSELECT EXTRACT(YEAR FROM \'2009-07-02\');\n+---------------------------------+\n| EXTRACT(YEAR FROM \'2009-07-02\') |\n+---------------------------------+\n| 2009 |\n+---------------------------------+\n\nSELECT EXTRACT(YEAR_MONTH FROM \'2009-07-02 01:02:03\');\n+------------------------------------------------+\n| EXTRACT(YEAR_MONTH FROM \'2009-07-02 01:02:03\') |\n+------------------------------------------------+\n| 200907 |\n+------------------------------------------------+\n\nSELECT EXTRACT(DAY_MINUTE FROM \'2009-07-02 01:02:03\');\n+------------------------------------------------+\n| EXTRACT(DAY_MINUTE FROM \'2009-07-02 01:02:03\') |\n+------------------------------------------------+\n| 20102 |\n+------------------------------------------------+\n\nSELECT EXTRACT(MICROSECOND FROM \'2003-01-02 10:30:00.000123\');\n+--------------------------------------------------------+\n| EXTRACT(MICROSECOND FROM \'2003-01-02 10:30:00.000123\') |\n+--------------------------------------------------------+\n| 123 |\n+--------------------------------------------------------+\n\nFrom MariaDB 10.0.7 and MariaDB 5.5.35, EXTRACT (HOUR FROM...) returns a value\nfrom 0 to 23, as per the SQL standard. HOUR is not a standard function, so\ncontinues to adhere to the old behaviour inherited from MySQL.\n\nSELECT EXTRACT(HOUR FROM \'26:30:00\'), HOUR(\'26:30:00\');\n+-------------------------------+------------------+\n| EXTRACT(HOUR FROM \'26:30:00\') | HOUR(\'26:30:00\') |\n+-------------------------------+------------------+\n| 2 | 26 |\n+-------------------------------+------------------+\n\n\n\nURL: mariadb.com/kb/en/extract/','','https://mariadb.com/kb/en/extract/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (484,31,'FROM_DAYS','Syntax\n------\n\nFROM_DAYS(N)\n\nDescription\n-----------\n\nGiven a day number N, returns a DATE value. The day count is based on the\nnumber of days from the start of the standard calendar (0000-00-00).\n\nThe function is not designed for use with dates before the advent of the\nGregorian calendar in October 1582. Results will not be reliable since it\ndoesn\'t account for the lost days when the calendar changed from the Julian\ncalendar.\n\nThis is the converse of the TO_DAYS() function.\n\nExamples\n--------\n\nSELECT FROM_DAYS(730669);\n+-------------------+\n| FROM_DAYS(730669) |\n+-------------------+\n| 2000-07-03 |\n+-------------------+\n\n\n\nURL: mariadb.com/kb/en/from_days/','','https://mariadb.com/kb/en/from_days/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (485,31,'FROM_UNIXTIME','Syntax\n------\n\nFROM_UNIXTIME(unix_timestamp), FROM_UNIXTIME(unix_timestamp,format)\n\nDescription\n-----------\n\nReturns a representation of the unix_timestamp argument as a value in\n\'YYYY-MM-DD HH:MM:SS\' or YYYYMMDDHHMMSS.uuuuuu format, depending on whether\nthe function is used in a string or numeric context. The value is expressed in\nthe current time zone. unix_timestamp is an internal timestamp value such as\nis produced by the UNIX_TIMESTAMP() function.\n\nIf format is given, the result is formatted according to the format string,\nwhich is used the same way as listed in the entry for the DATE_FORMAT()\nfunction.\n\nTimestamps in MariaDB have a maximum value of 2147483647, equivalent to\n2038-01-19 05:14:07. This is due to the underlying 32-bit limitation. Using\nthe function on a timestamp beyond this will result in NULL being returned.\nUse DATETIME as a storage type if you require dates beyond this.\n\nThe options that can be used by FROM_UNIXTIME(), as well as DATE_FORMAT() and\nSTR_TO_DATE(), are:\n\n+---------------------------+-------------------------------------------------+\n| Option | Description |\n+---------------------------+-------------------------------------------------+\n| %a | Short weekday name in current locale (Variable |\n| | lc_time_names). |\n+---------------------------+-------------------------------------------------+\n| %b | Short form month name in current locale. For |\n| | locale en_US this is one of: |\n| | Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov or |\n| | Dec. |\n+---------------------------+-------------------------------------------------+\n| %c | Month with 1 or 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %D | Day with English suffix \'th\', \'nd\', \'st\' or |\n| | \'rd\'\'. (1st, 2nd, 3rd...). |\n+---------------------------+-------------------------------------------------+\n| %d | Day with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %e | Day with 1 or 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %f | Microseconds 6 digits. |\n+---------------------------+-------------------------------------------------+\n| %H | Hour with 2 digits between 00-23. |\n+---------------------------+-------------------------------------------------+\n| %h | Hour with 2 digits between 01-12. |\n+---------------------------+-------------------------------------------------+\n| %I | Hour with 2 digits between 01-12. |\n+---------------------------+-------------------------------------------------+\n| %i | Minute with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %j | Day of the year (001-366) |\n+---------------------------+-------------------------------------------------+\n| %k | Hour with 1 digits between 0-23. |\n+---------------------------+-------------------------------------------------+\n| %l | Hour with 1 digits between 1-12. |\n+---------------------------+-------------------------------------------------+\n| %M | Full month name in current locale (Variable |\n| | lc_time_names). |\n+---------------------------+-------------------------------------------------+\n| %m | Month with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %p | AM/PM according to current locale (Variable |\n| | lc_time_names). |\n+---------------------------+-------------------------------------------------+\n| %r | Time in 12 hour format, followed by AM/PM. |\n| | Short for \'%I:%i:%S %p\'. |\n+---------------------------+-------------------------------------------------+\n| %S | Seconds with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %s | Seconds with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %T | Time in 24 hour format. Short for \'%H:%i:%S\'. |\n+---------------------------+-------------------------------------------------+\n| %U | Week number (00-53), when first day of the |\n| | week is Sunday. |\n+---------------------------+-------------------------------------------------+\n| %u | Week number (00-53), when first day of the |\n| | week is Monday. |\n+---------------------------+-------------------------------------------------+\n| %V | Week number (01-53), when first day of the |\n| | week is Sunday. Used with %X. |\n+---------------------------+-------------------------------------------------+\n| %v | Week number (01-53), when first day of the |\n| | week is Monday. Used with %x. |\n+---------------------------+-------------------------------------------------+\n| %W | Full weekday name in current locale (Variable |\n| | lc_time_names). |\n+---------------------------+-------------------------------------------------+\n| %w | Day of the week. 0 = Sunday, 6 = Saturday. |\n+---------------------------+-------------------------------------------------+\n| %X | Year with 4 digits when first day of the week |\n| | is Sunday. Used with %V. |\n+---------------------------+-------------------------------------------------+\n| %x | Year with 4 digits when first day of the week |\n| | is Sunday. Used with %v. |\n+---------------------------+-------------------------------------------------+\n| %Y | Year with 4 digits. |\n+---------------------------+-------------------------------------------------+\n| %y | Year with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %# | For str_to_date(), skip all numbers. |\n+---------------------------+-------------------------------------------------+\n| %. | For str_to_date(), skip all punctation |\n| | characters. |\n+---------------------------+-------------------------------------------------+\n| %@ | For str_to_date(), skip all alpha characters. |\n+---------------------------+-------------------------------------------------+\n| %% | A literal % character. |\n+---------------------------+-------------------------------------------------+\n\nPerformance Considerations\n--------------------------\n\nIf your session time zone is set to SYSTEM (the default), FROM_UNIXTIME() will\ncall the OS function to convert the data using the system time zone. At least\non Linux, the corresponding function (localtime_r) uses a global mutex inside\nglibc that can cause contention under high concurrent load.\n\nSet your time zone to a named time zone to avoid this issue. See mysql time\nzone tables for details on how to do this.\n\nExamples\n--------\n\nSELECT FROM_UNIXTIME(1196440219);\n+---------------------------+\n| FROM_UNIXTIME(1196440219) |\n+---------------------------+\n| 2007-11-30 11:30:19 |\n+---------------------------+\n\nSELECT FROM_UNIXTIME(1196440219) + 0;\n+-------------------------------+\n| FROM_UNIXTIME(1196440219) + 0 |\n+-------------------------------+\n| 20071130113019.000000 |\n+-------------------------------+\n\nSELECT FROM_UNIXTIME(UNIX_TIMESTAMP(), \'%Y %D %M %h:%i:%s %x\');\n+---------------------------------------------------------+\n| FROM_UNIXTIME(UNIX_TIMESTAMP(), \'%Y %D %M %h:%i:%s %x\') |\n+---------------------------------------------------------+\n| 2010 27th March 01:03:47 2010 |\n+---------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/from_unixtime/','','https://mariadb.com/kb/en/from_unixtime/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (486,31,'GET_FORMAT','Syntax\n------\n\nGET_FORMAT({DATE|DATETIME|TIME}, {\'EUR\'|\'USA\'|\'JIS\'|\'ISO\'|\'INTERNAL\'})\n\nDescription\n-----------\n\nReturns a format string. This function is useful in combination with the\nDATE_FORMAT() and the STR_TO_DATE() functions.\n\nPossible result formats are:\n\n+--------------------------------------+--------------------------------------+\n| Function Call | Result Format |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATE,\'EUR\') | \'%d.%m.%Y\' |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATE,\'USA\') | \'%m.%d.%Y\' |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATE,\'JIS\') | \'%Y-%m-%d\' |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATE,\'ISO\') | \'%Y-%m-%d\' |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATE,\'INTERNAL\') | \'%Y%m%d\' |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATETIME,\'EUR\') | \'%Y-%m-%d %H.%i.%s\' |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATETIME,\'USA\') | \'%Y-%m-%d %H.%i.%s\' |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATETIME,\'JIS\') | \'%Y-%m-%d %H:%i:%s\' |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATETIME,\'ISO\') | \'%Y-%m-%d %H:%i:%s\' |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(DATETIME,\'INTERNAL\') | \'%Y%m%d%H%i%s\' |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(TIME,\'EUR\') | \'%H.%i.%s\' |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(TIME,\'USA\') | \'%h:%i:%s %p\' |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(TIME,\'JIS\') | \'%H:%i:%s\' |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(TIME,\'ISO\') | \'%H:%i:%s\' |\n+--------------------------------------+--------------------------------------+\n| GET_FORMAT(TIME,\'INTERNAL\') | \'%H%i%s\' |\n+--------------------------------------+--------------------------------------+\n\nExamples\n--------\n\nObtaining the string matching to the standard European date format:\n\nSELECT GET_FORMAT(DATE, \'EUR\');\n+-------------------------+\n| GET_FORMAT(DATE, \'EUR\') |\n+-------------------------+\n| %d.%m.%Y |\n+-------------------------+\n\nUsing the same string to format a date:\n\nSELECT DATE_FORMAT(\'2003-10-03\',GET_FORMAT(DATE,\'EUR\'));\n+--------------------------------------------------+\n| DATE_FORMAT(\'2003-10-03\',GET_FORMAT(DATE,\'EUR\')) |\n+--------------------------------------------------+\n| 03.10.2003 |\n+--------------------------------------------------+\n\nSELECT STR_TO_DATE(\'10.31.2003\',GET_FORMAT(DATE,\'USA\'));\n+--------------------------------------------------+\n| STR_TO_DATE(\'10.31.2003\',GET_FORMAT(DATE,\'USA\')) |\n+--------------------------------------------------+\n| 2003-10-31 |\n+--------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/get_format/','','https://mariadb.com/kb/en/get_format/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (487,31,'HOUR','Syntax\n------\n\nHOUR(time)\n\nDescription\n-----------\n\nReturns the hour for time. The range of the return value is 0 to 23 for\ntime-of-day values. However, the range of TIME values actually is much larger,\nso HOUR can return values greater than 23.\n\nThe return value is always positive, even if a negative TIME value is provided.\n\nExamples\n--------\n\nSELECT HOUR(\'10:05:03\');\n+------------------+\n| HOUR(\'10:05:03\') |\n+------------------+\n| 10 |\n+------------------+\n\nSELECT HOUR(\'272:59:59\');\n+-------------------+\n| HOUR(\'272:59:59\') |\n+-------------------+\n| 272 |\n+-------------------+\n\nDifference between EXTRACT (HOUR FROM ...) (>= MariaDB 10.0.7 and MariaDB\n5.5.35) and HOUR:\n\nSELECT EXTRACT(HOUR FROM \'26:30:00\'), HOUR(\'26:30:00\');\n+-------------------------------+------------------+\n| EXTRACT(HOUR FROM \'26:30:00\') | HOUR(\'26:30:00\') |\n+-------------------------------+------------------+\n| 2 | 26 |\n+-------------------------------+------------------+\n\n\n\nURL: mariadb.com/kb/en/hour/','','https://mariadb.com/kb/en/hour/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (488,31,'LAST_DAY','Syntax\n------\n\nLAST_DAY(date)\n\nDescription\n-----------\n\nTakes a date or datetime value and returns the corresponding value for the\nlast day of the month. Returns NULL if the argument is invalid.\n\nExamples\n--------\n\nSELECT LAST_DAY(\'2003-02-05\');\n+------------------------+\n| LAST_DAY(\'2003-02-05\') |\n+------------------------+\n| 2003-02-28 |\n+------------------------+\n\nSELECT LAST_DAY(\'2004-02-05\');\n+------------------------+\n| LAST_DAY(\'2004-02-05\') |\n+------------------------+\n| 2004-02-29 |\n+------------------------+\n\nSELECT LAST_DAY(\'2004-01-01 01:01:01\');\n+---------------------------------+\n| LAST_DAY(\'2004-01-01 01:01:01\') |\n+---------------------------------+\n| 2004-01-31 |\n+---------------------------------+\n\nSELECT LAST_DAY(\'2003-03-32\');\n+------------------------+\n| LAST_DAY(\'2003-03-32\') |\n+------------------------+\n| NULL |\n+------------------------+\n1 row in set, 1 warning (0.00 sec)\n\nWarning (Code 1292): Incorrect datetime value: \'2003-03-32\'\n\n\n\nURL: mariadb.com/kb/en/last_day/','','https://mariadb.com/kb/en/last_day/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (489,31,'LOCALTIME','Syntax\n------\n\nLOCALTIME\nLOCALTIME([precision])\n\nDescription\n-----------\n\nLOCALTIME and LOCALTIME() are synonyms for NOW().\n\n\n\nURL: mariadb.com/kb/en/localtime/','','https://mariadb.com/kb/en/localtime/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (490,31,'LOCALTIMESTAMP','Syntax\n------\n\nLOCALTIMESTAMP\nLOCALTIMESTAMP([precision])\n\nDescription\n-----------\n\nLOCALTIMESTAMP and LOCALTIMESTAMP() are synonyms for NOW().\n\n\n\nURL: mariadb.com/kb/en/localtimestamp/','','https://mariadb.com/kb/en/localtimestamp/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (491,31,'MAKEDATE','Syntax\n------\n\nMAKEDATE(year,dayofyear)\n\nDescription\n-----------\n\nReturns a date, given year and day-of-year values. dayofyear must be greater\nthan 0 or the result is NULL.\n\nExamples\n--------\n\nSELECT MAKEDATE(2011,31), MAKEDATE(2011,32);\n+-------------------+-------------------+\n| MAKEDATE(2011,31) | MAKEDATE(2011,32) |\n+-------------------+-------------------+\n| 2011-01-31 | 2011-02-01 |\n+-------------------+-------------------+\n\nSELECT MAKEDATE(2011,365), MAKEDATE(2014,365);\n+--------------------+--------------------+\n| MAKEDATE(2011,365) | MAKEDATE(2014,365) |\n+--------------------+--------------------+\n| 2011-12-31 | 2014-12-31 |\n+--------------------+--------------------+\n\nSELECT MAKEDATE(2011,0);\n+------------------+\n| MAKEDATE(2011,0) |\n+------------------+\n| NULL |\n+------------------+\n\n\n\nURL: mariadb.com/kb/en/makedate/','','https://mariadb.com/kb/en/makedate/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (492,31,'MAKETIME','Syntax\n------\n\nMAKETIME(hour,minute,second)\n\nDescription\n-----------\n\nReturns a time value calculated from the hour, minute, and second arguments.\n\nIf minute or second are out of the range 0 to 60, NULL is returned. The hour\ncan be in the range -838 to 838, outside of which the value is truncated with\na warning.\n\nExamples\n--------\n\nSELECT MAKETIME(13,57,33);\n+--------------------+\n| MAKETIME(13,57,33) |\n+--------------------+\n| 13:57:33 |\n+--------------------+\n\nSELECT MAKETIME(-13,57,33);\n+---------------------+\n| MAKETIME(-13,57,33) |\n+---------------------+\n| -13:57:33 |\n+---------------------+\n\nSELECT MAKETIME(13,67,33);\n+--------------------+\n| MAKETIME(13,67,33) |\n+--------------------+\n| NULL |\n+--------------------+\n\nSELECT MAKETIME(-1000,57,33);\n+-----------------------+\n| MAKETIME(-1000,57,33) |\n+-----------------------+\n| -838:59:59 |\n+-----------------------+\n1 row in set, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+---------+------+-----------------------------------------------+\n| Level | Code | Message |\n+---------+------+-----------------------------------------------+\n| Warning | 1292 | Truncated incorrect time value: \'-1000:57:33\' |\n+---------+------+-----------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/maketime/','','https://mariadb.com/kb/en/maketime/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (493,31,'MICROSECOND','Syntax\n------\n\nMICROSECOND(expr)\n\nDescription\n-----------\n\nReturns the microseconds from the time or datetime expression expr as a number\nin the range from 0 to 999999.\n\nIf expr is a time with no microseconds, zero is returned, while if expr is a\ndate with no time, zero with a warning is returned.\n\nExamples\n--------\n\nSELECT MICROSECOND(\'12:00:00.123456\');\n+--------------------------------+\n| MICROSECOND(\'12:00:00.123456\') |\n+--------------------------------+\n| 123456 |\n+--------------------------------+\n\nSELECT MICROSECOND(\'2009-12-31 23:59:59.000010\');\n+-------------------------------------------+\n| MICROSECOND(\'2009-12-31 23:59:59.000010\') |\n+-------------------------------------------+\n| 10 |\n+-------------------------------------------+\n\nSELECT MICROSECOND(\'2013-08-07 12:13:14\');\n+------------------------------------+\n| MICROSECOND(\'2013-08-07 12:13:14\') |\n+------------------------------------+\n| 0 |\n+------------------------------------+\n\nSELECT MICROSECOND(\'2013-08-07\');\n+---------------------------+\n| MICROSECOND(\'2013-08-07\') |\n+---------------------------+\n| 0 |\n+---------------------------+\n1 row in set, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+---------+------+----------------------------------------------+\n| Level | Code | Message |\n+---------+------+----------------------------------------------+\n| Warning | 1292 | Truncated incorrect time value: \'2013-08-07\' |\n+---------+------+----------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/microsecond/','','https://mariadb.com/kb/en/microsecond/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (494,31,'MINUTE','Syntax\n------\n\nMINUTE(time)\n\nDescription\n-----------\n\nReturns the minute for time, in the range 0 to 59.\n\nExamples\n--------\n\nSELECT MINUTE(\'2013-08-03 11:04:03\');\n+-------------------------------+\n| MINUTE(\'2013-08-03 11:04:03\') |\n+-------------------------------+\n| 4 |\n+-------------------------------+\n\nSELECT MINUTE (\'23:12:50\');\n+---------------------+\n| MINUTE (\'23:12:50\') |\n+---------------------+\n| 12 |\n+---------------------+\n\n\n\nURL: mariadb.com/kb/en/minute/','','https://mariadb.com/kb/en/minute/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (495,31,'MONTH','Syntax\n------\n\nMONTH(date)\n\nDescription\n-----------\n\nReturns the month for date in the range 1 to 12 for January to December, or 0\nfor dates such as \'0000-00-00\' or \'2008-00-00\' that have a zero month part.\n\nExamples\n--------\n\nSELECT MONTH(\'2019-01-03\');\n+---------------------+\n| MONTH(\'2019-01-03\') |\n+---------------------+\n| 1 |\n+---------------------+\n\nSELECT MONTH(\'2019-00-03\');\n+---------------------+\n| MONTH(\'2019-00-03\') |\n+---------------------+\n| 0 |\n+---------------------+\n\n\n\nURL: mariadb.com/kb/en/month/','','https://mariadb.com/kb/en/month/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (496,31,'MONTHNAME','Syntax\n------\n\nMONTHNAME(date)\n\nDescription\n-----------\n\nReturns the full name of the month for date. The language used for the name is\ncontrolled by the value of the lc_time_names system variable. See server\nlocale for more on the supported locales.\n\nExamples\n--------\n\nSELECT MONTHNAME(\'2019-02-03\');\n+-------------------------+\n| MONTHNAME(\'2019-02-03\') |\n+-------------------------+\n| February |\n+-------------------------+\n\nChanging the locale:\n\nSET lc_time_names = \'fr_CA\';\n\nSELECT MONTHNAME(\'2019-05-21\');\n+-------------------------+\n| MONTHNAME(\'2019-05-21\') |\n+-------------------------+\n| mai |\n+-------------------------+\n\n\n\nURL: mariadb.com/kb/en/monthname/','','https://mariadb.com/kb/en/monthname/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (497,31,'NOW','Syntax\n------\n\nNOW([precision])\nCURRENT_TIMESTAMP\nCURRENT_TIMESTAMP([precision])\nLOCALTIME, LOCALTIME([precision])\nLOCALTIMESTAMP\nLOCALTIMESTAMP([precision])\n\nDescription\n-----------\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\' or\nYYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is used in a\nstring or numeric context. The value is expressed in the current time zone.\n\nThe optional precision determines the microsecond precision. See Microseconds\nin MariaDB.\n\nNOW() (or its synonyms) can be used as the default value for TIMESTAMP columns\nas well as, since MariaDB 10.0.1, DATETIME columns. Before MariaDB 10.0.1, it\nwas only possible for a single TIMESTAMP column per table to contain the\nCURRENT_TIMESTAMP as its default.\n\nWhen displayed in the INFORMATION_SCHEMA.COLUMNS table, a default CURRENT\nTIMESTAMP is displayed as CURRENT_TIMESTAMP up until MariaDB 10.2.2, and as\ncurrent_timestamp() from MariaDB 10.2.3, due to to MariaDB 10.2 accepting\nexpressions in the DEFAULT clause.\n\nExamples\n--------\n\nSELECT NOW();\n+---------------------+\n| NOW() |\n+---------------------+\n| 2010-03-27 13:13:25 |\n+---------------------+\n\nSELECT NOW() + 0;\n+-----------------------+\n| NOW() + 0 |\n+-----------------------+\n| 20100327131329.000000 |\n+-----------------------+\n\nWith precision:\n\nSELECT CURRENT_TIMESTAMP(2);\n+------------------------+\n| CURRENT_TIMESTAMP(2) |\n+------------------------+\n| 2018-07-10 09:47:26.24 |\n+------------------------+\n\nUsed as a default TIMESTAMP:\n\nCREATE TABLE t (createdTS TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);\n\nFrom MariaDB 10.2.2:\n\nSELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=\'test\'\n AND COLUMN_NAME LIKE \'%ts%\'\G\n*************************** 1. row ***************************\n TABLE_CATALOG: def\n TABLE_SCHEMA: test\n TABLE_NAME: t\n COLUMN_NAME: ts\n ORDINAL_POSITION: 1\n COLUMN_DEFAULT: current_timestamp()\n...\n\n<= MariaDB 10.2.1\n\nSELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA=\'test\'\n AND COLUMN_NAME LIKE \'%ts%\'\G\n*************************** 1. row ***************************\n TABLE_CATALOG: def\n TABLE_SCHEMA: test\n TABLE_NAME: t\n COLUMN_NAME: createdTS\n ORDINAL_POSITION: 1\n COLUMN_DEFAULT: CURRENT_TIMESTAMP\n...\n\n\n\nURL: mariadb.com/kb/en/now/','','https://mariadb.com/kb/en/now/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (498,31,'PERIOD_ADD','Syntax\n------\n\nPERIOD_ADD(P,N)\n\nDescription\n-----------\n\nAdds N months to period P. P is in the format YYMM or YYYYMM, and is not a\ndate value. If P contains a two-digit year, values from 00 to 69 are converted\nto from 2000 to 2069, while values from 70 are converted to 1970 upwards.\n\nReturns a value in the format YYYYMM.\n\nExamples\n--------\n\nSELECT PERIOD_ADD(200801,2);\n+----------------------+\n| PERIOD_ADD(200801,2) |\n+----------------------+\n| 200803 |\n+----------------------+\n\nSELECT PERIOD_ADD(6910,2);\n+--------------------+\n| PERIOD_ADD(6910,2) |\n+--------------------+\n| 206912 |\n+--------------------+\n\nSELECT PERIOD_ADD(7010,2);\n+--------------------+\n| PERIOD_ADD(7010,2) |\n+--------------------+\n| 197012 |\n+--------------------+\n\n\n\nURL: mariadb.com/kb/en/period_add/','','https://mariadb.com/kb/en/period_add/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (499,31,'PERIOD_DIFF','Syntax\n------\n\nPERIOD_DIFF(P1,P2)\n\nDescription\n-----------\n\nReturns the number of months between periods P1 and P2. P1 and P2 can be in\nthe format YYMM or YYYYMM, and are not date values.\n\nIf P1 or P2 contains a two-digit year, values from 00 to 69 are converted to\nfrom 2000 to 2069, while values from 70 are converted to 1970 upwards.\n\nExamples\n--------\n\nSELECT PERIOD_DIFF(200802,200703);\n+----------------------------+\n| PERIOD_DIFF(200802,200703) |\n+----------------------------+\n| 11 |\n+----------------------------+\n\nSELECT PERIOD_DIFF(6902,6803);\n+------------------------+\n| PERIOD_DIFF(6902,6803) |\n+------------------------+\n| 11 |\n+------------------------+\n\nSELECT PERIOD_DIFF(7002,6803);\n+------------------------+\n| PERIOD_DIFF(7002,6803) |\n+------------------------+\n| -1177 |\n+------------------------+\n\n\n\nURL: mariadb.com/kb/en/period_diff/','','https://mariadb.com/kb/en/period_diff/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (500,31,'QUARTER','Syntax\n------\n\nQUARTER(date)\n\nDescription\n-----------\n\nReturns the quarter of the year for date, in the range 1 to 4. Returns 0 if\nmonth contains a zero value, or NULL if the given value is not otherwise a\nvalid date (zero values are accepted).\n\nExamples\n--------\n\nSELECT QUARTER(\'2008-04-01\');\n+-----------------------+\n| QUARTER(\'2008-04-01\') |\n+-----------------------+\n| 2 |\n+-----------------------+\n\nSELECT QUARTER(\'2019-00-01\');\n+-----------------------+\n| QUARTER(\'2019-00-01\') |\n+-----------------------+\n| 0 |\n+-----------------------+\n\n\n\nURL: mariadb.com/kb/en/quarter/','','https://mariadb.com/kb/en/quarter/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (501,31,'SECOND','Syntax\n------\n\nSECOND(time)\n\nDescription\n-----------\n\nReturns the second for a given time (which can include microseconds), in the\nrange 0 to 59, or NULL if not given a valid time value.\n\nExamples\n--------\n\nSELECT SECOND(\'10:05:03\');\n+--------------------+\n| SECOND(\'10:05:03\') |\n+--------------------+\n| 3 |\n+--------------------+\n\nSELECT SECOND(\'10:05:01.999999\');\n+---------------------------+\n| SECOND(\'10:05:01.999999\') |\n+---------------------------+\n| 1 |\n+---------------------------+\n\n\n\nURL: mariadb.com/kb/en/second/','','https://mariadb.com/kb/en/second/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (502,31,'SEC_TO_TIME','Syntax\n------\n\nSEC_TO_TIME(seconds)\n\nDescription\n-----------\n\nReturns the seconds argument, converted to hours, minutes, and seconds, as a\nTIME value. The range of the result is constrained to that of the TIME data\ntype. A warning occurs if the argument corresponds to a value outside that\nrange.\n\nThe time will be returned in the format hh:mm:ss, or hhmmss if used in a\nnumeric calculation.\n\nExamples\n--------\n\nSELECT SEC_TO_TIME(12414);\n+--------------------+\n| SEC_TO_TIME(12414) |\n+--------------------+\n| 03:26:54 |\n+--------------------+\n\nSELECT SEC_TO_TIME(12414)+0;\n+----------------------+\n| SEC_TO_TIME(12414)+0 |\n+----------------------+\n| 32654 |\n+----------------------+\n\nSELECT SEC_TO_TIME(9999999);\n+----------------------+\n| SEC_TO_TIME(9999999) |\n+----------------------+\n| 838:59:59 |\n+----------------------+\n1 row in set, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+---------+------+-------------------------------------------+\n| Level | Code | Message |\n+---------+------+-------------------------------------------+\n| Warning | 1292 | Truncated incorrect time value: \'9999999\' |\n+---------+------+-------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/sec_to_time/','','https://mariadb.com/kb/en/sec_to_time/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (503,31,'STR_TO_DATE','Syntax\n------\n\nSTR_TO_DATE(str,format)\n\nDescription\n-----------\n\nThis is the inverse of the DATE_FORMAT() function. It takes a string str and a\nformat string format. STR_TO_DATE() returns a DATETIME value if the format\nstring contains both date and time parts, or a DATE or TIME value if the\nstring contains only date or time parts.\n\nThe date, time, or datetime values contained in str should be given in the\nformat indicated by format. If str contains an illegal date, time, or datetime\nvalue, STR_TO_DATE() returns NULL. An illegal value also produces a warning.\n\nThe options that can be used by STR_TO_DATE(), as well as its inverse\nDATE_FORMAT() and the FROM_UNIXTIME() function, are:\n\n+---------------------------+-------------------------------------------------+\n| Option | Description |\n+---------------------------+-------------------------------------------------+\n| %a | Short weekday name in current locale (Variable |\n| | lc_time_names). |\n+---------------------------+-------------------------------------------------+\n| %b | Short form month name in current locale. For |\n| | locale en_US this is one of: |\n| | Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov or |\n| | Dec. |\n+---------------------------+-------------------------------------------------+\n| %c | Month with 1 or 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %D | Day with English suffix \'th\', \'nd\', \'st\' or |\n| | \'rd\'\'. (1st, 2nd, 3rd...). |\n+---------------------------+-------------------------------------------------+\n| %d | Day with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %e | Day with 1 or 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %f | Microseconds 6 digits. |\n+---------------------------+-------------------------------------------------+\n| %H | Hour with 2 digits between 00-23. |\n+---------------------------+-------------------------------------------------+\n| %h | Hour with 2 digits between 01-12. |\n+---------------------------+-------------------------------------------------+\n| %I | Hour with 2 digits between 01-12. |\n+---------------------------+-------------------------------------------------+\n| %i | Minute with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %j | Day of the year (001-366) |\n+---------------------------+-------------------------------------------------+\n| %k | Hour with 1 digits between 0-23. |\n+---------------------------+-------------------------------------------------+\n| %l | Hour with 1 digits between 1-12. |\n+---------------------------+-------------------------------------------------+\n| %M | Full month name in current locale (Variable |\n| | lc_time_names). |\n+---------------------------+-------------------------------------------------+\n| %m | Month with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %p | AM/PM according to current locale (Variable |\n| | lc_time_names). |\n+---------------------------+-------------------------------------------------+\n| %r | Time in 12 hour format, followed by AM/PM. |\n| | Short for \'%I:%i:%S %p\'. |\n+---------------------------+-------------------------------------------------+\n| %S | Seconds with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %s | Seconds with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %T | Time in 24 hour format. Short for \'%H:%i:%S\'. |\n+---------------------------+-------------------------------------------------+\n| %U | Week number (00-53), when first day of the |\n| | week is Sunday. |\n+---------------------------+-------------------------------------------------+\n| %u | Week number (00-53), when first day of the |\n| | week is Monday. |\n+---------------------------+-------------------------------------------------+\n| %V | Week number (01-53), when first day of the |\n| | week is Sunday. Used with %X. |\n+---------------------------+-------------------------------------------------+\n| %v | Week number (01-53), when first day of the |\n| | week is Monday. Used with %x. |\n+---------------------------+-------------------------------------------------+\n| %W | Full weekday name in current locale (Variable |\n| | lc_time_names). |\n+---------------------------+-------------------------------------------------+\n| %w | Day of the week. 0 = Sunday, 6 = Saturday. |\n+---------------------------+-------------------------------------------------+\n| %X | Year with 4 digits when first day of the week |\n| | is Sunday. Used with %V. |\n+---------------------------+-------------------------------------------------+\n| %x | Year with 4 digits when first day of the week |\n| | is Monday. Used with %v. |\n+---------------------------+-------------------------------------------------+\n| %Y | Year with 4 digits. |\n+---------------------------+-------------------------------------------------+\n| %y | Year with 2 digits. |\n+---------------------------+-------------------------------------------------+\n| %# | For str_to_date(), skip all numbers. |\n+---------------------------+-------------------------------------------------+\n| %. | For str_to_date(), skip all punctation |\n| | characters. |\n+---------------------------+-------------------------------------------------+\n| %@ | For str_to_date(), skip all alpha characters. |\n+---------------------------+-------------------------------------------------+\n| %% | A literal % character. |\n+---------------------------+-------------------------------------------------+\n\nExamples\n--------\n\nSELECT STR_TO_DATE(\'Wednesday, June 2, 2014\', \'%W, %M %e, %Y\');\n+---------------------------------------------------------+\n| STR_TO_DATE(\'Wednesday, June 2, 2014\', \'%W, %M %e, %Y\') |\n+---------------------------------------------------------+\n| 2014-06-02 |\n+---------------------------------------------------------+\n\nSELECT STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W, %M %e, %Y\');\n+--------------------------------------------------------------+\n| STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W, %M %e, %Y\') |\n+--------------------------------------------------------------+\n| NULL |\n+--------------------------------------------------------------+\n1 row in set, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+---------+------+-------------------------------------------------------------\n---------------------+\n| Level | Code | Message \n |\n+---------+------+-------------------------------------------------------------\n---------------------+\n| Warning | 1411 | Incorrect datetime value: \'Wednesday23423, June 2, 2014\'\nfor function str_to_date |\n+---------+------+-------------------------------------------------------------\n---------------------+\n\nSELECT STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W%#, %M %e, %Y\');\n+----------------------------------------------------------------+\n| STR_TO_DATE(\'Wednesday23423, June 2, 2014\', \'%W%#, %M %e, %Y\') |\n+----------------------------------------------------------------+\n| 2014-06-02 |\n+----------------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/str_to_date/','','https://mariadb.com/kb/en/str_to_date/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (504,31,'SUBDATE','Syntax\n------\n\nSUBDATE(date,INTERVAL expr unit), SUBDATE(expr,days)\n\nDescription\n-----------\n\nWhen invoked with the INTERVAL form of the second argument, SUBDATE() is a\nsynonym for DATE_SUB(). See Date and Time Units for a complete list of\npermitted units.\n\nThe second form allows the use of an integer value for days. In such cases, it\nis interpreted as the number of days to be subtracted from the date or\ndatetime expression expr.\n\nExamples\n--------\n\nSELECT DATE_SUB(\'2008-01-02\', INTERVAL 31 DAY);\n+-----------------------------------------+\n| DATE_SUB(\'2008-01-02\', INTERVAL 31 DAY) |\n+-----------------------------------------+\n| 2007-12-02 |\n+-----------------------------------------+\n\nSELECT SUBDATE(\'2008-01-02\', INTERVAL 31 DAY);\n+----------------------------------------+\n| SUBDATE(\'2008-01-02\', INTERVAL 31 DAY) |\n+----------------------------------------+\n| 2007-12-02 |\n+----------------------------------------+\n\nSELECT SUBDATE(\'2008-01-02 12:00:00\', 31);\n+------------------------------------+\n| SUBDATE(\'2008-01-02 12:00:00\', 31) |\n+------------------------------------+\n| 2007-12-02 12:00:00 |\n+------------------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n ("2007-01-30 21:31:07"),\n ("1983-10-15 06:42:51"),\n ("2011-04-21 12:34:56"),\n ("2011-10-30 06:31:41"),\n ("2011-01-30 14:03:25"),\n ("2004-10-07 11:19:34");\n\nSELECT d, SUBDATE(d, 10) from t1;\n+---------------------+---------------------+\n| d | SUBDATE(d, 10) |\n+---------------------+---------------------+\n| 2007-01-30 21:31:07 | 2007-01-20 21:31:07 |\n| 1983-10-15 06:42:51 | 1983-10-05 06:42:51 |\n| 2011-04-21 12:34:56 | 2011-04-11 12:34:56 |\n| 2011-10-30 06:31:41 | 2011-10-20 06:31:41 |\n| 2011-01-30 14:03:25 | 2011-01-20 14:03:25 |\n| 2004-10-07 11:19:34 | 2004-09-27 11:19:34 |\n+---------------------+---------------------+\n\nSELECT d, SUBDATE(d, INTERVAL 10 MINUTE) from t1;\n+---------------------+--------------------------------+\n| d | SUBDATE(d, INTERVAL 10 MINUTE) |\n+---------------------+--------------------------------+\n| 2007-01-30 21:31:07 | 2007-01-30 21:21:07 |\n| 1983-10-15 06:42:51 | 1983-10-15 06:32:51 |\n| 2011-04-21 12:34:56 | 2011-04-21 12:24:56 |\n| 2011-10-30 06:31:41 | 2011-10-30 06:21:41 |\n| 2011-01-30 14:03:25 | 2011-01-30 13:53:25 |\n| 2004-10-07 11:19:34 | 2004-10-07 11:09:34 |\n+---------------------+--------------------------------+\n\n\n\nURL: mariadb.com/kb/en/subdate/','','https://mariadb.com/kb/en/subdate/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (505,31,'SUBTIME','Syntax\n------\n\nSUBTIME(expr1,expr2)\n\nDescription\n-----------\n\nSUBTIME() returns expr1 - expr2 expressed as a value in the same format as\nexpr1. expr1 is a time or datetime expression, and expr2 is a time expression.\n\nExamples\n--------\n\nSELECT SUBTIME(\'2007-12-31 23:59:59.999999\',\'1 1:1:1.000002\');\n+--------------------------------------------------------+\n| SUBTIME(\'2007-12-31 23:59:59.999999\',\'1 1:1:1.000002\') |\n+--------------------------------------------------------+\n| 2007-12-30 22:58:58.999997 |\n+--------------------------------------------------------+\n\nSELECT SUBTIME(\'01:00:00.999999\', \'02:00:00.999998\');\n+-----------------------------------------------+\n| SUBTIME(\'01:00:00.999999\', \'02:00:00.999998\') |\n+-----------------------------------------------+\n| -00:59:59.999999 |\n+-----------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/subtime/','','https://mariadb.com/kb/en/subtime/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (506,31,'SYSDATE','Syntax\n------\n\nSYSDATE([precision])\n\nDescription\n-----------\n\nReturns the current date and time as a value in \'YYYY-MM-DD HH:MM:SS\' or\nYYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is used in a\nstring or numeric context.\n\nThe optional precision determines the microsecond precision. See Microseconds\nin MariaDB.\n\nSYSDATE() returns the time at which it executes. This differs from the\nbehavior for NOW(), which returns a constant time that indicates the time at\nwhich the statement began to execute. (Within a stored routine or trigger,\nNOW() returns the time at which the routine or triggering statement began to\nexecute.)\n\nIn addition, changing the timestamp system variable with a SET timestamp\nstatement affects the value returned by NOW() but not by SYSDATE(). This means\nthat timestamp settings in the binary log have no effect on invocations of\nSYSDATE().\n\nBecause SYSDATE() can return different values even within the same statement,\nand is not affected by SET TIMESTAMP, it is non-deterministic and therefore\nunsafe for replication if statement-based binary logging is used. If that is a\nproblem, you can use row-based logging, or start the server with the mysqld\noption --sysdate-is-now to cause SYSDATE() to be an alias for NOW(). The\nnon-deterministic nature of SYSDATE() also means that indexes cannot be used\nfor evaluating expressions that refer to it, and that statements using the\nSYSDATE() function are unsafe for statement-based replication.\n\nExamples\n--------\n\nDifference between NOW() and SYSDATE():\n\nSELECT NOW(), SLEEP(2), NOW();\n+---------------------+----------+---------------------+\n| NOW() | SLEEP(2) | NOW() |\n+---------------------+----------+---------------------+\n| 2010-03-27 13:23:40 | 0 | 2010-03-27 13:23:40 |\n+---------------------+----------+---------------------+\n\nSELECT SYSDATE(), SLEEP(2), SYSDATE();\n+---------------------+----------+---------------------+\n| SYSDATE() | SLEEP(2) | SYSDATE() |\n+---------------------+----------+---------------------+\n| 2010-03-27 13:23:52 | 0 | 2010-03-27 13:23:54 |\n+---------------------+----------+---------------------+\n\nWith precision:\n\nSELECT SYSDATE(4);\n+--------------------------+\n| SYSDATE(4) |\n+--------------------------+\n| 2018-07-10 10:17:13.1689 |\n+--------------------------+\n\n\n\nURL: mariadb.com/kb/en/sysdate/','','https://mariadb.com/kb/en/sysdate/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (507,31,'TIME Function','Syntax\n------\n\nTIME(expr)\n\nDescription\n-----------\n\nExtracts the time part of the time or datetime expression expr and returns it\nas a string.\n\nExamples\n--------\n\nSELECT TIME(\'2003-12-31 01:02:03\');\n+-----------------------------+\n| TIME(\'2003-12-31 01:02:03\') |\n+-----------------------------+\n| 01:02:03 |\n+-----------------------------+\n\nSELECT TIME(\'2003-12-31 01:02:03.000123\');\n+------------------------------------+\n| TIME(\'2003-12-31 01:02:03.000123\') |\n+------------------------------------+\n| 01:02:03.000123 |\n+------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/time-function/','','https://mariadb.com/kb/en/time-function/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (508,31,'TIMEDIFF','Syntax\n------\n\nTIMEDIFF(expr1,expr2)\n\nDescription\n-----------\n\nTIMEDIFF() returns expr1 - expr2 expressed as a time value. expr1 and expr2\nare time or date-and-time expressions, but both must be of the same type.\n\nExamples\n--------\n\nSELECT TIMEDIFF(\'2000:01:01 00:00:00\', \'2000:01:01 00:00:00.000001\');\n+---------------------------------------------------------------+\n| TIMEDIFF(\'2000:01:01 00:00:00\', \'2000:01:01 00:00:00.000001\') |\n+---------------------------------------------------------------+\n| -00:00:00.000001 |\n+---------------------------------------------------------------+\n\nSELECT TIMEDIFF(\'2008-12-31 23:59:59.000001\', \'2008-12-30 01:01:01.000002\');\n+----------------------------------------------------------------------+\n| TIMEDIFF(\'2008-12-31 23:59:59.000001\', \'2008-12-30 01:01:01.000002\') |\n+----------------------------------------------------------------------+\n| 46:58:57.999999 |\n+----------------------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/timediff/','','https://mariadb.com/kb/en/timediff/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (509,31,'TIMESTAMP FUNCTION','Syntax\n------\n\nTIMESTAMP(expr), TIMESTAMP(expr1,expr2)\n\nDescription\n-----------\n\nWith a single argument, this function returns the date or datetime expression\nexpr as a datetime value. With two arguments, it adds the time expression\nexpr2 to the date or datetime expression expr1 and returns the result as a\ndatetime value.\n\nExamples\n--------\n\nSELECT TIMESTAMP(\'2003-12-31\');\n+-------------------------+\n| TIMESTAMP(\'2003-12-31\') |\n+-------------------------+\n| 2003-12-31 00:00:00 |\n+-------------------------+\n\nSELECT TIMESTAMP(\'2003-12-31 12:00:00\',\'6:30:00\');\n+--------------------------------------------+\n| TIMESTAMP(\'2003-12-31 12:00:00\',\'6:30:00\') |\n+--------------------------------------------+\n| 2003-12-31 18:30:00 |\n+--------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/timestamp-function/','','https://mariadb.com/kb/en/timestamp-function/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (510,31,'TIMESTAMPADD','Syntax\n------\n\nTIMESTAMPADD(unit,interval,datetime_expr)\n\nDescription\n-----------\n\nAdds the integer expression interval to the date or datetime expression\ndatetime_expr. The unit for interval is given by the unit argument, which\nshould be one of the following values: MICROSECOND, SECOND, MINUTE, HOUR, DAY,\nWEEK, MONTH, QUARTER, or YEAR.\n\nThe unit value may be specified using one of keywords as shown, or with a\nprefix of SQL_TSI_. For example, DAY and SQL_TSI_DAY both are legal.\n\nBefore MariaDB 5.5, FRAC_SECOND was permitted as a synonym for MICROSECOND.\n\nExamples\n--------\n\nSELECT TIMESTAMPADD(MINUTE,1,\'2003-01-02\');\n+-------------------------------------+\n| TIMESTAMPADD(MINUTE,1,\'2003-01-02\') |\n+-------------------------------------+\n| 2003-01-02 00:01:00 |\n+-------------------------------------+\n\nSELECT TIMESTAMPADD(WEEK,1,\'2003-01-02\');\n+-----------------------------------+\n| TIMESTAMPADD(WEEK,1,\'2003-01-02\') |\n+-----------------------------------+\n| 2003-01-09 |\n+-----------------------------------+\n\n\n\nURL: mariadb.com/kb/en/timestampadd/','','https://mariadb.com/kb/en/timestampadd/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (511,31,'TIMESTAMPDIFF','Syntax\n------\n\nTIMESTAMPDIFF(unit,datetime_expr1,datetime_expr2)\n\nDescription\n-----------\n\nReturns datetime_expr2 - datetime_expr1, where datetime_expr1 and\ndatetime_expr2 are date or datetime expressions. One expression may be a date\nand the other a datetime; a date value is treated as a datetime having the\ntime part \'00:00:00\' where necessary. The unit for the result (an integer) is\ngiven by the unit argument. The legal values for unit are the same as those\nlisted in the description of the TIMESTAMPADD() function, i.e MICROSECOND,\nSECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, or YEAR.\n\nTIMESTAMPDIFF can also be used to calculate age.\n\nExamples\n--------\n\nSELECT TIMESTAMPDIFF(MONTH,\'2003-02-01\',\'2003-05-01\');\n+------------------------------------------------+\n| TIMESTAMPDIFF(MONTH,\'2003-02-01\',\'2003-05-01\') |\n+------------------------------------------------+\n| 3 |\n+------------------------------------------------+\n\nSELECT TIMESTAMPDIFF(YEAR,\'2002-05-01\',\'2001-01-01\');\n+-----------------------------------------------+\n| TIMESTAMPDIFF(YEAR,\'2002-05-01\',\'2001-01-01\') |\n+-----------------------------------------------+\n| -1 |\n+-----------------------------------------------+\n\nSELECT TIMESTAMPDIFF(MINUTE,\'2003-02-01\',\'2003-05-01 12:05:55\');\n+----------------------------------------------------------+\n| TIMESTAMPDIFF(MINUTE,\'2003-02-01\',\'2003-05-01 12:05:55\') |\n+----------------------------------------------------------+\n| 128885 |\n+----------------------------------------------------------+\n\nCalculating age:\n\nSELECT CURDATE();\n+------------+\n| CURDATE() |\n+------------+\n| 2019-05-27 |\n+------------+\n\nSELECT TIMESTAMPDIFF(YEAR, \'1971-06-06\', CURDATE()) AS age;\n+------+\n| age |\n+------+\n| 47 |\n+------+\n\nSELECT TIMESTAMPDIFF(YEAR, \'1971-05-06\', CURDATE()) AS age;\n+------+\n| age |\n+------+\n| 48 |\n+------+\n\nAge as of 2014-08-02:\n\nSELECT name, date_of_birth, TIMESTAMPDIFF(YEAR,date_of_birth,\'2014-08-02\') AS\nage \n FROM student_details;\n+---------+---------------+------+\n| name | date_of_birth | age |\n+---------+---------------+------+\n| Chun | 1993-12-31 | 20 |\n| Esben | 1946-01-01 | 68 |\n| Kaolin | 1996-07-16 | 18 |\n| Tatiana | 1988-04-13 | 26 |\n+---------+---------------+------+\n\n\n\nURL: mariadb.com/kb/en/timestampdiff/','','https://mariadb.com/kb/en/timestampdiff/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (512,31,'TIME_FORMAT','Syntax\n------\n\nTIME_FORMAT(time,format)\n\nDescription\n-----------\n\nThis is used like the DATE_FORMAT() function, but the format string may\ncontain format specifiers only for hours, minutes, and seconds. Other\nspecifiers produce a NULL value or 0.\n\nExamples\n--------\n\nSELECT TIME_FORMAT(\'100:00:00\', \'%H %k %h %I %l\');\n+--------------------------------------------+\n| TIME_FORMAT(\'100:00:00\', \'%H %k %h %I %l\') |\n+--------------------------------------------+\n| 100 100 04 04 4 |\n+--------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/time_format/','','https://mariadb.com/kb/en/time_format/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (513,31,'TIME_TO_SEC','Syntax\n------\n\nTIME_TO_SEC(time)\n\nDescription\n-----------\n\nReturns the time argument, converted to seconds.\n\nThe value returned by TIME_TO_SEC is of type DOUBLE. Before MariaDB 5.3 (and\nMySQL 5.6), the type was INT. The returned value preserves microseconds of the\nargument. See also Microseconds in MariaDB.\n\nExamples\n--------\n\nSELECT TIME_TO_SEC(\'22:23:00\');\n+-------------------------+\n| TIME_TO_SEC(\'22:23:00\') |\n+-------------------------+\n| 80580 |\n+-------------------------+\n\nSELECT TIME_TO_SEC(\'00:39:38\');\n+-------------------------+\n| TIME_TO_SEC(\'00:39:38\') |\n+-------------------------+\n| 2378 |\n+-------------------------+\n\nSELECT TIME_TO_SEC(\'09:12:55.2355\');\n+------------------------------+\n| TIME_TO_SEC(\'09:12:55.2355\') |\n+------------------------------+\n| 33175.2355 |\n+------------------------------+\n1 row in set (0.000 sec)\n\n\n\nURL: mariadb.com/kb/en/time_to_sec/','','https://mariadb.com/kb/en/time_to_sec/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (514,31,'TO_DAYS','Syntax\n------\n\nTO_DAYS(date)\n\nDescription\n-----------\n\nGiven a date date, returns the number of days since the start of the current\ncalendar (0000-00-00).\n\nThe function is not designed for use with dates before the advent of the\nGregorian calendar in October 1582. Results will not be reliable since it\ndoesn\'t account for the lost days when the calendar changed from the Julian\ncalendar.\n\nThis is the converse of the FROM_DAYS() function.\n\nExamples\n--------\n\nSELECT TO_DAYS(\'2007-10-07\');\n+-----------------------+\n| TO_DAYS(\'2007-10-07\') |\n+-----------------------+\n| 733321 |\n+-----------------------+\n\nSELECT TO_DAYS(\'0000-01-01\');\n+-----------------------+\n| TO_DAYS(\'0000-01-01\') |\n+-----------------------+\n| 1 |\n+-----------------------+\n\nSELECT TO_DAYS(950501);\n+-----------------+\n| TO_DAYS(950501) |\n+-----------------+\n| 728779 |\n+-----------------+\n\n\n\nURL: mariadb.com/kb/en/to_days/','','https://mariadb.com/kb/en/to_days/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (515,31,'TO_SECONDS','Syntax\n------\n\nTO_SECONDS(expr)\n\nDescription\n-----------\n\nReturns the number of seconds from year 0 till expr, or NULL if expr is not a\nvalid date or datetime.\n\nExamples\n--------\n\nSELECT TO_SECONDS(\'2013-06-13\');\n+--------------------------+\n| TO_SECONDS(\'2013-06-13\') |\n+--------------------------+\n| 63538300800 |\n+--------------------------+\n\nSELECT TO_SECONDS(\'2013-06-13 21:45:13\');\n+-----------------------------------+\n| TO_SECONDS(\'2013-06-13 21:45:13\') |\n+-----------------------------------+\n| 63538379113 |\n+-----------------------------------+\n\nSELECT TO_SECONDS(NOW());\n+-------------------+\n| TO_SECONDS(NOW()) |\n+-------------------+\n| 63543530875 |\n+-------------------+\n\nSELECT TO_SECONDS(20130513);\n+----------------------+\n| TO_SECONDS(20130513) |\n+----------------------+\n| 63535622400 |\n+----------------------+\n1 row in set (0.00 sec)\n\nSELECT TO_SECONDS(130513);\n+--------------------+\n| TO_SECONDS(130513) |\n+--------------------+\n| 63535622400 |\n+--------------------+\n\n\n\nURL: mariadb.com/kb/en/to_seconds/','','https://mariadb.com/kb/en/to_seconds/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (516,31,'UNIX_TIMESTAMP','Syntax\n------\n\nUNIX_TIMESTAMP()\nUNIX_TIMESTAMP(date)\n\nDescription\n-----------\n\nIf called with no argument, returns a Unix timestamp (seconds since\n\'1970-01-01 00:00:00\' UTC) as an unsigned integer. If UNIX_TIMESTAMP() is\ncalled with a date argument, it returns the value of the argument as seconds\nsince \'1970-01-01 00:00:00\' UTC. date may be a DATE string, a DATETIME string,\na TIMESTAMP, or a number in the format YYMMDD or YYYYMMDD. The server\ninterprets date as a value in the current time zone and converts it to an\ninternal value in UTC. Clients can set their time zone as described in time\nzones.\n\nThe inverse function of UNIX_TIMESTAMP() is FROM_UNIXTIME()\n\nUNIX_TIMESTAMP() supports microseconds.\n\nTimestamps in MariaDB have a maximum value of 2147483647, equivalent to\n2038-01-19 05:14:07. This is due to the underlying 32-bit limitation. Using\nthe function on a date beyond this will result in NULL being returned. Use\nDATETIME as a storage type if you require dates beyond this.\n\nError Handling\n--------------\n\nReturns NULL for wrong arguments to UNIX_TIMESTAMP(). In MySQL and MariaDB\nbefore 5.3 wrong arguments to UNIX_TIMESTAMP() returned 0.\n\nCompatibility\n-------------\n\nAs you can see in the examples above, UNIX_TIMESTAMP(constant-date-string)\nreturns a timestamp with 6 decimals while MariaDB 5.2 and before returns it\nwithout decimals. This can cause a problem if you are using UNIX_TIMESTAMP()\nas a partitioning function. You can fix this by using\nFLOOR(UNIX_TIMESTAMP(..)) or changing the date string to a date number, like\n20080101000000.\n\nExamples\n--------\n\nSELECT UNIX_TIMESTAMP();\n+------------------+\n| UNIX_TIMESTAMP() |\n+------------------+\n| 1269711082 |\n+------------------+\n\nSELECT UNIX_TIMESTAMP(\'2007-11-30 10:30:19\');\n+---------------------------------------+\n| UNIX_TIMESTAMP(\'2007-11-30 10:30:19\') |\n+---------------------------------------+\n| 1196436619.000000 |\n+---------------------------------------+\n\nSELECT UNIX_TIMESTAMP("2007-11-30 10:30:19.123456");\n+----------------------------------------------+\n| unix_timestamp("2007-11-30 10:30:19.123456") |\n+----------------------------------------------+\n| 1196411419.123456 |\n+----------------------------------------------+\n\nSELECT FROM_UNIXTIME(UNIX_TIMESTAMP(\'2007-11-30 10:30:19\'));\n+------------------------------------------------------+\n| FROM_UNIXTIME(UNIX_TIMESTAMP(\'2007-11-30 10:30:19\')) |\n+------------------------------------------------------+\n| 2007-11-30 10:30:19.000000 |\n+------------------------------------------------------+\n\nSELECT FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(\'2007-11-30 10:30:19\')));\n+-------------------------------------------------------------+\n| FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(\'2007-11-30 10:30:19\'))) |\n+-------------------------------------------------------------+\n| 2007-11-30 10:30:19 |\n+-------------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/unix_timestamp/','','https://mariadb.com/kb/en/unix_timestamp/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (517,31,'UTC_DATE','Syntax\n------\n\nUTC_DATE, UTC_DATE()\n\nDescription\n-----------\n\nReturns the current UTC date as a value in \'YYYY-MM-DD\' or YYYYMMDD format,\ndepending on whether the function is used in a string or numeric context.\n\nExamples\n--------\n\nSELECT UTC_DATE(), UTC_DATE() + 0;\n+------------+----------------+\n| UTC_DATE() | UTC_DATE() + 0 |\n+------------+----------------+\n| 2010-03-27 | 20100327 |\n+------------+----------------+\n\n\n\nURL: mariadb.com/kb/en/utc_date/','','https://mariadb.com/kb/en/utc_date/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (518,31,'UTC_TIME','Syntax\n------\n\nUTC_TIME\nUTC_TIME([precision])\n\nDescription\n-----------\n\nReturns the current UTC time as a value in \'HH:MM:SS\' or HHMMSS.uuuuuu format,\ndepending on whether the function is used in a string or numeric context.\n\nThe optional precision determines the microsecond precision. See Microseconds\nin MariaDB.\n\nExamples\n--------\n\nSELECT UTC_TIME(), UTC_TIME() + 0;\n+------------+----------------+\n| UTC_TIME() | UTC_TIME() + 0 |\n+------------+----------------+\n| 17:32:34 | 173234.000000 |\n+------------+----------------+\n\nWith precision:\n\nSELECT UTC_TIME(5);\n+----------------+\n| UTC_TIME(5) |\n+----------------+\n| 07:52:50.78369 |\n+----------------+\n\n\n\nURL: mariadb.com/kb/en/utc_time/','','https://mariadb.com/kb/en/utc_time/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (519,31,'UTC_TIMESTAMP','Syntax\n------\n\nUTC_TIMESTAMP\nUTC_TIMESTAMP([precision])\n\nDescription\n-----------\n\nReturns the current UTC date and time as a value in \'YYYY-MM-DD HH:MM:SS\' or\nYYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is used in a\nstring or numeric context.\n\nThe optional precision determines the microsecond precision. See Microseconds\nin MariaDB.\n\nExamples\n--------\n\nSELECT UTC_TIMESTAMP(), UTC_TIMESTAMP() + 0;\n+---------------------+-----------------------+\n| UTC_TIMESTAMP() | UTC_TIMESTAMP() + 0 |\n+---------------------+-----------------------+\n| 2010-03-27 17:33:16 | 20100327173316.000000 |\n+---------------------+-----------------------+\n\nWith precision:\n\nSELECT UTC_TIMESTAMP(4);\n+--------------------------+\n| UTC_TIMESTAMP(4) |\n+--------------------------+\n| 2018-07-10 07:51:09.1019 |\n+--------------------------+\n\n\n\nURL: mariadb.com/kb/en/utc_timestamp/','','https://mariadb.com/kb/en/utc_timestamp/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (520,31,'WEEK','Syntax\n------\n\nWEEK(date[,mode])\n\nDescription\n-----------\n\nThis function returns the week number for date. The two-argument form of\nWEEK() allows you to specify whether the week starts on Sunday or Monday and\nwhether the return value should be in the range from 0 to 53 or from 1 to 53.\nIf the mode argument is omitted, the value of the default_week_format system\nvariable is used.\n\nModes\n-----\n\n+-------+---------------------+--------+-------------------------------------+\n| Mode | 1st day of week | Range | Week 1 is the 1st week with |\n+-------+---------------------+--------+-------------------------------------+\n| 0 | Sunday | 0-53 | a Sunday in this year |\n+-------+---------------------+--------+-------------------------------------+\n| 1 | Monday | 0-53 | more than 3 days this year |\n+-------+---------------------+--------+-------------------------------------+\n| 2 | Sunday | 1-53 | a Sunday in this year |\n+-------+---------------------+--------+-------------------------------------+\n| 3 | Monday | 1-53 | more than 3 days this year |\n+-------+---------------------+--------+-------------------------------------+\n| 4 | Sunday | 0-53 | more than 3 days this year |\n+-------+---------------------+--------+-------------------------------------+\n| 5 | Monday | 0-53 | a Monday in this year |\n+-------+---------------------+--------+-------------------------------------+\n| 6 | Sunday | 1-53 | more than 3 days this year |\n+-------+---------------------+--------+-------------------------------------+\n| 7 | Monday | 1-53 | a Monday in this year |\n+-------+---------------------+--------+-------------------------------------+\n\nWith the mode value of 3, which means “more than 3 days this year”, weeks are\nnumbered according to ISO 8601:1988.\n\nExamples\n--------\n\nSELECT WEEK(\'2008-02-20\');\n+--------------------+\n| WEEK(\'2008-02-20\') |\n+--------------------+\n| 7 |\n+--------------------+\n\nSELECT WEEK(\'2008-02-20\',0);\n+----------------------+\n| WEEK(\'2008-02-20\',0) |\n+----------------------+\n| 7 |\n+----------------------+\n\nSELECT WEEK(\'2008-02-20\',1);\n+----------------------+\n| WEEK(\'2008-02-20\',1) |\n+----------------------+\n| 8 |\n+----------------------+\n\nSELECT WEEK(\'2008-12-31\',0);\n+----------------------+\n| WEEK(\'2008-12-31\',0) |\n+----------------------+\n| 52 |\n+----------------------+\n\nSELECT WEEK(\'2008-12-31\',1);\n+----------------------+\n| WEEK(\'2008-12-31\',1) |\n+----------------------+\n| 53 |\n+----------------------+\n\nSELECT WEEK(\'2019-12-30\',3);\n+----------------------+\n| WEEK(\'2019-12-30\',3) |\n+----------------------+\n| 1 |\n+----------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n ("2007-01-30 21:31:07"),\n ("1983-10-15 06:42:51"),\n ("2011-04-21 12:34:56"),\n ("2011-10-30 06:31:41"),\n ("2011-01-30 14:03:25"),\n ("2004-10-07 11:19:34");\n\nSELECT d, WEEK(d,0), WEEK(d,1) from t1;\n+---------------------+-----------+-----------+\n| d | WEEK(d,0) | WEEK(d,1) |\n+---------------------+-----------+-----------+\n| 2007-01-30 21:31:07 | 4 | 5 |\n| 1983-10-15 06:42:51 | 41 | 41 |\n| 2011-04-21 12:34:56 | 16 | 16 |\n| 2011-10-30 06:31:41 | 44 | 43 |\n| 2011-01-30 14:03:25 | 5 | 4 |\n| 2004-10-07 11:19:34 | 40 | 41 |\n+---------------------+-----------+-----------+\n\n\n\nURL: mariadb.com/kb/en/week/','','https://mariadb.com/kb/en/week/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (521,31,'WEEKDAY','Syntax\n------\n\nWEEKDAY(date)\n\nDescription\n-----------\n\nReturns the weekday index for date (0 = Monday, 1 = Tuesday, ... 6 = Sunday).\n\nThis contrasts with DAYOFWEEK() which follows the ODBC standard (1 = Sunday, 2\n= Monday, ..., 7 = Saturday).\n\nExamples\n--------\n\nSELECT WEEKDAY(\'2008-02-03 22:23:00\');\n+--------------------------------+\n| WEEKDAY(\'2008-02-03 22:23:00\') |\n+--------------------------------+\n| 6 |\n+--------------------------------+\n\nSELECT WEEKDAY(\'2007-11-06\');\n+-----------------------+\n| WEEKDAY(\'2007-11-06\') |\n+-----------------------+\n| 1 |\n+-----------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n ("2007-01-30 21:31:07"),\n ("1983-10-15 06:42:51"),\n ("2011-04-21 12:34:56"),\n ("2011-10-30 06:31:41"),\n ("2011-01-30 14:03:25"),\n ("2004-10-07 11:19:34");\n\nSELECT d FROM t1 where WEEKDAY(d) = 6;\n+---------------------+\n| d |\n+---------------------+\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n+---------------------+\n\n\n\nURL: mariadb.com/kb/en/weekday/','','https://mariadb.com/kb/en/weekday/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (522,31,'WEEKOFYEAR','Syntax\n------\n\nWEEKOFYEAR(date)\n\nDescription\n-----------\n\nReturns the calendar week of the date as a number in the range from 1 to 53.\nWEEKOFYEAR() is a compatibility function that is equivalent to WEEK(date,3).\n\nExamples\n--------\n\nSELECT WEEKOFYEAR(\'2008-02-20\');\n+--------------------------+\n| WEEKOFYEAR(\'2008-02-20\') |\n+--------------------------+\n| 8 |\n+--------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n ("2007-01-30 21:31:07"),\n ("1983-10-15 06:42:51"),\n ("2011-04-21 12:34:56"),\n ("2011-10-30 06:31:41"),\n ("2011-01-30 14:03:25"),\n ("2004-10-07 11:19:34");\n\nselect * from t1;\n+---------------------+\n| d |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 1983-10-15 06:42:51 |\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n| 2004-10-07 11:19:34 |\n+---------------------+\n\nSELECT d, WEEKOFYEAR(d), WEEK(d,3) from t1;\n+---------------------+---------------+-----------+\n| d | WEEKOFYEAR(d) | WEEK(d,3) |\n+---------------------+---------------+-----------+\n| 2007-01-30 21:31:07 | 5 | 5 |\n| 1983-10-15 06:42:51 | 41 | 41 |\n| 2011-04-21 12:34:56 | 16 | 16 |\n| 2011-10-30 06:31:41 | 43 | 43 |\n| 2011-01-30 14:03:25 | 4 | 4 |\n| 2004-10-07 11:19:34 | 41 | 41 |\n+---------------------+---------------+-----------+\n\n\n\nURL: mariadb.com/kb/en/weekofyear/','','https://mariadb.com/kb/en/weekofyear/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (523,31,'YEAR','Syntax\n------\n\nYEAR(date)\n\nDescription\n-----------\n\nReturns the year for the given date, in the range 1000 to 9999, or 0 for the\n"zero" date.\n\nExamples\n--------\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n ("2007-01-30 21:31:07"),\n ("1983-10-15 06:42:51"),\n ("2011-04-21 12:34:56"),\n ("2011-10-30 06:31:41"),\n ("2011-01-30 14:03:25"),\n ("2004-10-07 11:19:34");\n\nSELECT * FROM t1;\n+---------------------+\n| d |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 1983-10-15 06:42:51 |\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n| 2004-10-07 11:19:34 |\n+---------------------+\n\nSELECT * FROM t1 WHERE YEAR(d) = 2011;\n+---------------------+\n| d |\n+---------------------+\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n+---------------------+\n\nSELECT YEAR(\'1987-01-01\');\n+--------------------+\n| YEAR(\'1987-01-01\') |\n+--------------------+\n| 1987 |\n+--------------------+\n\n\n\nURL: mariadb.com/kb/en/year/','','https://mariadb.com/kb/en/year/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (524,31,'YEARWEEK','Syntax\n------\n\nYEARWEEK(date), YEARWEEK(date,mode)\n\nDescription\n-----------\n\nReturns year and week for a date. The mode argument works exactly like the\nmode argument to WEEK(). The year in the result may be different from the year\nin the date argument for the first and the last week of the year.\n\nExamples\n--------\n\nSELECT YEARWEEK(\'1987-01-01\');\n+------------------------+\n| YEARWEEK(\'1987-01-01\') |\n+------------------------+\n| 198652 |\n+------------------------+\n\nCREATE TABLE t1 (d DATETIME);\nINSERT INTO t1 VALUES\n ("2007-01-30 21:31:07"),\n ("1983-10-15 06:42:51"),\n ("2011-04-21 12:34:56"),\n ("2011-10-30 06:31:41"),\n ("2011-01-30 14:03:25"),\n ("2004-10-07 11:19:34");\n\nSELECT * FROM t1;\n+---------------------+\n| d |\n+---------------------+\n| 2007-01-30 21:31:07 |\n| 1983-10-15 06:42:51 |\n| 2011-04-21 12:34:56 |\n| 2011-10-30 06:31:41 |\n| 2011-01-30 14:03:25 |\n| 2004-10-07 11:19:34 |\n+---------------------+\n6 rows in set (0.02 sec)\n\nSELECT YEARWEEK(d) FROM t1 WHERE YEAR(d) = 2011;\n+-------------+\n| YEARWEEK(d) |\n+-------------+\n| 201116 |\n| 201144 |\n| 201105 |\n+-------------+\n3 rows in set (0.03 sec)\n\n\n\nURL: mariadb.com/kb/en/yearweek/','','https://mariadb.com/kb/en/yearweek/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (525,32,'Well-Known Binary (WKB) Format','WKB stands for Well-Known Binary, a format for representing\ngeographical and geometrical data.\n\nWKB uses 1-byte unsigned integers, 4-byte unsigned integers, and 8-byte\ndouble-precision numbers.\n\n* The first byte indicates the byte order. 00 for big endian, or 01 for little\nendian.\n* The next 4 bytes indicate the geometry type. Values from 1 to 7 indicate\nwhether the type is Point, LineString, Polygon, MultiPoint, MultiLineString,\nMultiPolygon, or GeometryCollection respectively. \n* The 8-byte floats represent the co-ordinates.\n\nTake the following example, a sequence of 21 bytes each represented by two hex\ndigits:\n\n000000000140000000000000004010000000000000\n\n* It\'s big endian\n000000000140000000000000004010000000000000\n\n* It\'s a POINT\n000000000140000000000000004010000000000000\n\n* The X co-ordinate is 2.0\n000000000140000000000000004010000000000000\n\n* The Y-co-ordinate is 4.0\n000000000140000000000000004010000000000000\n\n\n\nURL: mariadb.com/kb/en/well-known-binary-wkb-format/','','https://mariadb.com/kb/en/well-known-binary-wkb-format/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (526,32,'AsBinary','A synonym for ST_AsBinary().\n\n\n\nURL: mariadb.com/kb/en/wkb-asbinary/','','https://mariadb.com/kb/en/wkb-asbinary/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (527,32,'AsWKB','A synonym for ST_AsBinary().\n\n\n\nURL: mariadb.com/kb/en/aswkb/','','https://mariadb.com/kb/en/aswkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (528,32,'MLineFromWKB','Syntax\n------\n\nMLineFromWKB(wkb[,srid])\nMultiLineStringFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a MULTILINESTRING value using its WKB representation and SRID.\n\nMLineFromWKB() and MultiLineStringFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(MLineFromText(\'MULTILINESTRING((10 48,10 21,10 0),(16\n0,16 23,16 48))\'));\n\nSELECT ST_AsText(MLineFromWKB(@g));\n+--------------------------------------------------------+\n| ST_AsText(MLineFromWKB(@g)) |\n+--------------------------------------------------------+\n| MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) |\n+--------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/mlinefromwkb/','','https://mariadb.com/kb/en/mlinefromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (529,32,'MPointFromWKB','Syntax\n------\n\nMPointFromWKB(wkb[,srid])\nMultiPointFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a MULTIPOINT value using its WKB representation and SRID.\n\nMPointFromWKB() and MultiPointFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(MPointFromText(\'MultiPoint( 1 1, 2 2, 5 3, 7 2, 9 3, 8 4,\n6 6, 6 9, 4 9, 1 5 )\'));\n\nSELECT ST_AsText(MPointFromWKB(@g));\n+-----------------------------------------------------+\n| ST_AsText(MPointFromWKB(@g)) |\n+-----------------------------------------------------+\n| MULTIPOINT(1 1,2 2,5 3,7 2,9 3,8 4,6 6,6 9,4 9,1 5) |\n+-----------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/mpointfromwkb/','','https://mariadb.com/kb/en/mpointfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (530,32,'MPolyFromWKB','Syntax\n------\n\nMPolyFromWKB(wkb[,srid])\nMultiPolygonFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a MULTIPOLYGON value using its WKB representation and SRID.\n\nMPolyFromWKB() and MultiPolygonFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(MPointFromText(\'MULTIPOLYGON(((28 26,28 0,84 0,84 42,28\n26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))\'));\n\nSELECT ST_AsText(MPolyFromWKB(@g))\G\n*************************** 1. row ***************************\nST_AsText(MPolyFromWKB(@g)): MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52\n18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))\n\n\n\nURL: mariadb.com/kb/en/mpolyfromwkb/','','https://mariadb.com/kb/en/mpolyfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (531,32,'GeomCollFromWKB','A synonym for ST_GeomCollFromWKB.\n\n\n\nURL: mariadb.com/kb/en/wkb-geomcollfromwkb/','','https://mariadb.com/kb/en/wkb-geomcollfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (532,32,'GeometryCollectionFromWKB','A synonym for ST_GeomCollFromWKB.\n\n\n\nURL: mariadb.com/kb/en/geometrycollectionfromwkb/','','https://mariadb.com/kb/en/geometrycollectionfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (533,32,'GeometryFromWKB','A synonym for ST_GeomFromWKB.\n\n\n\nURL: mariadb.com/kb/en/geometryfromwkb/','','https://mariadb.com/kb/en/geometryfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (534,32,'GeomFromWKB','A synonym for ST_GeomFromWKB.\n\n\n\nURL: mariadb.com/kb/en/wkb-geomfromwkb/','','https://mariadb.com/kb/en/wkb-geomfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (535,32,'LineFromWKB','A synonym for ST_LineFromWKB.\n\n\n\nURL: mariadb.com/kb/en/wkb-linefromwkb/','','https://mariadb.com/kb/en/wkb-linefromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (536,32,'LineStringFromWKB','A synonym for ST_LineFromWKB.\n\n\n\nURL: mariadb.com/kb/en/linestringfromwkb/','','https://mariadb.com/kb/en/linestringfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (537,32,'MultiLineStringFromWKB','A synonym for MLineFromWKB().\n\n\n\nURL: mariadb.com/kb/en/multilinestringfromwkb/','','https://mariadb.com/kb/en/multilinestringfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (538,32,'MultiPointFromWKB','A synonym for MPointFromWKB.\n\n\n\nURL: mariadb.com/kb/en/multipointfromwkb/','','https://mariadb.com/kb/en/multipointfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (539,32,'MultiPolygonFromWKB','Synonym for MPolyFromWKB.\n\n\n\nURL: mariadb.com/kb/en/multipolygonfromwkb/','','https://mariadb.com/kb/en/multipolygonfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (540,32,'PointFromWKB','A synonym for ST_PointFromWKB.\n\n\n\nURL: mariadb.com/kb/en/wkb-pointfromwkb/','','https://mariadb.com/kb/en/wkb-pointfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (541,32,'PolyFromWKB','A synonym for ST_PolyFromWKB.\n\n\n\nURL: mariadb.com/kb/en/wkb-polyfromwkb/','','https://mariadb.com/kb/en/wkb-polyfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (542,32,'PolygonFromWKB','A synonym for ST_PolyFromWKB.\n\n\n\nURL: mariadb.com/kb/en/polygonfromwkb/','','https://mariadb.com/kb/en/polygonfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (543,32,'ST_AsBinary','Syntax\n------\n\nST_AsBinary(g)\nAsBinary(g)\nST_AsWKB(g)\nAsWKB(g)\n\nDescription\n-----------\n\nConverts a value in internal geometry format to its WKB representation and\nreturns the binary result.\n\nST_AsBinary(), AsBinary(), ST_AsWKB() and AsWKB() are synonyms,\n\nExamples\n--------\n\nSET @poly = ST_GeomFromText(\'POLYGON((0 0,0 1,1 1,1 0,0 0))\');\nSELECT ST_AsBinary(@poly);\n\nSELECT ST_AsText(ST_GeomFromWKB(ST_AsWKB(@poly)));\n+--------------------------------------------+\n| ST_AsText(ST_GeomFromWKB(ST_AsWKB(@poly))) |\n+--------------------------------------------+\n| POLYGON((0 0,0 1,1 1,1 0,0 0)) |\n+--------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_asbinary/','','https://mariadb.com/kb/en/st_asbinary/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (544,32,'ST_AsWKB','A synonym for ST_AsBinary().\n\n\n\nURL: mariadb.com/kb/en/st_aswkb/','','https://mariadb.com/kb/en/st_aswkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (545,32,'ST_GeomCollFromWKB','Syntax\n------\n\nST_GeomCollFromWKB(wkb[,srid])\nST_GeometryCollectionFromWKB(wkb[,srid])\nGeomCollFromWKB(wkb[,srid])\nGeometryCollectionFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a GEOMETRYCOLLECTION value using its WKB representation and SRID.\n\nST_GeomCollFromWKB(), ST_GeometryCollectionFromWKB(), GeomCollFromWKB() and\nGeometryCollectionFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(ST_GeomFromText(\'GEOMETRYCOLLECTION(\n POLYGON((5 5,10 5,10 10,5 5)),POINT(10 10))\'));\n\nSELECT ST_AsText(ST_GeomCollFromWKB(@g));\n+----------------------------------------------------------------+\n| ST_AsText(ST_GeomCollFromWKB(@g)) |\n+----------------------------------------------------------------+\n| GEOMETRYCOLLECTION(POLYGON((5 5,10 5,10 10,5 5)),POINT(10 10)) |\n+----------------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_geomcollfromwkb/','','https://mariadb.com/kb/en/st_geomcollfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (546,32,'ST_GeometryCollectionFromWKB','A synonym for ST_GeomCollFromWKB.\n\n\n\nURL: mariadb.com/kb/en/st_geometrycollectionfromwkb/','','https://mariadb.com/kb/en/st_geometrycollectionfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (547,32,'ST_GeometryFromWKB','A synonym for ST_GeomFromWKB.\n\n\n\nURL: mariadb.com/kb/en/st_geometryfromwkb/','','https://mariadb.com/kb/en/st_geometryfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (548,32,'ST_GeomFromWKB','Syntax\n------\n\nST_GeomFromWKB(wkb[,srid])\nST_GeometryFromWKB(wkb[,srid])\nGeomFromWKB(wkb[,srid])\nGeometryFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a geometry value of any type using its WKB representation and SRID.\n\nST_GeomFromWKB(), ST_GeometryFromWKB(), GeomFromWKB() and GeometryFromWKB()\nare synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(ST_LineFromText(\'LINESTRING(0 4, 4 6)\'));\n\nSELECT ST_AsText(ST_GeomFromWKB(@g));\n+-------------------------------+\n| ST_AsText(ST_GeomFromWKB(@g)) |\n+-------------------------------+\n| LINESTRING(0 4,4 6) |\n+-------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_geomfromwkb/','','https://mariadb.com/kb/en/st_geomfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (549,32,'ST_LineFromWKB','Syntax\n------\n\nST_LineFromWKB(wkb[,srid])\nLineFromWKB(wkb[,srid])\nST_LineStringFromWKB(wkb[,srid])\nLineStringFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a LINESTRING value using its WKB representation and SRID.\n\nST_LineFromWKB(), LineFromWKB(), ST_LineStringFromWKB(), and\nLineStringFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(ST_LineFromText(\'LineString(0 4,4 6)\'));\n\nSELECT ST_AsText(ST_LineFromWKB(@g)) AS l;\n+---------------------+\n| l |\n+---------------------+\n| LINESTRING(0 4,4 6) |\n+---------------------+\n\n\n\nURL: mariadb.com/kb/en/st_linefromwkb/','','https://mariadb.com/kb/en/st_linefromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (550,32,'ST_LineStringFromWKB','A synonym for ST_LineFromWKB.\n\n\n\nURL: mariadb.com/kb/en/st_linestringfromwkb/','','https://mariadb.com/kb/en/st_linestringfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (551,32,'ST_PointFromWKB','Syntax\n------\n\nST_PointFromWKB(wkb[,srid])\nPointFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a POINT value using its WKB representation and SRID.\n\nST_PointFromWKB() and PointFromWKB() are synonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(ST_PointFromText(\'POINT(0 4)\'));\n\nSELECT ST_AsText(ST_PointFromWKB(@g)) AS p;\n+------------+\n| p |\n+------------+\n| POINT(0 4) |\n+------------+\n\n\n\nURL: mariadb.com/kb/en/st_pointfromwkb/','','https://mariadb.com/kb/en/st_pointfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (552,32,'ST_PolyFromWKB','Syntax\n------\n\nST_PolyFromWKB(wkb[,srid])\nST_PolygonFromWKB(wkb[,srid])\nPolyFromWKB(wkb[,srid])\nPolygonFromWKB(wkb[,srid])\n\nDescription\n-----------\n\nConstructs a POLYGON value using its WKB representation and SRID.\n\nST_PolyFromWKB(), ST_PolygonFromWKB(), PolyFromWKB() and PolygonFromWKB() are\nsynonyms.\n\nExamples\n--------\n\nSET @g = ST_AsBinary(ST_PolyFromText(\'POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1\n1))\'));\n\nSELECT ST_AsText(ST_PolyFromWKB(@g)) AS p;\n+----------------------------------------+\n| p |\n+----------------------------------------+\n| POLYGON((1 1,1 5,4 9,6 9,9 3,7 2,1 1)) |\n+----------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_polyfromwkb/','','https://mariadb.com/kb/en/st_polyfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (553,32,'ST_PolygonFromWKB','A synonym for ST_PolyFromWKB.\n\n\n\nURL: mariadb.com/kb/en/st_polygonfromwkb/','','https://mariadb.com/kb/en/st_polygonfromwkb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (554,36,'BOUNDARY','A synonym for ST_BOUNDARY.\n\n\n\nURL: mariadb.com/kb/en/geometry-properties-boundary/','','https://mariadb.com/kb/en/geometry-properties-boundary/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (555,36,'DIMENSION','A synonym for ST_DIMENSION.\n\n\n\nURL: mariadb.com/kb/en/dimension/','','https://mariadb.com/kb/en/dimension/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (556,36,'ENVELOPE','A synonym for ST_ENVELOPE.\n\n\n\nURL: mariadb.com/kb/en/geometry-properties-envelope/','','https://mariadb.com/kb/en/geometry-properties-envelope/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (557,36,'GeometryN','A synonym for ST_GeometryN.\n\n\n\nURL: mariadb.com/kb/en/geometry-properties-geometryn/','','https://mariadb.com/kb/en/geometry-properties-geometryn/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (558,36,'GeometryType','A synonym for ST_GeometryType.\n\n\n\nURL: mariadb.com/kb/en/geometry-properties-geometrytype/','','https://mariadb.com/kb/en/geometry-properties-geometrytype/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (559,36,'IsClosed','A synonym for ST_IsClosed.\n\n\n\nURL: mariadb.com/kb/en/isclosed/','','https://mariadb.com/kb/en/isclosed/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (560,36,'IsEmpty','A synonym for ST_IsEmpty.\n\n\n\nURL: mariadb.com/kb/en/geometry-properties-isempty/','','https://mariadb.com/kb/en/geometry-properties-isempty/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (561,36,'IsRing','A synonym for ST_IsRing.\n\n\n\nURL: mariadb.com/kb/en/isring/','','https://mariadb.com/kb/en/isring/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (562,36,'IsSimple','A synonym for ST_IsSImple.\n\n\n\nURL: mariadb.com/kb/en/geometry-properties-issimple/','','https://mariadb.com/kb/en/geometry-properties-issimple/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (563,36,'NumGeometries','A synonym for ST_NumGeometries.\n\n\n\nURL: mariadb.com/kb/en/geometry-properties-numgeometries/','','https://mariadb.com/kb/en/geometry-properties-numgeometries/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (564,36,'SRID','A synonym for ST_SRID.\n\n\n\nURL: mariadb.com/kb/en/geometry-properties-srid/','','https://mariadb.com/kb/en/geometry-properties-srid/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (565,36,'ST_BOUNDARY','MariaDB starting with 10.1.2\n----------------------------\nThe ST_BOUNDARY function was introduced in MariaDB 10.1.2\n\nSyntax\n------\n\nST_BOUNDARY(g)\nBOUNDARY(g)\n\nDescription\n-----------\n\nReturns a geometry that is the closure of the combinatorial boundary of the\ngeometry value g.\n\nBOUNDARY() is a synonym.\n\nExamples\n--------\n\nSELECT ST_AsText(ST_Boundary(ST_GeomFromText(\'LINESTRING(3 3,0 0, -3 3)\')));\n+----------------------------------------------------------------------+\n| ST_AsText(ST_Boundary(ST_GeomFromText(\'LINESTRING(3 3,0 0, -3 3)\'))) |\n+----------------------------------------------------------------------+\n| MULTIPOINT(3 3,-3 3) |\n+----------------------------------------------------------------------+\n\nSELECT ST_AsText(ST_Boundary(ST_GeomFromText(\'POLYGON((3 3,0 0, -3 3, 3\n3))\')));\n+--------------------------------------------------------------------------+\n| ST_AsText(ST_Boundary(ST_GeomFromText(\'POLYGON((3 3,0 0, -3 3, 3 3))\'))) |\n+--------------------------------------------------------------------------+\n| LINESTRING(3 3,0 0,-3 3,3 3) |\n+--------------------------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_boundary/','','https://mariadb.com/kb/en/st_boundary/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (566,36,'ST_DIMENSION','Syntax\n------\n\nST_Dimension(g)\nDimension(g)\n\nDescription\n-----------\n\nReturns the inherent dimension of the geometry value g. The result can be\n\n+------------------------------------+----------------------------------------+\n| Dimension | Definition |\n+------------------------------------+----------------------------------------+\n| -1 | empty geometry |\n+------------------------------------+----------------------------------------+\n| 0 | geometry with no length or area |\n+------------------------------------+----------------------------------------+\n| 1 | geometry with no area but nonzero |\n| | length |\n+------------------------------------+----------------------------------------+\n| 2 | geometry with nonzero area |\n+------------------------------------+----------------------------------------+\n\nST_Dimension() and Dimension() are synonyms.\n\nExamples\n--------\n\nSELECT Dimension(GeomFromText(\'LineString(1 1,2 2)\'));\n+------------------------------------------------+\n| Dimension(GeomFromText(\'LineString(1 1,2 2)\')) |\n+------------------------------------------------+\n| 1 |\n+------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_dimension/','','https://mariadb.com/kb/en/st_dimension/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (567,36,'ST_ENVELOPE','Syntax\n------\n\nST_ENVELOPE(g)\nENVELOPE(g)\n\nDescription\n-----------\n\nReturns the Minimum Bounding Rectangle (MBR) for the geometry value g. The\nresult is returned as a Polygon value.\n\nThe polygon is defined by the corner points of the bounding box:\n\nPOLYGON((MINX MINY, MAXX MINY, MAXX MAXY, MINX MAXY, MINX MINY))\n\nST_ENVELOPE() and ENVELOPE() are synonyms.\n\nExamples\n--------\n\nSELECT AsText(ST_ENVELOPE(GeomFromText(\'LineString(1 1,4 4)\')));\n+----------------------------------------------------------+\n| AsText(ST_ENVELOPE(GeomFromText(\'LineString(1 1,4 4)\'))) |\n+----------------------------------------------------------+\n| POLYGON((1 1,4 1,4 4,1 4,1 1)) |\n+----------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_envelope/','','https://mariadb.com/kb/en/st_envelope/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (568,36,'ST_GEOMETRYN','Syntax\n------\n\nST_GeometryN(gc,N)\nGeometryN(gc,N)\n\nDescription\n-----------\n\nReturns the N-th geometry in the GeometryCollection gc. Geometries are\nnumbered beginning with 1.\n\nST_GeometryN() and GeometryN() are synonyms.\n\nExample\n-------\n\nSET @gc = \'GeometryCollection(Point(1 1),LineString(12 14, 9 11))\';\n\nSELECT AsText(GeometryN(GeomFromText(@gc),1));\n+----------------------------------------+\n| AsText(GeometryN(GeomFromText(@gc),1)) |\n+----------------------------------------+\n| POINT(1 1) |\n+----------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_geometryn/','','https://mariadb.com/kb/en/st_geometryn/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (569,36,'ST_GEOMETRYTYPE','Syntax\n------\n\nST_GeometryType(g)\nGeometryType(g)\n\nDescription\n-----------\n\nReturns as a string the name of the geometry type of which the geometry\ninstance g is a member. The name corresponds to one of the instantiable\nGeometry subclasses.\n\nST_GeometryType() and GeometryType() are synonyms.\n\nExamples\n--------\n\nSELECT GeometryType(GeomFromText(\'POINT(1 1)\'));\n+------------------------------------------+\n| GeometryType(GeomFromText(\'POINT(1 1)\')) |\n+------------------------------------------+\n| POINT |\n+------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_geometrytype/','','https://mariadb.com/kb/en/st_geometrytype/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (570,36,'ST_ISCLOSED','Syntax\n------\n\nST_IsClosed(g)\nIsClosed(g)\n\nDescription\n-----------\n\nReturns 1 if a given LINESTRING\'s start and end points are the same, or 0 if\nthey are not the same. Before MariaDB 10.1.5, returns NULL if not given a\nLINESTRING. After MariaDB 10.1.5, returns -1.\n\nST_IsClosed() and IsClosed() are synonyms.\n\nExamples\n--------\n\nSET @ls = \'LineString(0 0, 0 4, 4 4, 0 0)\';\nSELECT ST_ISCLOSED(GEOMFROMTEXT(@ls));\n+--------------------------------+\n| ST_ISCLOSED(GEOMFROMTEXT(@ls)) |\n+--------------------------------+\n| 1 |\n+--------------------------------+\n\nSET @ls = \'LineString(0 0, 0 4, 4 4, 0 1)\';\nSELECT ST_ISCLOSED(GEOMFROMTEXT(@ls));\n+--------------------------------+\n| ST_ISCLOSED(GEOMFROMTEXT(@ls)) |\n+--------------------------------+\n| 0 |\n+--------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_isclosed/','','https://mariadb.com/kb/en/st_isclosed/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (571,36,'ST_ISEMPTY','Syntax\n------\n\nST_IsEmpty(g)\nIsEmpty(g)\n\nDescription\n-----------\n\nIsEmpty is a function defined by the OpenGIS specification, but is not fully\nimplemented by MariaDB or MySQL.\n\nSince MariaDB and MySQL do not support GIS EMPTY values such as POINT EMPTY,\nas implemented it simply returns 1 if the geometry value g is invalid, 0 if it\nis valid, and NULL if the argument is NULL.\n\nST_IsEmpty() and IsEmpty() are synonyms.\n\n\n\nURL: mariadb.com/kb/en/st_isempty/','','https://mariadb.com/kb/en/st_isempty/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (572,36,'ST_IsRing','MariaDB starting with 10.1.2\n----------------------------\nThe ST_IsRing function was introduced in MariaDB 10.1.2\n\nSyntax\n------\n\nST_IsRing(g)\nIsRing(g)\n\nDescription\n-----------\n\nReturns true if a given LINESTRING is a ring, that is, both ST_IsClosed and\nST_IsSimple. A simple curve does not pass through the same point more than\nonce. However, see MDEV-7510.\n\nSt_IsRing() and IsRing() are synonyms.\n\n\n\nURL: mariadb.com/kb/en/st_isring/','','https://mariadb.com/kb/en/st_isring/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (573,36,'ST_IsSimple','Syntax\n------\n\nST_IsSimple(g)\nIsSimple(g)\n\nDescription\n-----------\n\nReturns true if the given Geometry has no anomalous geometric points, false if\nit does, or NULL if given a NULL value.\n\nST_IsSimple() and IsSimple() are synonyms.\n\nExamples\n--------\n\nA POINT is always simple.\n\nSET @g = \'Point(1 2)\';\n\nSELECT ST_ISSIMPLE(GEOMFROMTEXT(@g));\n+-------------------------------+\n| ST_ISSIMPLE(GEOMFROMTEXT(@g)) |\n+-------------------------------+\n| 1 |\n+-------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_issimple/','','https://mariadb.com/kb/en/st_issimple/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (574,36,'ST_NUMGEOMETRIES','Syntax\n------\n\nST_NumGeometries(gc)\nNumGeometries(gc)\n\nDescription\n-----------\n\nReturns the number of geometries in the GeometryCollection gc.\n\nST_NumGeometries() and NumGeometries() are synonyms.\n\nExample\n-------\n\nSET @gc = \'GeometryCollection(Point(1 1),LineString(2 2, 3 3))\';\n\nSELECT NUMGEOMETRIES(GeomFromText(@gc));\n+----------------------------------+\n| NUMGEOMETRIES(GeomFromText(@gc)) |\n+----------------------------------+\n| 2 |\n+----------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_numgeometries/','','https://mariadb.com/kb/en/st_numgeometries/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (575,36,'ST_RELATE','MariaDB starting with 10.1.2\n----------------------------\nThe ST_RELATE() function was introduced in MariaDB 10.1.2\n\nSyntax\n------\n\nST_Relate(g1, g2, i)\n\nDescription\n-----------\n\nReturns true if Geometry g1 is spatially related to Geometryg2 by testing for\nintersections between the interior, boundary and exterior of the two\ngeometries as specified by the values in intersection matrix pattern i.\n\n\n\nURL: mariadb.com/kb/en/st_relate/','','https://mariadb.com/kb/en/st_relate/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (576,36,'ST_SRID','Syntax\n------\n\nST_SRID(g)\nSRID(g)\n\nDescription\n-----------\n\nReturns an integer indicating the Spatial Reference System ID for the geometry\nvalue g.\n\nIn MariaDB, the SRID value is just an integer associated with the geometry\nvalue. All calculations are done assuming Euclidean (planar) geometry.\n\nST_SRID() and SRID() are synonyms.\n\nExamples\n--------\n\nSELECT SRID(GeomFromText(\'LineString(1 1,2 2)\',101));\n+-----------------------------------------------+\n| SRID(GeomFromText(\'LineString(1 1,2 2)\',101)) |\n+-----------------------------------------------+\n| 101 |\n+-----------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/st_srid/','','https://mariadb.com/kb/en/st_srid/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (577,37,'ASCII','Syntax\n------\n\nASCII(str)\n\nDescription\n-----------\n\nReturns the numeric ASCII value of the leftmost character of the string\nargument. Returns 0 if the given string is empty and NULL if it is NULL.\n\nASCII() works for 8-bit characters.\n\nExamples\n--------\n\nSELECT ASCII(9);\n+----------+\n| ASCII(9) |\n+----------+\n| 57 |\n+----------+\n\nSELECT ASCII(\'9\');\n+------------+\n| ASCII(\'9\') |\n+------------+\n| 57 |\n+------------+\n\nSELECT ASCII(\'abc\');\n+--------------+\n| ASCII(\'abc\') |\n+--------------+\n| 97 |\n+--------------+\n\n\n\nURL: mariadb.com/kb/en/ascii/','','https://mariadb.com/kb/en/ascii/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (578,37,'BIN','Syntax\n------\n\nBIN(N)\n\nDescription\n-----------\n\nReturns a string representation of the binary value of the given longlong\n(that is, BIGINT) number. This is equivalent to CONV(N,10,2). The argument\nshould be positive. If it is a FLOAT, it will be truncated. Returns NULL if\nthe argument is NULL.\n\nExamples\n--------\n\nSELECT BIN(12);\n+---------+\n| BIN(12) |\n+---------+\n| 1100 |\n+---------+\n\n\n\nURL: mariadb.com/kb/en/bin/','','https://mariadb.com/kb/en/bin/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (579,37,'BINARY Operator','This page describes the BINARY operator. For details about the data\ntype, see Binary Data Type.\n\nSyntax\n------\n\nBINARY\n\nDescription\n-----------\n\nThe BINARY operator casts the string following it to a binary string. This is\nan easy way to force a column comparison to be done byte by byte rather than\ncharacter by character. This causes the comparison to be case sensitive even\nif the column isn\'t defined as BINARY or BLOB.\n\nBINARY also causes trailing spaces to be significant.\n\nExamples\n--------\n\nSELECT \'a\' = \'A\';\n+-----------+\n| \'a\' = \'A\' |\n+-----------+\n| 1 |\n+-----------+\n\nSELECT BINARY \'a\' = \'A\';\n+------------------+\n| BINARY \'a\' = \'A\' |\n+------------------+\n| 0 |\n+------------------+\n\nSELECT \'a\' = \'a \';\n+------------+\n| \'a\' = \'a \' |\n+------------+\n| 1 |\n+------------+\n\nSELECT BINARY \'a\' = \'a \';\n+-------------------+\n| BINARY \'a\' = \'a \' |\n+-------------------+\n| 0 |\n+-------------------+\n\n\n\nURL: mariadb.com/kb/en/binary-operator/','','https://mariadb.com/kb/en/binary-operator/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (580,37,'BIT_LENGTH','Syntax\n------\n\nBIT_LENGTH(str)\n\nDescription\n-----------\n\nReturns the length of the given string argument in bits. If the argument is\nnot a string, it will be converted to string. If the argument is NULL, it\nreturns NULL.\n\nExamples\n--------\n\nSELECT BIT_LENGTH(\'text\');\n+--------------------+\n| BIT_LENGTH(\'text\') |\n+--------------------+\n| 32 |\n+--------------------+\n\nSELECT BIT_LENGTH(\'\');\n+----------------+\n| BIT_LENGTH(\'\') |\n+----------------+\n| 0 |\n+----------------+\n\nCompatibility\n-------------\n\nPostgreSQL and Sybase support BIT_LENGTH().\n\n\n\nURL: mariadb.com/kb/en/bit_length/','','https://mariadb.com/kb/en/bit_length/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (581,37,'CAST','Syntax\n------\n\nCAST(expr AS type)\n\nDescription\n-----------\n\nThe CAST() function takes a value of one type and produces a value of another\ntype, similar to the CONVERT() function.\n\nThe type can be one of the following values:\n\n* BINARY\n* CHAR\n* DATE\n* DATETIME \n* DECIMAL[(M[,D])]\n* DOUBLE\n* FLOAT (from MariaDB 10.4.5)\n* INTEGER \nShort for SIGNED INTEGER\n\n* SIGNED [INTEGER]\n* UNSIGNED [INTEGER]\n* TIME\n* VARCHAR (in Oracle mode, from MariaDB 10.3)\n\nThe main difference between CAST and CONVERT() is that CONVERT(expr,type) is\nODBC syntax while CAST(expr as type) and CONVERT(... USING ...) are SQL92\nsyntax.\n\nIn MariaDB 10.4 and later, you can use the CAST() function with the INTERVAL\nkeyword.\n\nUntil MariaDB 5.5.31, X\'HHHH\', the standard SQL syntax for binary string\nliterals, erroneously worked in the same way as 0xHHHH. In 5.5.31 it was\nintentionally changed to behave as a string in all contexts (and never as a\nnumber).\n\nThis introduced an incompatibility with previous versions of MariaDB, and all\nversions of MySQL (see the example below).\n\nExamples\n--------\n\nSimple casts:\n\nSELECT CAST("abc" AS BINARY);\nSELECT CAST("1" AS UNSIGNED INTEGER);\nSELECT CAST(123 AS CHAR CHARACTER SET utf8)\n\nNote that when one casts to CHAR without specifying the character set, the\ncollation_connection character set collation will be used. When used with CHAR\nCHARACTER SET, the default collation for that character set will be used.\n\nSELECT COLLATION(CAST(123 AS CHAR));\n+------------------------------+\n| COLLATION(CAST(123 AS CHAR)) |\n+------------------------------+\n| latin1_swedish_ci |\n+------------------------------+\n\nSELECT COLLATION(CAST(123 AS CHAR CHARACTER SET utf8));\n+-------------------------------------------------+\n| COLLATION(CAST(123 AS CHAR CHARACTER SET utf8)) |\n+-------------------------------------------------+\n| utf8_general_ci |\n+-------------------------------------------------+\n\nIf you also want to change the collation, you have to use the COLLATE operator:\n\nSELECT COLLATION(CAST(123 AS CHAR CHARACTER SET utf8) \n COLLATE utf8_unicode_ci);\n+-------------------------------------------------------------------------+\n| COLLATION(CAST(123 AS CHAR CHARACTER SET utf8) COLLATE utf8_unicode_ci) |\n+-------------------------------------------------------------------------+\n| utf8_unicode_ci |\n+-------------------------------------------------------------------------+\n\nUsing CAST() to order an ENUM field as a CHAR rather than the internal\nnumerical value:\n\nCREATE TABLE enum_list (enum_field enum(\'c\',\'a\',\'b\'));\n\nINSERT INTO enum_list (enum_field) \nVALUES(\'c\'),(\'a\'),(\'c\'),(\'b\');\n\nSELECT * FROM enum_list \nORDER BY enum_field;\n+------------+\n| enum_field |\n+------------+\n| c |\n| c |\n| a |\n| b |\n+------------+\n\nSELECT * FROM enum_list \nORDER BY CAST(enum_field AS CHAR);\n+------------+\n| enum_field |\n+------------+\n| a |\n| b |\n| c |\n| c |\n+------------+\n\nFrom MariaDB 5.5.31, the following will trigger warnings, since x\'aa\' and\n\'X\'aa\' no longer behave as a number. Previously, and in all versions of MySQL,\nno warnings are triggered since they did erroneously behave as a number:\n\nSELECT CAST(0xAA AS UNSIGNED), CAST(x\'aa\' AS UNSIGNED), CAST(X\'aa\' AS\nUNSIGNED);\n+------------------------+-------------------------+-------------------------+\n| CAST(0xAA AS UNSIGNED) | CAST(x\'aa\' AS UNSIGNED) | CAST(X\'aa\' AS UNSIGNED) |\n+------------------------+-------------------------+-------------------------+\n| 170 | 0 | 0 |\n+------------------------+-------------------------+-------------------------+\n1 row in set, 2 warnings (0.00 sec)\n\nWarning (Code 1292): Truncated incorrect INTEGER value: \'\xAA\'\nWarning (Code 1292): Truncated incorrect INTEGER value: \'\xAA\'\n\nCasting to intervals:\n\nSELECT CAST(2019-01-04 INTERVAL AS DAY_SECOND(2)) AS "Cast";\n\n+-------------+\n| Cast |\n+-------------+\n| 00:20:17.00 |\n+-------------+\n\n\n\nURL: mariadb.com/kb/en/cast/','','https://mariadb.com/kb/en/cast/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (582,37,'CHAR Function','Syntax\n------\n\nCHAR(N,... [USING charset_name])\n\nDescription\n-----------\n\nCHAR() interprets each argument as an INT and returns a string consisting of\nthe characters given by the code values of those integers. NULL values are\nskipped. By default, CHAR() returns a binary string. To produce a string in a\ngiven character set, use the optional USING clause:\n\nSELECT CHARSET(CHAR(0x65)), CHARSET(CHAR(0x65 USING utf8));\n+---------------------+--------------------------------+\n| CHARSET(CHAR(0x65)) | CHARSET(CHAR(0x65 USING utf8)) |\n+---------------------+--------------------------------+\n| binary | utf8 |\n+---------------------+--------------------------------+\n\nIf USING is given and the result string is illegal for the given character\nset, a warning is issued. Also, if strict SQL mode is enabled, the result from\nCHAR() becomes NULL.\n\nExamples\n--------\n\nSELECT CHAR(77,97,114,\'105\',97,\'68\',66);\n+----------------------------------+\n| CHAR(77,97,114,\'105\',97,\'68\',66) |\n+----------------------------------+\n| MariaDB |\n+----------------------------------+\n\nSELECT CHAR(77,77.3,\'77.3\');\n+----------------------+\n| CHAR(77,77.3,\'77.3\') |\n+----------------------+\n| MMM |\n+----------------------+\n1 row in set, 1 warning (0.00 sec)\n\nWarning (Code 1292): Truncated incorrect INTEGER value: \'77.3\'\n\n\n\nURL: mariadb.com/kb/en/char-function/','','https://mariadb.com/kb/en/char-function/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (583,37,'CHARACTER_LENGTH','Syntax\n------\n\nCHARACTER_LENGTH(str)\n\nDescription\n-----------\n\nCHARACTER_LENGTH() is a synonym for CHAR_LENGTH().\n\n\n\nURL: mariadb.com/kb/en/character_length/','','https://mariadb.com/kb/en/character_length/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (584,37,'CHAR_LENGTH','Syntax\n------\n\nCHAR_LENGTH(str)\nCHARACTER_LENGTH(str)\n\nDescription\n-----------\n\nReturns the length of the given string argument, measured in characters. A\nmulti-byte character counts as a single character. This means that for a\nstring containing five two-byte characters, LENGTH() (or OCTET_LENGTH() in\nOracle mode) returns 10, whereas CHAR_LENGTH() returns 5. If the argument is\nNULL, it returns NULL.\n\nIf the argument is not a string value, it is converted into a string.\n\nIt is synonymous with the CHARACTER_LENGTH() function.\n\nExamples\n--------\n\nSELECT CHAR_LENGTH(\'MariaDB\');\n+------------------------+\n| CHAR_LENGTH(\'MariaDB\') |\n+------------------------+\n| 7 |\n+------------------------+\n\nWhen Oracle mode from MariaDB 10.3 is not set:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\') | LENGTH(\'π\') | LENGTHB(\'π\') | OCTET_LENGTH(\'π\') |\n+-------------------+--------------+---------------+--------------------+\n| 1 | 2 | 2 | 2 |\n+-------------------+--------------+---------------+--------------------+\n\nIn Oracle mode from MariaDB 10.3:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\') | LENGTH(\'π\') | LENGTHB(\'π\') | OCTET_LENGTH(\'π\') |\n+-------------------+--------------+---------------+--------------------+\n| 1 | 1 | 2 | 2 |\n+-------------------+--------------+---------------+--------------------+\n\n\n\nURL: mariadb.com/kb/en/char_length/','','https://mariadb.com/kb/en/char_length/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (585,37,'CHR','MariaDB starting with 10.3.1\n----------------------------\nThe CHR() function was introduced in MariaDB 10.3.1 to provide Oracle\ncompatibility\n\nSyntax\n------\n\nCHR(N)\n\nDescription\n-----------\n\nCHR() interprets each argument N as an integer and returns a VARCHAR(1) string\nconsisting of the character given by the code values of the integer. The\ncharacter set and collation of the string are set according to the values of\nthe character_set_database and collation_database system variables.\n\nCHR() is similar to the CHAR() function, but only accepts a single argument.\n\nCHR() is available in all sql_modes.\n\nExamples\n--------\n\nSELECT CHR(67);\n+---------+\n| CHR(67) |\n+---------+\n| C |\n+---------+\n\nSELECT CHR(\'67\');\n+-----------+\n| CHR(\'67\') |\n+-----------+\n| C |\n+-----------+\n\nSELECT CHR(\'C\');\n+----------+\n| CHR(\'C\') |\n+----------+\n| |\n+----------+\n1 row in set, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+---------+------+----------------------------------------+\n| Level | Code | Message |\n+---------+------+----------------------------------------+\n| Warning | 1292 | Truncated incorrect INTEGER value: \'C\' |\n+---------+------+----------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/chr/','','https://mariadb.com/kb/en/chr/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (586,37,'CONCAT','Syntax\n------\n\nCONCAT(str1,str2,...)\n\nDescription\n-----------\n\nReturns the string that results from concatenating the arguments. May have one\nor more arguments. If all arguments are non-binary strings, the result is a\nnon-binary string. If the arguments include any binary strings, the result is\na binary string. A numeric argument is converted to its equivalent binary\nstring form; if you want to avoid that, you can use an explicit type cast, as\nin this example:\n\nSELECT CONCAT(CAST(int_col AS CHAR), char_col);\n\nCONCAT() returns NULL if any argument is NULL.\n\nA NULL parameter hides all information contained in other parameters from the\nresult. Sometimes this is not desirable; to avoid this, you can:\n\n* Use the CONCAT_WS() function with an empty separator, because that function\nis NULL-safe.\n* Use IFNULL() to turn NULLs into empty strings.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nIn Oracle mode from MariaDB 10.3, CONCAT ignores NULL.\n\nExamples\n--------\n\nSELECT CONCAT(\'Ma\', \'ria\', \'DB\');\n+---------------------------+\n| CONCAT(\'Ma\', \'ria\', \'DB\') |\n+---------------------------+\n| MariaDB |\n+---------------------------+\n\nSELECT CONCAT(\'Ma\', \'ria\', NULL, \'DB\');\n+---------------------------------+\n| CONCAT(\'Ma\', \'ria\', NULL, \'DB\') |\n+---------------------------------+\n| NULL |\n+---------------------------------+\n\nSELECT CONCAT(42.0);\n+--------------+\n| CONCAT(42.0) |\n+--------------+\n| 42.0 |\n+--------------+\n\nUsing IFNULL() to handle NULLs:\n\nSELECT CONCAT(\'The value of @v is: \', IFNULL(@v, \'\'));\n+------------------------------------------------+\n| CONCAT(\'The value of @v is: \', IFNULL(@v, \'\')) |\n+------------------------------------------------+\n| The value of @v is: |\n+------------------------------------------------+\n\nIn Oracle mode, from MariaDB 10.3:\n\nSELECT CONCAT(\'Ma\', \'ria\', NULL, \'DB\');\n+---------------------------------+\n| CONCAT(\'Ma\', \'ria\', NULL, \'DB\') |\n+---------------------------------+\n| MariaDB |\n+---------------------------------+\n\n\n\nURL: mariadb.com/kb/en/concat/','','https://mariadb.com/kb/en/concat/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (587,37,'CONCAT_WS','Syntax\n------\n\nCONCAT_WS(separator,str1,str2,...)\n\nDescription\n-----------\n\nCONCAT_WS() stands for Concatenate With Separator and is a special form of\nCONCAT(). The first argument is the separator for the rest of the arguments.\nThe separator is added between the strings to be concatenated. The separator\ncan be a string, as can the rest of the arguments.\n\nIf the separator is NULL, the result is NULL; all other NULL values are\nskipped. This makes CONCAT_WS() suitable when you want to concatenate some\nvalues and avoid losing all information if one of them is NULL.\n\nExamples\n--------\n\nSELECT CONCAT_WS(\',\',\'First name\',\'Second name\',\'Last Name\');\n+-------------------------------------------------------+\n| CONCAT_WS(\',\',\'First name\',\'Second name\',\'Last Name\') |\n+-------------------------------------------------------+\n| First name,Second name,Last Name |\n+-------------------------------------------------------+\n\nSELECT CONCAT_WS(\'-\',\'Floor\',NULL,\'Room\');\n+------------------------------------+\n| CONCAT_WS(\'-\',\'Floor\',NULL,\'Room\') |\n+------------------------------------+\n| Floor-Room |\n+------------------------------------+\n\nIn some cases, remember to include a space in the separator string:\n\nSET @a = \'gnu\', @b = \'penguin\', @c = \'sea lion\';\nQuery OK, 0 rows affected (0.00 sec)\n\nSELECT CONCAT_WS(\', \', @a, @b, @c);\n+-----------------------------+\n| CONCAT_WS(\', \', @a, @b, @c) |\n+-----------------------------+\n| gnu, penguin, sea lion |\n+-----------------------------+\n\nUsing CONCAT_WS() to handle NULLs:\n\nSET @a = \'a\', @b = NULL, @c = \'c\';\n\nSELECT CONCAT_WS(\'\', @a, @b, @c);\n+---------------------------+\n| CONCAT_WS(\'\', @a, @b, @c) |\n+---------------------------+\n| ac |\n+---------------------------+\n\n\n\nURL: mariadb.com/kb/en/concat_ws/','','https://mariadb.com/kb/en/concat_ws/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (588,37,'CONVERT','Syntax\n------\n\nCONVERT(expr,type), CONVERT(expr USING transcoding_name)\n\nDescription\n-----------\n\nThe CONVERT() and CAST() functions take a value of one type and produce a\nvalue of another type.\n\nThe type can be one of the following values:\n\n* BINARY\n* CHAR\n* DATE\n* DATETIME \n* DECIMAL[(M[,D])]\n* DOUBLE\n* FLOAT (from MariaDB 10.4.5)\n* INTEGER \nShort for SIGNED INTEGER\n\n* SIGNED [INTEGER]\n* UNSIGNED [INTEGER]\n* TIME\n* VARCHAR (in Oracle mode, from MariaDB 10.3)\n\nNote that in MariaDB, INT and INTEGER are the same thing.\n\nBINARY produces a string with the BINARY data type. If the optional length is\ngiven, BINARY(N) causes the cast to use no more than N bytes of the argument.\nValues shorter than the given number in bytes are padded with 0x00 bytes to\nmake them equal the length value.\n\nCHAR(N) causes the cast to use no more than the number of characters given in\nthe argument.\n\nThe main difference between the CAST() and CONVERT() is that\nCONVERT(expr,type) is ODBC syntax while CAST(expr as type) and CONVERT(...\nUSING ...) are SQL92 syntax.\n\nCONVERT() with USING is used to convert data between different character sets.\nIn MariaDB, transcoding names are the same as the corresponding character set\nnames. For example, this statement converts the string \'abc\' in the default\ncharacter set to the corresponding string in the utf8 character set:\n\nSELECT CONVERT(\'abc\' USING utf8);\n\nExamples\n--------\n\nSELECT enum_col FROM tbl_name \nORDER BY CAST(enum_col AS CHAR);\n\nConverting a BINARY to string to permit the LOWER function to work:\n\nSET @x = \'AardVark\';\n\nSET @x = BINARY \'AardVark\';\n\nSELECT LOWER(@x), LOWER(CONVERT (@x USING latin1));\n+-----------+----------------------------------+\n| LOWER(@x) | LOWER(CONVERT (@x USING latin1)) |\n+-----------+----------------------------------+\n| AardVark | aardvark |\n+-----------+----------------------------------+\n\n\n\nURL: mariadb.com/kb/en/convert/','','https://mariadb.com/kb/en/convert/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (589,37,'ELT','Syntax\n------\n\nELT(N, str1[, str2, str3,...])\n\nDescription\n-----------\n\nTakes a numeric argument and a series of string arguments. Returns the string\nthat corresponds to the given numeric position. For instance, it returns str1\nif N is 1, str2 if N is 2, and so on. If the numeric argument is a FLOAT,\nMariaDB rounds it to the nearest INTEGER. If the numeric argument is less than\n1, greater than the total number of arguments, or not a number, ELT() returns\nNULL. It must have at least two arguments.\n\nIt is complementary to the FIELD() function.\n\nExamples\n--------\n\nSELECT ELT(1, \'ej\', \'Heja\', \'hej\', \'foo\');\n+------------------------------------+\n| ELT(1, \'ej\', \'Heja\', \'hej\', \'foo\') |\n+------------------------------------+\n| ej |\n+------------------------------------+\n\nSELECT ELT(4, \'ej\', \'Heja\', \'hej\', \'foo\');\n+------------------------------------+\n| ELT(4, \'ej\', \'Heja\', \'hej\', \'foo\') |\n+------------------------------------+\n| foo |\n+------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/elt/','','https://mariadb.com/kb/en/elt/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (590,37,'EXPORT_SET','Syntax\n------\n\nEXPORT_SET(bits, on, off[, separator[, number_of_bits]])\n\nDescription\n-----------\n\nTakes a minimum of three arguments. Returns a string where each bit in the\ngiven bits argument is returned, with the string values given for on and off.\n\nBits are examined from right to left, (from low-order to high-order bits).\nStrings are added to the result from left to right, separated by a separator\nstring (defaults as \',\'). You can optionally limit the number of bits the\nEXPORT_SET() function examines using the number_of_bits option.\n\nIf any of the arguments are set as NULL, the function returns NULL.\n\nExamples\n--------\n\nSELECT EXPORT_SET(5,\'Y\',\'N\',\',\',4);\n+-----------------------------+\n| EXPORT_SET(5,\'Y\',\'N\',\',\',4) |\n+-----------------------------+\n| Y,N,Y,N |\n+-----------------------------+\n\nSELECT EXPORT_SET(6,\'1\',\'0\',\',\',10);\n+------------------------------+\n| EXPORT_SET(6,\'1\',\'0\',\',\',10) |\n+------------------------------+\n| 0,1,1,0,0,0,0,0,0,0 |\n+------------------------------+\n\n\n\nURL: mariadb.com/kb/en/export_set/','','https://mariadb.com/kb/en/export_set/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (591,37,'EXTRACTVALUE','Syntax\n------\n\nEXTRACTVALUE(xml_frag, xpath_expr)\n\nDescription\n-----------\n\nThe EXTRACTVALUE() function takes two string arguments: a fragment of XML\nmarkup and an XPath expression, (also known as a locator). It returns the text\n(That is, CDDATA), of the first text node which is a child of the element or\nelements matching the XPath expression.\n\nIn cases where a valid XPath expression does not match any text nodes in a\nvalid XML fragment, (including the implicit /text() expression), the\nEXTRACTVALUE() function returns an empty string.\n\nInvalid Arguments\n-----------------\n\nWhen either the XML fragment or the XPath expression is NULL, the\nEXTRACTVALUE() function returns NULL. When the XML fragment is invalid, it\nraises a warning Code 1525:\n\nWarning (Code 1525): Incorrect XML value: \'parse error at line 1 pos 11:\nunexpected END-OF-INPUT\'\n\nWhen the XPath value is invalid, it generates an Error 1105:\n\nERROR 1105 (HY000): XPATH syntax error: \')\'\n\nExplicit text() Expressions\n---------------------------\n\nThis function is the equivalent of performing a match using the XPath\nexpression after appending /text(). In other words:\n\nSELECT\n EXTRACTVALUE(\'<cases><case>example</case></cases>\', \'/cases/case\')\n AS \'Base Example\',\n EXTRACTVALUE(\'<cases><case>example</case></cases>\', \'/cases/case/text()\')\n AS \'text() Example\';\n+--------------+----------------+\n| Base Example | text() Example |\n+--------------+----------------+\n| example | example |\n+--------------+----------------+\n\nCount Matches\n-------------\n\nWhen EXTRACTVALUE() returns multiple matches, it returns the content of the\nfirst child text node of each matching element, in the matched order, as a\nsingle, space-delimited string.\n\nBy design, the EXTRACTVALUE() function makes no distinction between a match on\nan empty element and no match at all. If you need to determine whether no\nmatching element was found in the XML fragment or if an element was found that\ncontained no child text nodes, use the XPath count() function.\n\nFor instance, when looking for a value that exists, but contains no child text\nnodes, you would get a count of the number of matching instances:\n\nSELECT\n EXTRACTVALUE(\'<cases><case/></cases>\', \'/cases/case\')\n AS \'Empty Example\',\n EXTRACTVALUE(\'<cases><case/></cases>\', \'count(/cases/case)\')\n AS \'count() Example\';\n+---------------+-----------------+\n| Empty Example | count() Example |\n+---------------+-----------------+\n| | 1 |\n+---------------+-----------------+\n\nAlternatively, when looking for a value that doesn\'t exist, count() returns 0.\n\nSELECT\n EXTRACTVALUE(\'<cases><case/></cases>\', \'/cases/person\')\n AS \'No Match Example\',\n EXTRACTVALUE(\'<cases><case/></cases>\', \'count(/cases/person)\')\n AS \'count() Example\';\n+------------------+-----------------+\n| No Match Example | count() Example |\n+------------------+-----------------+\n| | 0|\n+------------------+-----------------+\n\nMatches\n-------\n\nImportant: The EXTRACTVALUE() function only returns CDDATA. It does not return\ntags that the element might contain or the text that these child elements\ncontain.\n\nSELECT\n\nEXTRACTVALUE(\'<cases><case>Person<email>x@example.com</email></case></cases>\',\n\'/cases\')\n AS Case;\n+--------+\n| Case |\n+--------+\n| Person |\n+--------+\n\nNote, in the above example, while the XPath expression matches to the parent\n<case> instance, it does not return the contained <email> tag or its content.\n\nExamples\n--------\n\nSELECT\n ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/a\') AS val1,\n ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/a/b\') AS val2,\n ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'//b\') AS val3,\n ExtractValue(\'<a>ccc<b>ddd</b></a>\', \'/b\') AS val4,\n ExtractValue(\'<a>ccc<b>ddd</b><b>eee</b></a>\', \'//b\') AS val5;\n+------+------+------+------+---------+\n| val1 | val2 | val3 | val4 | val5 |\n+------+------+------+------+---------+\n| ccc | ddd | ddd | | ddd eee |\n+------+------+------+------+---------+\n\n\n\nURL: mariadb.com/kb/en/extractvalue/','','https://mariadb.com/kb/en/extractvalue/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (592,37,'FIELD','Syntax\n------\n\nFIELD(pattern, str1[,str2,...])\n\nDescription\n-----------\n\nReturns the index position of the string or number matching the given pattern.\nReturns 0 in the event that none of the arguments match the pattern. Raises an\nError 1582 if not given at least two arguments.\n\nWhen all arguments given to the FIELD() function are strings, they are treated\nas case-insensitive. When all the arguments are numbers, they are treated as\nnumbers. Otherwise, they are treated as doubles.\n\nIf the given pattern occurs more than once, the FIELD() function only returns\nthe index of the first instance. If the given pattern is NULL, the function\nreturns 0, as a NULL pattern always fails to match.\n\nThis function is complementary to the ELT() function.\n\nExamples\n--------\n\nSELECT FIELD(\'ej\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\') \n AS \'Field Results\';\n+---------------+\n| Field Results | \n+---------------+\n| 2 |\n+---------------+\n\nSELECT FIELD(\'fo\', \'Hej\', \'ej\', \'Heja\', \'hej\', \'foo\')\n AS \'Field Results\';\n+---------------+\n| Field Results | \n+---------------+\n| 0 |\n+---------------+\n\nSELECT FIELD(1, 2, 3, 4, 5, 1) AS \'Field Results\';\n+---------------+\n| Field Results |\n+---------------+\n| 5 |\n+---------------+\n\nSELECT FIELD(NULL, 2, 3) AS \'Field Results\';\n+---------------+\n| Field Results |\n+---------------+\n| 0 |\n+---------------+\n\nSELECT FIELD(\'fail\') AS \'Field Results\';\nError 1582 (42000): Incorrect parameter count in call\nto native function \'field\'\n\n\n\nURL: mariadb.com/kb/en/field/','','https://mariadb.com/kb/en/field/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (593,37,'FIND_IN_SET','Syntax\n------\n\nFIND_IN_SET(pattern, strlist)\n\nDescription\n-----------\n\nReturns the index position where the given pattern occurs in a string list.\nThe first argument is the pattern you want to search for. The second argument\nis a string containing comma-separated variables. If the second argument is of\nthe SET data-type, the function is optimized to use bit arithmetic.\n\nIf the pattern does not occur in the string list or if the string list is an\nempty string, the function returns 0. If either argument is NULL, the function\nreturns NULL. The function does not return the correct result if the pattern\ncontains a comma (",") character.\n\nExamples\n--------\n\nSELECT FIND_IN_SET(\'b\',\'a,b,c,d\') AS "Found Results";\n+---------------+\n| Found Results |\n+---------------+\n| 2 |\n+---------------+\n\n\n\nURL: mariadb.com/kb/en/find_in_set/','','https://mariadb.com/kb/en/find_in_set/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (594,37,'FORMAT','Syntax\n------\n\nFORMAT(num, decimal_position[, locale])\n\nDescription\n-----------\n\nFormats the given number for display as a string, adding separators to\nappropriate position and rounding the results to the given decimal position.\nFor instance, it would format 15233.345 to 15,233.35.\n\nIf the given decimal position is 0, it rounds to return no decimal point or\nfractional part. You can optionally specify a locale value to format numbers\nto the pattern appropriate for the given region.\n\nExamples\n--------\n\nSELECT FORMAT(1234567890.09876543210, 4) AS \'Format\';\n+--------------------+\n| Format |\n+--------------------+\n| 1,234,567,890.0988 |\n+--------------------+\n\nSELECT FORMAT(1234567.89, 4) AS \'Format\';\n+----------------+\n| Format |\n+----------------+\n| 1,234,567.8900 |\n+----------------+\n\nSELECT FORMAT(1234567.89, 0) AS \'Format\';\n+-----------+\n| Format |\n+-----------+\n| 1,234,568 |\n+-----------+\n\nSELECT FORMAT(123456789,2,\'rm_CH\') AS \'Format\';\n+----------------+\n| Format |\n+----------------+\n| 123\'456\'789,00 |\n+----------------+\n\n\n\nURL: mariadb.com/kb/en/format/','','https://mariadb.com/kb/en/format/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (595,37,'FROM_BASE64','Syntax\n------\n\nFROM_BASE64(str)\n\nDescription\n-----------\n\nDecodes the given base-64 encode string, returning the result as a binary\nstring. Returns NULL if the given string is NULL or if it\'s invalid.\n\nIt is the reverse of the TO_BASE64 function.\n\nThere are numerous methods to base-64 encode a string. MariaDB uses the\nfollowing:\n\n* It encodes alphabet value 64 as \'+\'.\n* It encodes alphabet value 63 as \'/\'.\n* It codes output in groups of four printable characters. Each three byte of\ndata encoded uses four characters. If the final group is incomplete, it pads\nthe difference with the \'=\' character.\n* It divides long output, adding a new line very 76 characters.\n* In decoding, it recognizes and ignores newlines, carriage returns, tabs and\nspace whitespace characters.\n\nSELECT TO_BASE64(\'Maria\') AS \'Input\';\n+-----------+\n| Input |\n+-----------+\n| TWFyaWE= |\n+-----------+\n\nSELECT FROM_BASE64(\'TWFyaWE=\') AS \'Output\';\n+--------+\n| Output |\n+--------+\n| Maria |\n+--------+\n\n\n\nURL: mariadb.com/kb/en/from_base64/','','https://mariadb.com/kb/en/from_base64/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (596,37,'HEX','Syntax\n------\n\nHEX(N_or_S)\n\nDescription\n-----------\n\nIf N_or_S is a number, returns a string representation of the hexadecimal\nvalue of N, where N is a longlong (BIGINT) number. This is equivalent to\nCONV(N,10,16).\n\nIf N_or_S is a string, returns a hexadecimal string representation of N_or_S\nwhere each byte of each character in N_or_S is converted to two hexadecimal\ndigits. If N_or_S is NULL, returns NULL. The inverse of this operation is\nperformed by the UNHEX() function.\n\nMariaDB starting with 10.5.0\n----------------------------\nHEX() with an INET6 argument returns a hexadecimal representation of the\nunderlying 16-byte binary string.\n\nExamples\n--------\n\nSELECT HEX(255);\n+----------+\n| HEX(255) |\n+----------+\n| FF |\n+----------+\n\nSELECT 0x4D617269614442;\n+------------------+\n| 0x4D617269614442 |\n+------------------+\n| MariaDB |\n+------------------+\n\nSELECT HEX(\'MariaDB\');\n+----------------+\n| HEX(\'MariaDB\') |\n+----------------+\n| 4D617269614442 |\n+----------------+\n\nFrom MariaDB 10.5.0:\n\nSELECT HEX(CAST(\'2001:db8::ff00:42:8329\' AS INET6));\n+----------------------------------------------+\n| HEX(CAST(\'2001:db8::ff00:42:8329\' AS INET6)) |\n+----------------------------------------------+\n| 20010DB8000000000000FF0000428329 |\n+----------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/hex/','','https://mariadb.com/kb/en/hex/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (597,37,'INSERT Function','Syntax\n------\n\nINSERT(str,pos,len,newstr)\n\nDescription\n-----------\n\nReturns the string str, with the substring beginning at position pos and len\ncharacters long replaced by the string newstr. Returns the original string if\npos is not within the length of the string. Replaces the rest of the string\nfrom position pos if len is not within the length of the rest of the string.\nReturns NULL if any argument is NULL.\n\nExamples\n--------\n\nSELECT INSERT(\'Quadratic\', 3, 4, \'What\');\n+-----------------------------------+\n| INSERT(\'Quadratic\', 3, 4, \'What\') |\n+-----------------------------------+\n| QuWhattic |\n+-----------------------------------+\n\nSELECT INSERT(\'Quadratic\', -1, 4, \'What\');\n+------------------------------------+\n| INSERT(\'Quadratic\', -1, 4, \'What\') |\n+------------------------------------+\n| Quadratic |\n+------------------------------------+\n\nSELECT INSERT(\'Quadratic\', 3, 100, \'What\');\n+-------------------------------------+\n| INSERT(\'Quadratic\', 3, 100, \'What\') |\n+-------------------------------------+\n| QuWhat |\n+-------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/insert-function/','','https://mariadb.com/kb/en/insert-function/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (598,37,'INSTR','Syntax\n------\n\nINSTR(str,substr)\n\nDescription\n-----------\n\nReturns the position of the first occurrence of substring substr in string\nstr. This is the same as the two-argument form of LOCATE(), except that the\norder of the arguments is reversed.\n\nINSTR() performs a case-insensitive search.\n\nIf any argument is NULL, returns NULL.\n\nExamples\n--------\n\nSELECT INSTR(\'foobarbar\', \'bar\');\n+---------------------------+\n| INSTR(\'foobarbar\', \'bar\') |\n+---------------------------+\n| 4 |\n+---------------------------+\n\nSELECT INSTR(\'My\', \'Maria\');\n+----------------------+\n| INSTR(\'My\', \'Maria\') |\n+----------------------+\n| 0 |\n+----------------------+\n\n\n\nURL: mariadb.com/kb/en/instr/','','https://mariadb.com/kb/en/instr/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (599,37,'LCASE','Syntax\n------\n\nLCASE(str)\n\nDescription\n-----------\n\nLCASE() is a synonym for LOWER().\n\n\n\nURL: mariadb.com/kb/en/lcase/','','https://mariadb.com/kb/en/lcase/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (600,37,'LEFT','Syntax\n------\n\nLEFT(str,len)\n\nDescription\n-----------\n\nReturns the leftmost len characters from the string str, or NULL if any\nargument is NULL.\n\nExamples\n--------\n\nSELECT LEFT(\'MariaDB\', 5);\n+--------------------+\n| LEFT(\'MariaDB\', 5) |\n+--------------------+\n| Maria |\n+--------------------+\n\n\n\nURL: mariadb.com/kb/en/left/','','https://mariadb.com/kb/en/left/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (601,37,'LENGTH','Syntax\n------\n\nLENGTH(str)\n\nDescription\n-----------\n\nReturns the length of the string str.\n\nIn the default mode, when Oracle mode from MariaDB 10.3 is not set, the length\nis measured in bytes. In this case, a multi-byte character counts as multiple\nbytes. This means that for a string containing five two-byte characters,\nLENGTH() returns 10, whereas CHAR_LENGTH() returns 5.\n\nWhen running Oracle mode from MariaDB 10.3, the length is measured in\ncharacters, and LENGTH is a synonym for CHAR_LENGTH().\n\nIf str is not a string value, it is converted into a string. If str is NULL,\nthe function returns NULL.\n\nExamples\n--------\n\nSELECT LENGTH(\'MariaDB\');\n+-------------------+\n| LENGTH(\'MariaDB\') |\n+-------------------+\n| 7 |\n+-------------------+\n\nWhen Oracle mode from MariaDB 10.3 is not set:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\') | LENGTH(\'π\') | LENGTHB(\'π\') | OCTET_LENGTH(\'π\') |\n+-------------------+--------------+---------------+--------------------+\n| 1 | 2 | 2 | 2 |\n+-------------------+--------------+---------------+--------------------+\n\nIn Oracle mode from MariaDB 10.3:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\') | LENGTH(\'π\') | LENGTHB(\'π\') | OCTET_LENGTH(\'π\') |\n+-------------------+--------------+---------------+--------------------+\n| 1 | 1 | 2 | 2 |\n+-------------------+--------------+---------------+--------------------+\n\n\n\nURL: mariadb.com/kb/en/length/','','https://mariadb.com/kb/en/length/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (602,37,'LENGTHB','MariaDB starting with 10.3.1\n----------------------------\nIntroduced in MariaDB 10.3.1 as part of the Oracle compatibility enhancements.\n\nSyntax\n------\n\nLENGTHB(str)\n\nDescription\n-----------\n\nLENGTHB() returns the length of the given string, in bytes. When Oracle mode\nis not set, this is a synonym for LENGTH.\n\nA multi-byte character counts as multiple bytes. This means that for a string\ncontaining five two-byte characters, LENGTHB() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nIf str is not a string value, it is converted into a string. If str is NULL,\nthe function returns NULL.\n\nExamples\n--------\n\nWhen Oracle mode from MariaDB 10.3 is not set:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\') | LENGTH(\'π\') | LENGTHB(\'π\') | OCTET_LENGTH(\'π\') |\n+-------------------+--------------+---------------+--------------------+\n| 1 | 2 | 2 | 2 |\n+-------------------+--------------+---------------+--------------------+\n\nIn Oracle mode from MariaDB 10.3:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\') | LENGTH(\'π\') | LENGTHB(\'π\') | OCTET_LENGTH(\'π\') |\n+-------------------+--------------+---------------+--------------------+\n| 1 | 1 | 2 | 2 |\n+-------------------+--------------+---------------+--------------------+\n\n\n\nURL: mariadb.com/kb/en/lengthb/','','https://mariadb.com/kb/en/lengthb/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (603,37,'LIKE','Syntax\n------\n\nexpr LIKE pat [ESCAPE \'escape_char\']\nexpr NOT LIKE pat [ESCAPE \'escape_char\']\n\nDescription\n-----------\n\nTests whether expr matches the pattern pat. Returns either 1 (TRUE) or 0\n(FALSE). Both expr and pat may be any valid expression and are evaluated to\nstrings. Patterns may use the following wildcard characters:\n\n* % matches any number of characters, including zero.\n* _ matches any single character.\n\nUse NOT LIKE to test if a string does not match a pattern. This is equivalent\nto using the NOT operator on the entire LIKE expression.\n\nIf either the expression or the pattern is NULL, the result is NULL.\n\nLIKE performs case-insensitive substring matches if the collation for the\nexpression and pattern is case-insensitive. For case-sensitive matches,\ndeclare either argument to use a binary collation using COLLATE, or coerce\neither of them to a BINARY string using CAST. Use SHOW COLLATION to get a list\nof available collations. Collations ending in _bin are case-sensitive.\n\nNumeric arguments are coerced to binary strings.\n\nThe _ wildcard matches a single character, not byte. It will only match a\nmulti-byte character if it is valid in the expression\'s character set. For\nexample, _ will match _utf8"€", but it will not match _latin1"€" because the\nEuro sign is not a valid latin1 character. If necessary, use CONVERT to use\nthe expression in a different character set.\n\nIf you need to match the characters _ or %, you must escape them. By default,\nyou can prefix the wildcard characters the backslash character \ to escape\nthem. The backslash is used both to encode special characters like newlines\nwhen a string is parsed as well as to escape wildcards in a pattern after\nparsing. Thus, to match an actual backslash, you sometimes need to\ndouble-escape it as "\\\\\\\\".\n\nTo avoid difficulties with the backslash character, you can change the\nwildcard escape character using ESCAPE in a LIKE expression. The argument to\nESCAPE must be a single-character string.\n\nExamples\n--------\n\nSelect the days that begin with "T":\n\nCREATE TABLE t1 (d VARCHAR(16));\nINSERT INTO t1 VALUES \n ("Monday"), ("Tuesday"), ("Wednesday"),\n ("Thursday"), ("Friday"), ("Saturday"), ("Sunday");\nSELECT * FROM t1 WHERE d LIKE "T%";\n\nSELECT * FROM t1 WHERE d LIKE "T%";\n+----------+\n| d |\n+----------+\n| Tuesday |\n| Thursday |\n+----------+\n\nSelect the days that contain the substring "es":\n\nSELECT * FROM t1 WHERE d LIKE "%es%";\n\nSELECT * FROM t1 WHERE d LIKE "%es%";\n+-----------+\n| d |\n+-----------+\n| Tuesday |\n| Wednesday |\n+-----------+\n\nSelect the six-character day names:\n\nSELECT * FROM t1 WHERE d like "___day";\n\nSELECT * FROM t1 WHERE d like "___day";\n+---------+\n| d |\n+---------+\n| Monday |\n| Friday |\n| Sunday |\n+---------+\n\nWith the default collations, LIKE is case-insensitive:\n\nSELECT * FROM t1 where d like "t%";\n\nSELECT * FROM t1 where d like "t%";\n+----------+\n| d |\n+----------+\n| Tuesday |\n| Thursday |\n+----------+\n\nUse COLLATE to specify a binary collation, forcing case-sensitive matches:\n\nSELECT * FROM t1 WHERE d like "t%" COLLATE latin1_bin;\n\nSELECT * FROM t1 WHERE d like "t%" COLLATE latin1_bin;\nEmpty set (0.00 sec)\n\nYou can include functions and operators in the expression to match. Select\ndates based on their day name:\n\nCREATE TABLE t2 (d DATETIME);\nINSERT INTO t2 VALUES\n ("2007-01-30 21:31:07"),\n ("1983-10-15 06:42:51"),\n ("2011-04-21 12:34:56"),\n ("2011-10-30 06:31:41"),\n ("2011-01-30 14:03:25"),\n ("2004-10-07 11:19:34");\nSELECT * FROM t2 WHERE DAYNAME(d) LIKE "T%";\n\nSELECT * FROM t2 WHERE DAYNAME(d) LIKE "T%";\n+------------------+\n| d |\n+------------------+\n| 2007-01-30 21:31 |\n| 2011-04-21 12:34 |\n| 2004-10-07 11:19 |\n+------------------+\n3 rows in set, 7 warnings (0.00 sec)\n\nOptimizing LIKE\n---------------\n\n* MariaDB can use indexes for LIKE on string columns in the case where the\nLIKE doesn\'t start with % or _.\n* Starting from MariaDB 10.0, one can set the\noptimizer_use_condition_selectivity variable to 5. If this is done, then the\noptimizer will read optimizer_selectivity_sampling_limit rows to calculate the\nselectivity of the LIKE expression before starting to calculate the query\nplan. This can help speed up some LIKE queries by providing the optimizer with\nmore information about your data.\n\n\n\nURL: mariadb.com/kb/en/like/','','https://mariadb.com/kb/en/like/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (604,37,'LOAD_FILE','Syntax\n------\n\nLOAD_FILE(file_name)\n\nDescription\n-----------\n\nReads the file and returns the file contents as a string. To use this\nfunction, the file must be located on the server host, you must specify the\nfull path name to the file, and you must have the FILE privilege. The file\nmust be readable by all and it must be less than the size, in bytes, of the\nmax_allowed_packet system variable. If the secure_file_priv system variable is\nset to a non-empty directory name, the file to be loaded must be located in\nthat directory.\n\nIf the file does not exist or cannot be read because one of the preceding\nconditions is not satisfied, the function returns NULL.\n\nSince MariaDB 5.1, the character_set_filesystem system variable has controlled\ninterpretation of file names that are given as literal strings.\n\nStatements using the LOAD_FILE() function are not safe for statement based\nreplication. This is because the slave will execute the LOAD_FILE() command\nitself. If the file doesn\'t exist on the slave, the function will return NULL.\n\nExamples\n--------\n\nUPDATE t SET blob_col=LOAD_FILE(\'/tmp/picture\') WHERE id=1;\n\n\n\nURL: mariadb.com/kb/en/load_file/','','https://mariadb.com/kb/en/load_file/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (605,37,'LOCATE','Syntax\n------\n\nLOCATE(substr,str), LOCATE(substr,str,pos)\n\nDescription\n-----------\n\nThe first syntax returns the position of the first occurrence of substring\nsubstr in string str. The second syntax returns the position of the first\noccurrence of substring substr in string str, starting at position pos.\nReturns 0 if substr is not in str.\n\nLOCATE() performs a case-insensitive search.\n\nIf any argument is NULL, returns NULL.\n\nINSTR() is the same as the two-argument form of LOCATE(), except that the\norder of the arguments is reversed.\n\nExamples\n--------\n\nSELECT LOCATE(\'bar\', \'foobarbar\');\n+----------------------------+\n| LOCATE(\'bar\', \'foobarbar\') |\n+----------------------------+\n| 4 |\n+----------------------------+\n\nSELECT LOCATE(\'My\', \'Maria\');\n+-----------------------+\n| LOCATE(\'My\', \'Maria\') |\n+-----------------------+\n| 0 |\n+-----------------------+\n\nSELECT LOCATE(\'bar\', \'foobarbar\', 5);\n+-------------------------------+\n| LOCATE(\'bar\', \'foobarbar\', 5) |\n+-------------------------------+\n| 7 |\n+-------------------------------+\n\n\n\nURL: mariadb.com/kb/en/locate/','','https://mariadb.com/kb/en/locate/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (606,37,'LOWER','Syntax\n------\n\nLOWER(str)\n\nDescription\n-----------\n\nReturns the string str with all characters changed to lowercase according to\nthe current character set mapping. The default is latin1 (cp1252 West\nEuropean).\n\nExamples\n--------\n\nSELECT LOWER(\'QUADRATICALLY\');\n+------------------------+\n| LOWER(\'QUADRATICALLY\') |\n+------------------------+\n| quadratically |\n+------------------------+\n\nLOWER() (and UPPER()) are ineffective when applied to binary strings (BINARY,\nVARBINARY, BLOB). To perform lettercase conversion, CONVERT the string to a\nnon-binary string:\n\nSET @str = BINARY \'North Carolina\';\n\nSELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));\n+----------------+-----------------------------------+\n| LOWER(@str) | LOWER(CONVERT(@str USING latin1)) |\n+----------------+-----------------------------------+\n| North Carolina | north carolina |\n+----------------+-----------------------------------+\n\n\n\nURL: mariadb.com/kb/en/lower/','','https://mariadb.com/kb/en/lower/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (607,37,'LPAD','Syntax\n------\n\nLPAD(str, len [,padstr])\n\nDescription\n-----------\n\nReturns the string str, left-padded with the string padstr to a length of len\ncharacters. If str is longer than len, the return value is shortened to len\ncharacters. If padstr is omitted, the LPAD function pads spaces.\n\nPrior to MariaDB 10.3.1, the padstr parameter was mandatory.\n\nReturns NULL if given a NULL argument. If the result is empty (zero length),\nreturns either an empty string or, from MariaDB 10.3.6 with SQL_MODE=Oracle,\nNULL.\n\nThe Oracle mode version of the function can be accessed outside of Oracle mode\nby using LPAD_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT LPAD(\'hello\',10,\'.\');\n+----------------------+\n| LPAD(\'hello\',10,\'.\') |\n+----------------------+\n| .....hello |\n+----------------------+\n\nSELECT LPAD(\'hello\',2,\'.\');\n+---------------------+\n| LPAD(\'hello\',2,\'.\') |\n+---------------------+\n| he |\n+---------------------+\n\nFrom MariaDB 10.3.1, with the pad string defaulting to space.\n\nSELECT LPAD(\'hello\',10);\n+------------------+\n| LPAD(\'hello\',10) |\n+------------------+\n| hello |\n+------------------+\n\nOracle mode version from MariaDB 10.3.6:\n\nSELECT LPAD(\'\',0),LPAD_ORACLE(\'\',0);\n+------------+-------------------+\n| LPAD(\'\',0) | LPAD_ORACLE(\'\',0) |\n+------------+-------------------+\n| | NULL |\n+------------+-------------------+\n\n\n\nURL: mariadb.com/kb/en/lpad/','','https://mariadb.com/kb/en/lpad/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (608,37,'LTRIM','Syntax\n------\n\nLTRIM(str)\n\nDescription\n-----------\n\nReturns the string str with leading space characters removed.\n\nReturns NULL if given a NULL argument. If the result is empty, returns either\nan empty string, or, from MariaDB 10.3.6 with SQL_MODE=Oracle, NULL.\n\nThe Oracle mode version of the function can be accessed outside of Oracle mode\nby using LTRIM_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT QUOTE(LTRIM(\' MariaDB \'));\n+-------------------------------+\n| QUOTE(LTRIM(\' MariaDB \')) |\n+-------------------------------+\n| \'MariaDB \' |\n+-------------------------------+\n\nOracle mode version from MariaDB 10.3.6:\n\nSELECT LTRIM(\'\'),LTRIM_ORACLE(\'\');\n+-----------+------------------+\n| LTRIM(\'\') | LTRIM_ORACLE(\'\') |\n+-----------+------------------+\n| | NULL |\n+-----------+------------------+\n\n\n\nURL: mariadb.com/kb/en/ltrim/','','https://mariadb.com/kb/en/ltrim/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (609,37,'MAKE_SET','Syntax\n------\n\nMAKE_SET(bits,str1,str2,...)\n\nDescription\n-----------\n\nReturns a set value (a string containing substrings separated by ","\ncharacters) consisting of the strings that have the corresponding bit in bits\nset. str1 corresponds to bit 0, str2 to bit 1, and so on. NULL values in str1,\nstr2, ... are not appended to the result.\n\nExamples\n--------\n\nSELECT MAKE_SET(1,\'a\',\'b\',\'c\');\n+-------------------------+\n| MAKE_SET(1,\'a\',\'b\',\'c\') |\n+-------------------------+\n| a |\n+-------------------------+\n\nSELECT MAKE_SET(1 | 4,\'hello\',\'nice\',\'world\');\n+----------------------------------------+\n| MAKE_SET(1 | 4,\'hello\',\'nice\',\'world\') |\n+----------------------------------------+\n| hello,world |\n+----------------------------------------+\n\nSELECT MAKE_SET(1 | 4,\'hello\',\'nice\',NULL,\'world\');\n+---------------------------------------------+\n| MAKE_SET(1 | 4,\'hello\',\'nice\',NULL,\'world\') |\n+---------------------------------------------+\n| hello |\n+---------------------------------------------+\n\nSELECT QUOTE(MAKE_SET(0,\'a\',\'b\',\'c\'));\n+--------------------------------+\n| QUOTE(MAKE_SET(0,\'a\',\'b\',\'c\')) |\n+--------------------------------+\n| \'\' |\n+--------------------------------+\n\n\n\nURL: mariadb.com/kb/en/make_set/','','https://mariadb.com/kb/en/make_set/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (610,37,'MATCH AGAINST','Syntax\n------\n\nMATCH (col1,col2,...) AGAINST (expr [search_modifier])\n\nDescription\n-----------\n\nA special construct used to perform a fulltext search on a fulltext index.\n\nSee Fulltext Index Overview for a full description, and Full-text Indexes for\nmore articles on the topic.\n\nExamples\n--------\n\nCREATE TABLE ft_myisam(copy TEXT,FULLTEXT(copy)) ENGINE=MyISAM;\n\nINSERT INTO ft_myisam(copy) VALUES (\'Once upon a time\'), (\'There was a wicked\nwitch\'), \n (\'Who ate everybody up\');\n\nSELECT * FROM ft_myisam WHERE MATCH(copy) AGAINST(\'wicked\');\n+--------------------------+\n| copy |\n+--------------------------+\n| There was a wicked witch |\n+--------------------------+\n\nSELECT id, body, MATCH (title,body) AGAINST\n (\'Security implications of running MySQL as root\'\n IN NATURAL LANGUAGE MODE) AS score\n FROM articles WHERE MATCH (title,body) AGAINST\n (\'Security implications of running MySQL as root\'\n IN NATURAL LANGUAGE MODE);\n+----+-------------------------------------+-----------------+\n| id | body | score |\n+----+-------------------------------------+-----------------+\n| 4 | 1. Never run mysqld as root. 2. ... | 1.5219271183014 |\n| 6 | When configured properly, MySQL ... | 1.3114095926285 |\n+----+-------------------------------------+-----------------+\n\n\n\nURL: mariadb.com/kb/en/match-against/','','https://mariadb.com/kb/en/match-against/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (611,37,'MID','Syntax\n------\n\nMID(str,pos,len)\n\nDescription\n-----------\n\nMID(str,pos,len) is a synonym for SUBSTRING(str,pos,len).\n\nExamples\n--------\n\nSELECT MID(\'abcd\',4,1);\n+-----------------+\n| MID(\'abcd\',4,1) |\n+-----------------+\n| d |\n+-----------------+\n\nSELECT MID(\'abcd\',2,2);\n+-----------------+\n| MID(\'abcd\',2,2) |\n+-----------------+\n| bc |\n+-----------------+\n\nA negative starting position:\n\nSELECT MID(\'abcd\',-2,4);\n+------------------+\n| MID(\'abcd\',-2,4) |\n+------------------+\n| cd |\n+------------------+\n\n\n\nURL: mariadb.com/kb/en/mid/','','https://mariadb.com/kb/en/mid/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (612,37,'NOT LIKE','Syntax\n------\n\nexpr NOT LIKE pat [ESCAPE \'escape_char\']\n\nDescription\n-----------\n\nThis is the same as NOT (expr LIKE pat [ESCAPE \'escape_char\']).\n\n\n\nURL: mariadb.com/kb/en/not-like/','','https://mariadb.com/kb/en/not-like/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (613,37,'NOT REGEXP','Syntax\n------\n\nexpr NOT REGEXP pat, expr NOT RLIKE pat\n\nDescription\n-----------\n\nThis is the same as NOT (expr REGEXP pat).\n\n\n\nURL: mariadb.com/kb/en/not-regexp/','','https://mariadb.com/kb/en/not-regexp/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (614,37,'OCTET_LENGTH','Syntax\n------\n\nOCTET_LENGTH(str)\n\nDescription\n-----------\n\nOCTET_LENGTH() returns the length of the given string, in octets (bytes). This\nis a synonym for LENGTHB(), and, when Oracle mode from MariaDB 10.3 is not\nset, a synonym for LENGTH().\n\nA multi-byte character counts as multiple bytes. This means that for a string\ncontaining five two-byte characters, OCTET_LENGTH() returns 10, whereas\nCHAR_LENGTH() returns 5.\n\nIf str is not a string value, it is converted into a string. If str is NULL,\nthe function returns NULL.\n\nExamples\n--------\n\nWhen Oracle mode from MariaDB 10.3 is not set:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\') | LENGTH(\'π\') | LENGTHB(\'π\') | OCTET_LENGTH(\'π\') |\n+-------------------+--------------+---------------+--------------------+\n| 1 | 2 | 2 | 2 |\n+-------------------+--------------+---------------+--------------------+\n\nIn Oracle mode from MariaDB 10.3:\n\nSELECT CHAR_LENGTH(\'π\'), LENGTH(\'π\'), LENGTHB(\'π\'), OCTET_LENGTH(\'π\');\n+-------------------+--------------+---------------+--------------------+\n| CHAR_LENGTH(\'π\') | LENGTH(\'π\') | LENGTHB(\'π\') | OCTET_LENGTH(\'π\') |\n+-------------------+--------------+---------------+--------------------+\n| 1 | 1 | 2 | 2 |\n+-------------------+--------------+---------------+--------------------+\n\n\n\nURL: mariadb.com/kb/en/octet_length/','','https://mariadb.com/kb/en/octet_length/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (615,37,'ORD','Syntax\n------\n\nORD(str)\n\nDescription\n-----------\n\nIf the leftmost character of the string str is a multi-byte character, returns\nthe code for that character, calculated from the numeric values of its\nconstituent bytes using this formula:\n\n(1st byte code)\n+ (2nd byte code x 256)\n+ (3rd byte code x 256 x 256) ...\n\nIf the leftmost character is not a multi-byte character, ORD() returns the\nsame value as the ASCII() function.\n\nExamples\n--------\n\nSELECT ORD(\'2\');\n+----------+\n| ORD(\'2\') |\n+----------+\n| 50 |\n+----------+\n\n\n\nURL: mariadb.com/kb/en/ord/','','https://mariadb.com/kb/en/ord/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (616,37,'POSITION','Syntax\n------\n\nPOSITION(substr IN str)\n\nDescription\n-----------\n\nPOSITION(substr IN str) is a synonym for LOCATE(substr,str).\n\nIt\'s part of ODBC 3.0.\n\n\n\nURL: mariadb.com/kb/en/position/','','https://mariadb.com/kb/en/position/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (617,37,'QUOTE','Syntax\n------\n\nQUOTE(str)\n\nDescription\n-----------\n\nQuotes a string to produce a result that can be used as a properly escaped\ndata value in an SQL statement. The string is returned enclosed by single\nquotes and with each instance of single quote ("\'"), backslash ("\"), ASCII\nNUL, and Control-Z preceded by a backslash. If the argument is NULL, the\nreturn value is the word "NULL" without enclosing single quotes.\n\nExamples\n--------\n\nSELECT QUOTE("Don\'t!");\n+-----------------+\n| QUOTE("Don\'t!") |\n+-----------------+\n| \'Don\'t!\' |\n+-----------------+\n\nSELECT QUOTE(NULL); \n+-------------+\n| QUOTE(NULL) |\n+-------------+\n| NULL |\n+-------------+\n\n\n\nURL: mariadb.com/kb/en/quote/','','https://mariadb.com/kb/en/quote/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (618,37,'REGEXP_INSTR','Syntax\n------\n\nREGEXP_INSTR(subject, pattern)\n\nReturns the position of the first occurrence of the regular expression pattern\nin the string subject, or 0 if pattern was not found.\n\nThe positions start with 1 and are measured in characters (i.e. not in bytes),\nwhich is important for multi-byte character sets. You can cast a multi-byte\ncharacter set to BINARY to get offsets in bytes.\n\nThe function follows the case sensitivity rules of the effective collation.\nMatching is performed case insensitively for case insensitive collations, and\ncase sensitively for case sensitive collations and for binary data.\n\nThe collation case sensitivity can be overwritten using the (?i) and (?-i)\nPCRE flags.\n\nMariaDB uses the PCRE regular expression library for enhanced regular\nexpression performance, and REGEXP_INSTR was introduced as part of this\nenhancement.\n\nExamples\n--------\n\nSELECT REGEXP_INSTR(\'abc\',\'b\');\n-> 2\n\nSELECT REGEXP_INSTR(\'abc\',\'x\');\n-> 0\n\nSELECT REGEXP_INSTR(\'BJÖRN\',\'N\');\n-> 5\n\nCasting a multi-byte character set as BINARY to get offsets in bytes:\n\nSELECT REGEXP_INSTR(BINARY \'BJÖRN\',\'N\') AS cast_utf8_to_binary;\n-> 6\n\nCase sensitivity:\n\nSELECT REGEXP_INSTR(\'ABC\',\'b\');\n-> 2\n\nSELECT REGEXP_INSTR(\'ABC\' COLLATE utf8_bin,\'b\');\n-> 0\n\nSELECT REGEXP_INSTR(BINARY\'ABC\',\'b\');\n-> 0\n\nSELECT REGEXP_INSTR(\'ABC\',\'(?-i)b\');\n-> 0\n\nSELECT REGEXP_INSTR(\'ABC\' COLLATE utf8_bin,\'(?i)b\');\n-> 2\n\n\n\nURL: mariadb.com/kb/en/regexp_instr/','','https://mariadb.com/kb/en/regexp_instr/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (619,37,'REGEXP_REPLACE','Syntax\n------\n\nREGEXP_REPLACE(subject, pattern, replace)\n\nDescription\n-----------\n\nREGEXP_REPLACE returns the string subject with all occurrences of the regular\nexpression pattern replaced by the string replace. If no occurrences are\nfound, then subject is returned as is.\n\nThe replace string can have backreferences to the subexpressions in the form\n\N, where N is a number from 1 to 9.\n\nThe function follows the case sensitivity rules of the effective collation.\nMatching is performed case insensitively for case insensitive collations, and\ncase sensitively for case sensitive collations and for binary data.\n\nThe collation case sensitivity can be overwritten using the (?i) and (?-i)\nPCRE flags.\n\nMariaDB uses the PCRE regular expression library for enhanced regular\nexpression performance, and REGEXP_REPLACE was introduced as part of this\nenhancement.\n\nThe default_regex_flags variable addresses the remaining compatibilities\nbetween PCRE and the old regex library.\n\nExamples\n--------\n\nSELECT REGEXP_REPLACE(\'ab12cd\',\'[0-9]\',\'\') AS remove_digits;\n-> abcd\n\nSELECT\nREGEXP_REPLACE(\'<html><head><title>title</title><body>body</body></htm>\',\n\'<.+?>\',\' \')\nAS strip_html;\n-> title body\n\nBackreferences to the subexpressions in the form \N, where N is a number from\n1 to 9:\n\nSELECT REGEXP_REPLACE(\'James Bond\',\'^(.*) (.*)$\',\'\\\\2, \\\\1\') AS reorder_name;\n-> Bond, James\n\nCase insensitive and case sensitive matches:\n\nSELECT REGEXP_REPLACE(\'ABC\',\'b\',\'-\') AS case_insensitive;\n-> A-C\n\nSELECT REGEXP_REPLACE(\'ABC\' COLLATE utf8_bin,\'b\',\'-\') AS case_sensitive;\n-> ABC\n\nSELECT REGEXP_REPLACE(BINARY \'ABC\',\'b\',\'-\') AS binary_data;\n-> ABC\n\nOverwriting the collation case sensitivity using the (?i) and (?-i) PCRE flags.\n\nSELECT REGEXP_REPLACE(\'ABC\',\'(?-i)b\',\'-\') AS force_case_sensitive;\n-> ABC\n\nSELECT REGEXP_REPLACE(BINARY \'ABC\',\'(?i)b\',\'-\') AS force_case_insensitive;\n-> A-C\n\n\n\nURL: mariadb.com/kb/en/regexp_replace/','','https://mariadb.com/kb/en/regexp_replace/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (620,37,'REGEXP_SUBSTR','Syntax\n------\n\nREGEXP_SUBSTR(subject,pattern)\n\nDescription\n-----------\n\nReturns the part of the string subject that matches the regular expression\npattern, or an empty string if pattern was not found.\n\nThe function follows the case sensitivity rules of the effective collation.\nMatching is performed case insensitively for case insensitive collations, and\ncase sensitively for case sensitive collations and for binary data.\n\nThe collation case sensitivity can be overwritten using the (?i) and (?-i)\nPCRE flags.\n\nMariaDB uses the PCRE regular expression library for enhanced regular\nexpression performance, and REGEXP_SUBSTR was introduced as part of this\nenhancement.\n\nThe default_regex_flags variable addresses the remaining compatibilities\nbetween PCRE and the old regex library.\n\nExamples\n--------\n\nSELECT REGEXP_SUBSTR(\'ab12cd\',\'[0-9]+\');\n-> 12\n\nSELECT REGEXP_SUBSTR(\n \'See https://mariadb.org/en/foundation/ for details\',\n \'https?://[^/]*\');\n-> https://mariadb.org\n\nSELECT REGEXP_SUBSTR(\'ABC\',\'b\');\n-> B\n\nSELECT REGEXP_SUBSTR(\'ABC\' COLLATE utf8_bin,\'b\');\n->\n\nSELECT REGEXP_SUBSTR(BINARY\'ABC\',\'b\');\n->\n\nSELECT REGEXP_SUBSTR(\'ABC\',\'(?i)b\');\n-> B\n\nSELECT REGEXP_SUBSTR(\'ABC\' COLLATE utf8_bin,\'(?+i)b\');\n-> B\n\n\n\nURL: mariadb.com/kb/en/regexp_substr/','','https://mariadb.com/kb/en/regexp_substr/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (621,37,'REPEAT Function','Syntax\n------\n\nREPEAT(str,count)\n\nDescription\n-----------\n\nReturns a string consisting of the string str repeated count times. If count\nis less than 1, returns an empty string. Returns NULL if str or count are NULL.\n\nExamples\n--------\n\nSELECT QUOTE(REPEAT(\'MariaDB \',4));\n+------------------------------------+\n| QUOTE(REPEAT(\'MariaDB \',4)) |\n+------------------------------------+\n| \'MariaDB MariaDB MariaDB MariaDB \' |\n+------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/repeat-function/','','https://mariadb.com/kb/en/repeat-function/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (622,37,'REPLACE Function','Syntax\n------\n\nREPLACE(str,from_str,to_str)\n\nDescription\n-----------\n\nReturns the string str with all occurrences of the string from_str replaced by\nthe string to_str. REPLACE() performs a case-sensitive match when searching\nfor from_str.\n\nExamples\n--------\n\nSELECT REPLACE(\'www.mariadb.org\', \'w\', \'Ww\');\n+---------------------------------------+\n| REPLACE(\'www.mariadb.org\', \'w\', \'Ww\') |\n+---------------------------------------+\n| WwWwWw.mariadb.org |\n+---------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/replace-function/','','https://mariadb.com/kb/en/replace-function/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (623,37,'REVERSE','Syntax\n------\n\nREVERSE(str)\n\nDescription\n-----------\n\nReturns the string str with the order of the characters reversed.\n\nExamples\n--------\n\nSELECT REVERSE(\'desserts\');\n+---------------------+\n| REVERSE(\'desserts\') |\n+---------------------+\n| stressed |\n+---------------------+\n\n\n\nURL: mariadb.com/kb/en/reverse/','','https://mariadb.com/kb/en/reverse/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (624,37,'RIGHT','Syntax\n------\n\nRIGHT(str,len)\n\nDescription\n-----------\n\nReturns the rightmost len characters from the string str, or NULL if any\nargument is NULL.\n\nExamples\n--------\n\nSELECT RIGHT(\'MariaDB\', 2);\n+---------------------+\n| RIGHT(\'MariaDB\', 2) |\n+---------------------+\n| DB |\n+---------------------+\n\n\n\nURL: mariadb.com/kb/en/right/','','https://mariadb.com/kb/en/right/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (625,37,'RPAD','Syntax\n------\n\nRPAD(str, len [, padstr])\n\nDescription\n-----------\n\nReturns the string str, right-padded with the string padstr to a length of len\ncharacters. If str is longer than len, the return value is shortened to len\ncharacters. If padstr is omitted, the RPAD function pads spaces.\n\nPrior to MariaDB 10.3.1, the padstr parameter was mandatory.\n\nReturns NULL if given a NULL argument. If the result is empty (a length of\nzero), returns either an empty string, or, from MariaDB 10.3.6 with\nSQL_MODE=Oracle, NULL.\n\nThe Oracle mode version of the function can be accessed outside of Oracle mode\nby using RPAD_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT RPAD(\'hello\',10,\'.\');\n+----------------------+\n| RPAD(\'hello\',10,\'.\') |\n+----------------------+\n| hello..... |\n+----------------------+\n\nSELECT RPAD(\'hello\',2,\'.\');\n+---------------------+\n| RPAD(\'hello\',2,\'.\') |\n+---------------------+\n| he |\n+---------------------+\n\nFrom MariaDB 10.3.1, with the pad string defaulting to space.\n\nSELECT RPAD(\'hello\',30);\n+--------------------------------+\n| RPAD(\'hello\',30) |\n+--------------------------------+\n| hello |\n+--------------------------------+\n\nOracle mode version from MariaDB 10.3.6:\n\nSELECT RPAD(\'\',0),RPAD_ORACLE(\'\',0);\n+------------+-------------------+\n| RPAD(\'\',0) | RPAD_ORACLE(\'\',0) |\n+------------+-------------------+\n| | NULL |\n+------------+-------------------+\n\n\n\nURL: mariadb.com/kb/en/rpad/','','https://mariadb.com/kb/en/rpad/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (626,37,'RTRIM','Syntax\n------\n\nRTRIM(str)\n\nDescription\n-----------\n\nReturns the string str with trailing space characters removed.\n\nReturns NULL if given a NULL argument. If the result is empty, returns either\nan empty string, or, from MariaDB 10.3.6 with SQL_MODE=Oracle, NULL.\n\nThe Oracle mode version of the function can be accessed outside of Oracle mode\nby using RTRIM_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT QUOTE(RTRIM(\'MariaDB \'));\n+-----------------------------+\n| QUOTE(RTRIM(\'MariaDB \')) |\n+-----------------------------+\n| \'MariaDB\' |\n+-----------------------------+\n\nOracle mode version from MariaDB 10.3.6:\n\nSELECT RTRIM(\'\'),RTRIM_ORACLE(\'\');\n+-----------+------------------+\n| RTRIM(\'\') | RTRIM_ORACLE(\'\') |\n+-----------+------------------+\n| | NULL |\n+-----------+------------------+\n\n\n\nURL: mariadb.com/kb/en/rtrim/','','https://mariadb.com/kb/en/rtrim/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (627,37,'SOUNDEX','Syntax\n------\n\nSOUNDEX(str)\n\nDescription\n-----------\n\nReturns a soundex string from str. Two strings that sound almost the same\nshould have identical soundex strings. A standard soundex string is four\ncharacters long, but the SOUNDEX() function returns an arbitrarily long\nstring. You can use SUBSTRING() on the result to get a standard soundex\nstring. All non-alphabetic characters in str are ignored. All international\nalphabetic characters outside the A-Z range are treated as vowels.\n\nImportant: When using SOUNDEX(), you should be aware of the following details:\n\n* This function, as currently implemented, is intended to work well with\n strings that are in the English language only. Strings in other languages may\n not produce reasonable results.\n\n* This function implements the original Soundex algorithm, not the more\npopular enhanced version (also described by D. Knuth). The difference is that\noriginal version discards vowels first and duplicates second, whereas the\nenhanced version discards duplicates first and vowels second.\n\nExamples\n--------\n\nSOUNDEX(\'Hello\');\n+------------------+\n| SOUNDEX(\'Hello\') |\n+------------------+\n| H400 |\n+------------------+\n\nSELECT SOUNDEX(\'MariaDB\');\n+--------------------+\n| SOUNDEX(\'MariaDB\') |\n+--------------------+\n| M631 |\n+--------------------+\n\nSELECT SOUNDEX(\'Knowledgebase\');\n+--------------------------+\n| SOUNDEX(\'Knowledgebase\') |\n+--------------------------+\n| K543212 |\n+--------------------------+\n\nSELECT givenname, surname FROM users WHERE SOUNDEX(givenname) =\nSOUNDEX("robert");\n+-----------+---------+\n| givenname | surname |\n+-----------+---------+\n| Roberto | Castro |\n+-----------+---------+\n\n\n\nURL: mariadb.com/kb/en/soundex/','','https://mariadb.com/kb/en/soundex/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (628,37,'SOUNDS LIKE','Syntax\n------\n\nexpr1 SOUNDS LIKE expr2\n\nDescription\n-----------\n\nThis is the same as SOUNDEX(expr1) = SOUNDEX(expr2).\n\nExample\n-------\n\nSELECT givenname, surname FROM users WHERE givenname SOUNDS LIKE "robert";\n+-----------+---------+\n| givenname | surname |\n+-----------+---------+\n| Roberto | Castro |\n+-----------+---------+\n\n\n\nURL: mariadb.com/kb/en/sounds-like/','','https://mariadb.com/kb/en/sounds-like/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (629,37,'SPACE','Syntax\n------\n\nSPACE(N)\n\nDescription\n-----------\n\nReturns a string consisting of N space characters. If N is NULL, returns NULL.\n\nExamples\n--------\n\nSELECT QUOTE(SPACE(6));\n+-----------------+\n| QUOTE(SPACE(6)) |\n+-----------------+\n| \' \' |\n+-----------------+\n\n\n\nURL: mariadb.com/kb/en/space/','','https://mariadb.com/kb/en/space/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (630,37,'STRCMP','Syntax\n------\n\nSTRCMP(expr1,expr2)\n\nDescription\n-----------\n\nSTRCMP() returns 0 if the strings are the same, -1 if the first argument is\nsmaller than the second according to the current sort order, and 1 if the\nstrings are otherwise not the same. Returns NULL is either argument is NULL.\n\nExamples\n--------\n\nSELECT STRCMP(\'text\', \'text2\');\n+-------------------------+\n| STRCMP(\'text\', \'text2\') |\n+-------------------------+\n| -1 |\n+-------------------------+\n\nSELECT STRCMP(\'text2\', \'text\');\n+-------------------------+\n| STRCMP(\'text2\', \'text\') |\n+-------------------------+\n| 1 |\n+-------------------------+\n\nSELECT STRCMP(\'text\', \'text\');\n+------------------------+\n| STRCMP(\'text\', \'text\') |\n+------------------------+\n| 0 |\n+------------------------+\n\n\n\nURL: mariadb.com/kb/en/strcmp/','','https://mariadb.com/kb/en/strcmp/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (631,37,'SUBSTR','Description\n-----------\n\nSUBSTR() is a synonym for SUBSTRING().\n\n\n\nURL: mariadb.com/kb/en/substr/','','https://mariadb.com/kb/en/substr/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (632,37,'SUBSTRING','Syntax\n------\n\nSUBSTRING(str,pos), \nSUBSTRING(str FROM pos), \nSUBSTRING(str,pos,len),\nSUBSTRING(str FROM pos FOR len)\n\nSUBSTR(str,pos), \nSUBSTR(str FROM pos), \nSUBSTR(str,pos,len),\nSUBSTR(str FROM pos FOR len)\n\nDescription\n-----------\n\nThe forms without a len argument return a substring from string str starting\nat position pos.\n\nThe forms with a len argument return a substring len characters long from\nstring str, starting at position pos.\n\nThe forms that use FROM are standard SQL syntax.\n\nIt is also possible to use a negative value for pos. In this case, the\nbeginning of the substring is pos characters from the end of the string,\nrather than the beginning. A negative value may be used for pos in any of the\nforms of this function.\n\nBy default, the position of the first character in the string from which the\nsubstring is to be extracted is reckoned as 1. For Oracle-compatibility, from\nMariaDB 10.3.3, when sql_mode is set to \'oracle\', position zero is treated as\nposition 1 (although the first character is still reckoned as 1).\n\nIf any argument is NULL, returns NULL.\n\nExamples\n--------\n\nSELECT SUBSTRING(\'Knowledgebase\',5);\n+------------------------------+\n| SUBSTRING(\'Knowledgebase\',5) |\n+------------------------------+\n| ledgebase |\n+------------------------------+\n\nSELECT SUBSTRING(\'MariaDB\' FROM 6);\n+-----------------------------+\n| SUBSTRING(\'MariaDB\' FROM 6) |\n+-----------------------------+\n| DB |\n+-----------------------------+\n\nSELECT SUBSTRING(\'Knowledgebase\',3,7);\n+--------------------------------+\n| SUBSTRING(\'Knowledgebase\',3,7) |\n+--------------------------------+\n| owledge |\n+--------------------------------+\n\nSELECT SUBSTRING(\'Knowledgebase\', -4);\n+--------------------------------+\n| SUBSTRING(\'Knowledgebase\', -4) |\n+--------------------------------+\n| base |\n+--------------------------------+\n\nSELECT SUBSTRING(\'Knowledgebase\', -8, 4);\n+-----------------------------------+\n| SUBSTRING(\'Knowledgebase\', -8, 4) |\n+-----------------------------------+\n| edge |\n+-----------------------------------+\n\nSELECT SUBSTRING(\'Knowledgebase\' FROM -8 FOR 4);\n+------------------------------------------+\n| SUBSTRING(\'Knowledgebase\' FROM -8 FOR 4) |\n+------------------------------------------+\n| edge |\n+------------------------------------------+\n\nOracle mode from MariaDB 10.3.3:\n\nSELECT SUBSTR(\'abc\',0,3);\n+-------------------+\n| SUBSTR(\'abc\',0,3) |\n+-------------------+\n| |\n+-------------------+\n\nSELECT SUBSTR(\'abc\',1,2);\n+-------------------+\n| SUBSTR(\'abc\',1,2) |\n+-------------------+\n| ab |\n+-------------------+\n\nSET sql_mode=\'oracle\';\n\nSELECT SUBSTR(\'abc\',0,3);\n+-------------------+\n| SUBSTR(\'abc\',0,3) |\n+-------------------+\n| abc |\n+-------------------+\n\nSELECT SUBSTR(\'abc\',1,2);\n+-------------------+\n| SUBSTR(\'abc\',1,2) |\n+-------------------+\n| ab |\n+-------------------+\n\n\n\nURL: mariadb.com/kb/en/substring/','','https://mariadb.com/kb/en/substring/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (633,37,'SUBSTRING_INDEX','Syntax\n------\n\nSUBSTRING_INDEX(str,delim,count)\n\nDescription\n-----------\n\nReturns the substring from string str before count occurrences of the\ndelimiter delim. If count is positive, everything to the left of the final\ndelimiter (counting from the left) is returned. If count is negative,\neverything to the right of the final delimiter (counting from the right) is\nreturned. SUBSTRING_INDEX() performs a case-sensitive match when searching for\ndelim.\n\nIf any argument is NULL, returns NULL.\n\nFor example\n\nSUBSTRING_INDEX(\'www.mariadb.org\', \'.\', 2)\n\nmeans "Return all of the characters up to the 2nd occurrence of ."\n\nExamples\n--------\n\nSELECT SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', 2);\n+--------------------------------------------+\n| SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', 2) |\n+--------------------------------------------+\n| www.mariadb |\n+--------------------------------------------+\n\nSELECT SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', -2);\n+---------------------------------------------+\n| SUBSTRING_INDEX(\'www.mariadb.org\', \'.\', -2) |\n+---------------------------------------------+\n| mariadb.org |\n+---------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/substring_index/','','https://mariadb.com/kb/en/substring_index/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (634,37,'TO_BASE64','Syntax\n------\n\nTO_BASE64(str)\n\nDescription\n-----------\n\nConverts the string argument str to its base-64 encoded form, returning the\nresult as a character string in the connection character set and collation.\n\nThe argument str will be converted to string first if it is not a string. A\nNULL argument will return a NULL result.\n\nThe reverse function, FROM_BASE64(), decodes an encoded base-64 string.\n\nThere are a numerous different methods to base-64 encode a string. The\nfollowing are used by MariaDB and MySQL:\n\n* Alphabet value 64 is encoded as \'+\'.\n* Alphabet value 63 is encoded as \'/\'.\n* Encoding output is made up of groups of four printable characters, with each\nthree bytes of data encoded using four characters. If the final group is not\ncomplete, it is padded with \'=\' characters to make up a length of four.\n* To divide long output, a newline is added after every 76 characters.\n* Decoding will recognize and ignore newlines, carriage returns, tabs, and\nspaces.\n\nExamples\n--------\n\nSELECT TO_BASE64(\'Maria\');\n+--------------------+\n| TO_BASE64(\'Maria\') |\n+--------------------+\n| TWFyaWE= |\n+--------------------+\n\n\n\nURL: mariadb.com/kb/en/to_base64/','','https://mariadb.com/kb/en/to_base64/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (635,37,'TRIM','Syntax\n------\n\nTRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr FROM] str)\n\nFrom MariaDB 10.3.6\n\nTRIM_ORACLE([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr\nFROM] str)\n\nDescription\n-----------\n\nReturns the string str with all remstr prefixes or suffixes removed. If none\nof the specifiers BOTH, LEADING, or TRAILING is given, BOTH is assumed. remstr\nis optional and, if not specified, spaces are removed.\n\nReturns NULL if given a NULL argument. If the result is empty, returns either\nan empty string, or, from MariaDB 10.3.6 with SQL_MODE=Oracle, NULL.\nSQL_MODE=Oracle is not set by default.\n\nThe Oracle mode version of the function can be accessed in any mode by using\nTRIM_ORACLE as the function name.\n\nExamples\n--------\n\nSELECT TRIM(\' bar \')\G\n*************************** 1. row ***************************\nTRIM(\' bar \'): bar\n\nSELECT TRIM(LEADING \'x\' FROM \'xxxbarxxx\')\G\n*************************** 1. row ***************************\nTRIM(LEADING \'x\' FROM \'xxxbarxxx\'): barxxx\n\nSELECT TRIM(BOTH \'x\' FROM \'xxxbarxxx\')\G\n*************************** 1. row ***************************\nTRIM(BOTH \'x\' FROM \'xxxbarxxx\'): bar\n\nSELECT TRIM(TRAILING \'xyz\' FROM \'barxxyz\')\G\n*************************** 1. row ***************************\nTRIM(TRAILING \'xyz\' FROM \'barxxyz\'): barx\n\nFrom MariaDB 10.3.6, with SQL_MODE=Oracle not set:\n\nSELECT TRIM(\'\'),TRIM_ORACLE(\'\');\n+----------+-----------------+\n| TRIM(\'\') | TRIM_ORACLE(\'\') |\n+----------+-----------------+\n| | NULL |\n+----------+-----------------+\n\nFrom MariaDB 10.3.6, with SQL_MODE=Oracle set:\n\nSELECT TRIM(\'\'),TRIM_ORACLE(\'\');\n+----------+-----------------+\n| TRIM(\'\') | TRIM_ORACLE(\'\') |\n+----------+-----------------+\n| NULL | NULL |\n+----------+-----------------+\n\n\n\nURL: mariadb.com/kb/en/trim/','','https://mariadb.com/kb/en/trim/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (636,37,'UCASE','Syntax\n------\n\nUCASE(str)\n\nDescription\n-----------\n\nUCASE() is a synonym for UPPER().\n\n\n\nURL: mariadb.com/kb/en/ucase/','','https://mariadb.com/kb/en/ucase/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (637,37,'UNHEX','Syntax\n------\n\nUNHEX(str)\n\nDescription\n-----------\n\nPerforms the inverse operation of HEX(str). That is, it interprets each pair\nof hexadecimal digits in the argument as a number and converts it to the\ncharacter represented by the number. The resulting characters are returned as\na binary string.\n\nIf str is NULL, UNHEX() returns NULL.\n\nExamples\n--------\n\nSELECT HEX(\'MariaDB\');\n+----------------+\n| HEX(\'MariaDB\') |\n+----------------+\n| 4D617269614442 |\n+----------------+\n\nSELECT UNHEX(\'4D617269614442\');\n+-------------------------+\n| UNHEX(\'4D617269614442\') |\n+-------------------------+\n| MariaDB |\n+-------------------------+\n\nSELECT 0x4D617269614442;\n+------------------+\n| 0x4D617269614442 |\n+------------------+\n| MariaDB |\n+------------------+\n\nSELECT UNHEX(HEX(\'string\'));\n+----------------------+\n| UNHEX(HEX(\'string\')) |\n+----------------------+\n| string |\n+----------------------+\n\nSELECT HEX(UNHEX(\'1267\'));\n+--------------------+\n| HEX(UNHEX(\'1267\')) |\n+--------------------+\n| 1267 |\n+--------------------+\n\n\n\nURL: mariadb.com/kb/en/unhex/','','https://mariadb.com/kb/en/unhex/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (638,37,'UPDATEXML','Syntax\n------\n\nUpdateXML(xml_target, xpath_expr, new_xml)\n\nDescription\n-----------\n\nThis function replaces a single portion of a given fragment of XML markup\nxml_target with a new XML fragment new_xml, and then returns the changed XML.\nThe portion of xml_target that is replaced matches an XPath expression\nxpath_expr supplied by the user. If no expression matching xpath_expr is\nfound, or if multiple matches are found, the function returns the original\nxml_target XML fragment. All three arguments should be strings.\n\nExamples\n--------\n\nSELECT\n UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/a\', \'<e>fff</e>\') AS val1,\n UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/b\', \'<e>fff</e>\') AS val2,\n UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'//b\', \'<e>fff</e>\') AS val3,\n UpdateXML(\'<a><b>ccc</b><d></d></a>\', \'/a/d\', \'<e>fff</e>\') AS val4,\n UpdateXML(\'<a><d></d><b>ccc</b><d></d></a>\', \'/a/d\', \'<e>fff</e>\') AS val5\n \G\n*************************** 1. row ***************************\nval1: <e>fff</e>\nval2: <a><b>ccc</b><d></d></a>\nval3: <a><e>fff</e><d></d></a>\nval4: <a><b>ccc</b><e>fff</e></a>\nval5: <a><d></d><b>ccc</b><d></d></a>\n1 row in set (0.00 sec)\n\n\n\nURL: mariadb.com/kb/en/updatexml/','','https://mariadb.com/kb/en/updatexml/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (639,37,'UPPER','Syntax\n------\n\nUPPER(str)\n\nDescription\n-----------\n\nReturns the string str with all characters changed to uppercase according to\nthe current character set mapping. The default is latin1 (cp1252 West\nEuropean).\n\nSELECT UPPER(surname), givenname FROM users ORDER BY surname;\n+----------------+------------+\n| UPPER(surname) | givenname |\n+----------------+------------+\n| ABEL | Jacinto |\n| CASTRO | Robert |\n| COSTA | Phestos |\n| MOSCHELLA | Hippolytos |\n+----------------+------------+\n\nUPPER() is ineffective when applied to binary strings (BINARY, VARBINARY,\nBLOB). The description of LOWER() shows how to perform lettercase conversion\nof binary strings.\n\n\n\nURL: mariadb.com/kb/en/upper/','','https://mariadb.com/kb/en/upper/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (640,37,'WEIGHT_STRING','Syntax\n------\n\nWEIGHT_STRING(str [AS {CHAR|BINARY}(N)] [LEVEL levels] [flags])\n levels: N [ASC|DESC|REVERSE] [, N [ASC|DESC|REVERSE]] ...\n\nDescription\n-----------\n\nReturns a binary string representing the string\'s sorting and comparison\nvalue. A string with a lower result means that for sorting purposes the string\nappears before a string with a higher result.\n\nWEIGHT_STRING() is particularly useful when adding new collations, for testing\npurposes.\n\nIf str is a non-binary string (CHAR, VARCHAR or TEXT), WEIGHT_STRING returns\nthe string\'s collation weight. If str is a binary string (BINARY, VARBINARY or\nBLOB), the return value is simply the input value, since the weight for each\nbyte in a binary string is the byte value.\n\nWEIGHT_STRING() returns NULL if given a NULL input.\n\nThe optional AS clause permits casting the input string to a binary or\nnon-binary string, as well as to a particular length.\n\nAS BINARY(N) measures the length in bytes rather than characters, and right\npads with 0x00 bytes to the desired length.\n\nAS CHAR(N) measures the length in characters, and right pads with spaces to\nthe desired length.\n\nN has a minimum value of 1, and if it is less than the length of the input\nstring, the string is truncated without warning.\n\nThe optional LEVEL clause specifies that the return value should contain\nweights for specific collation levels. The levels specifier can either be a\nsingle integer, a comma-separated list of integers, or a range of integers\nseparated by a dash (whitespace is ignored). Integers can range from 1 to a\nmaximum of 6, dependent on the collation, and need to be listed in ascending\norder.\n\nIf the LEVEL clause is no provided, a default of 1 to the maximum for the\ncollation is assumed.\n\nIf the LEVEL is specified without using a range, an optional modifier is\npermitted.\n\nASC, the default, returns the weights without any modification.\n\nDESC returns bitwise-inverted weights.\n\nREVERSE returns the weights in reverse order.\n\nExamples\n--------\n\nThe examples below use the HEX() function to represent non-printable results\nin hexadecimal format.\n\nSELECT HEX(WEIGHT_STRING(\'x\'));\n+-------------------------+\n| HEX(WEIGHT_STRING(\'x\')) |\n+-------------------------+\n| 0058 |\n+-------------------------+\n\nSELECT HEX(WEIGHT_STRING(\'x\' AS BINARY(4)));\n+--------------------------------------+\n| HEX(WEIGHT_STRING(\'x\' AS BINARY(4))) |\n+--------------------------------------+\n| 78000000 |\n+--------------------------------------+\n\nSELECT HEX(WEIGHT_STRING(\'x\' AS CHAR(4)));\n+------------------------------------+\n| HEX(WEIGHT_STRING(\'x\' AS CHAR(4))) |\n+------------------------------------+\n| 0058002000200020 |\n+------------------------------------+\n\nSELECT HEX(WEIGHT_STRING(0xaa22ee LEVEL 1));\n+--------------------------------------+\n| HEX(WEIGHT_STRING(0xaa22ee LEVEL 1)) |\n+--------------------------------------+\n| AA22EE |\n+--------------------------------------+\n\nSELECT HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 DESC));\n+-------------------------------------------+\n| HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 DESC)) |\n+-------------------------------------------+\n| 55DD11 |\n+-------------------------------------------+\n\nSELECT HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 REVERSE));\n+----------------------------------------------+\n| HEX(WEIGHT_STRING(0xaa22ee LEVEL 1 REVERSE)) |\n+----------------------------------------------+\n| EE22AA |\n+----------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/weight_string/','','https://mariadb.com/kb/en/weight_string/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (641,39,'ALTER DATABASE','Modifies a database, changing its overall characteristics.\n\nSyntax\n------\n\nALTER {DATABASE | SCHEMA} [db_name]\n alter_specification ...\nALTER {DATABASE | SCHEMA} db_name\n UPGRADE DATA DIRECTORY NAME\n\nalter_specification:\n [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'comment\'\n\nDescription\n-----------\n\nALTER DATABASE enables you to change the overall characteristics of a\ndatabase. These characteristics are stored in the db.opt file in the database\ndirectory. To use ALTER DATABASE, you need the ALTER privilege on the\ndatabase. ALTER SCHEMA is a synonym for ALTER DATABASE.\n\nThe CHARACTER SET clause changes the default database character set. The\nCOLLATE clause changes the default database collation. See Character Sets and\nCollations for more.\n\nYou can see what character sets and collations are available using,\nrespectively, the SHOW CHARACTER SET and SHOW COLLATION statements.\n\nChanging the default character set/collation of a database does not change the\ncharacter set/collation of any stored procedures or stored functions that were\npreviously created, and relied on the defaults. These need to be dropped and\nrecreated in order to apply the character set/collation changes.\n\nThe database name can be omitted from the first syntax, in which case the\nstatement applies to the default database.\n\nThe syntax that includes the UPGRADE DATA DIRECTORY NAME clause was added in\nMySQL 5.1.23. It updates the name of the directory associated with the\ndatabase to use the encoding implemented in MySQL 5.1 for mapping database\nnames to database directory names (see Identifier to File Name Mapping). This\nclause is for use under these conditions:\n\n* It is intended when upgrading MySQL to 5.1 or later from older versions.\n* It is intended to update a database directory name to the current encoding\nformat if the name contains special characters that need encoding.\n* The statement is used by mysqlcheck (as invoked by mysql_upgrade).\n\nFor example,if a database in MySQL 5.0 has a name of a-b-c, the name contains\ninstance of the `-\' character. In 5.0, the database directory is also named\na-b-c, which is not necessarily safe for all file systems. In MySQL 5.1 and\nup, the same database name is encoded as a@002db@002dc to produce a file\nsystem-neutral directory name.\n\nWhen a MySQL installation is upgraded to MySQL 5.1 or later from an older\nversion,the server displays a name such as a-b-c (which is in the old format)\nas #mysql50#a-b-c, and you must refer to the name using the #mysql50# prefix.\nUse UPGRADE DATA DIRECTORY NAME in this case to explicitly tell the server to\nre-encode the database directory name to the current encoding format:\n\nALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;\n\nAfter executing this statement, you can refer to the database as a-b-c without\nthe special #mysql50# prefix.\n\nCOMMENT\n-------\n\nMariaDB starting with 10.5.0\n----------------------------\nFrom MariaDB 10.5.0, it is possible to add a comment of a maximum of 1024\nbytes. If the comment length exceeds this length, a error/warning code 4144 is\nthrown. The database comment is also added to the db.opt file, as well as to\nthe information_schema.schemata table.\n\nExamples\n--------\n\nALTER DATABASE test CHARACTER SET=\'utf8\' COLLATE=\'utf8_bin\';\n\nFrom MariaDB 10.5.0:\n\nALTER DATABASE p COMMENT=\'Presentations\';\n\n\n\nURL: mariadb.com/kb/en/alter-database/','','https://mariadb.com/kb/en/alter-database/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (642,39,'ALTER EVENT','Modifies one or more characteristics of an existing event.\n\nSyntax\n------\n\nALTER\n [DEFINER = { user | CURRENT_USER }]\n EVENT event_name\n [ON SCHEDULE schedule]\n [ON COMPLETION [NOT] PRESERVE]\n [RENAME TO new_event_name]\n [ENABLE | DISABLE | DISABLE ON SLAVE]\n [COMMENT \'comment\']\n [DO sql_statement]\n\nDescription\n-----------\n\nThe ALTER EVENT statement is used to change one or more of the characteristics\nof an existing event without the need to drop and recreate it. The syntax for\neach of the DEFINER, ON SCHEDULE, ON COMPLETION, COMMENT, ENABLE / DISABLE,\nand DO clauses is exactly the same as when used with CREATE EVENT.\n\nThis statement requires the EVENT privilege. When a user executes a successful\nALTER EVENT statement, that user becomes the definer for the affected event.\n\n(In MySQL 5.1.11 and earlier, an event could be altered only by its definer,\nor by a user having the SUPER privilege.)\n\nALTER EVENT works only with an existing event:\n\nALTER EVENT no_such_event ON SCHEDULE EVERY \'2:3\' DAY_HOUR;\nERROR 1539 (HY000): Unknown event \'no_such_event\'\n\nExamples\n--------\n\nALTER EVENT myevent \n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;\n\n\n\nURL: mariadb.com/kb/en/alter-event/','','https://mariadb.com/kb/en/alter-event/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (643,39,'ALTER FUNCTION','Syntax\n------\n\nALTER FUNCTION func_name [characteristic ...]\n\ncharacteristic:\n { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n\nDescription\n-----------\n\nThis statement can be used to change the characteristics of a stored function.\nMore than one change may be specified in an ALTER FUNCTION statement. However,\nyou cannot change the parameters or body of a stored function using this\nstatement; to make such changes, you must drop and re-create the function\nusing DROP FUNCTION and CREATE FUNCTION.\n\nYou must have the ALTER ROUTINE privilege for the function. (That privilege is\ngranted automatically to the function creator.) If binary logging is enabled,\nthe ALTER FUNCTION statement might also require the SUPER privilege, as\ndescribed in Binary Logging of Stored Routines.\n\nExample\n-------\n\nALTER FUNCTION hello SQL SECURITY INVOKER;\n\n\n\nURL: mariadb.com/kb/en/alter-function/','','https://mariadb.com/kb/en/alter-function/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (644,39,'ALTER LOGFILE GROUP','Syntax\n------\n\nALTER LOGFILE GROUP logfile_group\n ADD UNDOFILE \'file_name\'\n [INITIAL_SIZE [=] size]\n [WAIT]\n ENGINE [=] engine_name\n\nThe ALTER LOGFILE GROUP statement is not supported by MariaDB. It was\noriginally inherited from MySQL NDB Cluster. See MDEV-19295 for more\ninformation.\n\n\n\nURL: mariadb.com/kb/en/alter-logfile-group/','','https://mariadb.com/kb/en/alter-logfile-group/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (645,39,'ALTER PROCEDURE','Syntax\n------\n\nALTER PROCEDURE proc_name [characteristic ...]\n\ncharacteristic:\n { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n\nDescription\n-----------\n\nThis statement can be used to change the characteristics of a stored\nprocedure. More than one change may be specified in an ALTER PROCEDURE\nstatement. However, you cannot change the parameters or body of a stored\nprocedure using this statement. To make such changes, you must drop and\nre-create the procedure using either CREATE OR REPLACE PROCEDURE (since\nMariaDB 10.1.3) or DROP PROCEDURE and CREATE PROCEDURE (MariaDB 10.1.2 and\nbefore).\n\nYou must have the ALTER ROUTINE privilege for the procedure. By default, that\nprivilege is granted automatically to the procedure creator. See Stored\nRoutine Privileges.\n\nExample\n-------\n\nALTER PROCEDURE simpleproc SQL SECURITY INVOKER;\n\n\n\nURL: mariadb.com/kb/en/alter-procedure/','','https://mariadb.com/kb/en/alter-procedure/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (646,39,'ALTER SERVER','Syntax\n------\n\nALTER SERVER server_name\n OPTIONS (option [, option] ...)\n\nDescription\n-----------\n\nAlters the server information for server_name, adjusting the specified options\nas per the CREATE SERVER command. The corresponding fields in the\nmysql.servers table are updated accordingly. This statement requires the SUPER\nprivilege or, from MariaDB 10.5.2, the FEDERATED ADMIN privilege.\n\nALTER SERVER is not written to the binary log, irrespective of the binary log\nformat being used. From MariaDB 10.1.13, Galera replicates the CREATE SERVER,\nALTER SERVER and DROP SERVER statements.\n\nExamples\n--------\n\nALTER SERVER s OPTIONS (USER \'sally\');\n\n\n\nURL: mariadb.com/kb/en/alter-server/','','https://mariadb.com/kb/en/alter-server/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (647,39,'ALTER TABLE','Syntax\n------\n\nALTER [ONLINE] [IGNORE] TABLE [IF EXISTS] tbl_name\n [WAIT n | NOWAIT]\n alter_specification [, alter_specification] ...\nalter_specification:\n table_option ...\n | ADD [COLUMN] [IF NOT EXISTS] col_name column_definition\n [FIRST | AFTER col_name ]\n | ADD [COLUMN] [IF NOT EXISTS] (col_name column_definition,...)\n | ADD {INDEX|KEY} [IF NOT EXISTS] [index_name]\n [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]] PRIMARY KEY\n [index_type] (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n UNIQUE [INDEX|KEY] [index_name]\n [index_type] (index_col_name,...) [index_option] ...\n | ADD FULLTEXT [INDEX|KEY] [index_name]\n (index_col_name,...) [index_option] ...\n | ADD SPATIAL [INDEX|KEY] [index_name]\n (index_col_name,...) [index_option] ...\n | ADD [CONSTRAINT [symbol]]\n FOREIGN KEY [IF NOT EXISTS] [index_name] (index_col_name,...)\n reference_definition\n | ADD PERIOD FOR SYSTEM_TIME (start_column_name, end_column_name)\n | ALTER [COLUMN] col_name SET DEFAULT literal | (expression)\n | ALTER [COLUMN] col_name DROP DEFAULT\n | ALTER {INDEX|KEY} index_name [NOT] INVISIBLE\n | CHANGE [COLUMN] [IF EXISTS] old_col_name new_col_name column_definition\n [FIRST|AFTER col_name]\n | MODIFY [COLUMN] [IF EXISTS] col_name column_definition\n [FIRST | AFTER col_name]\n | DROP [COLUMN] [IF EXISTS] col_name [RESTRICT|CASCADE]\n | DROP PRIMARY KEY\n | DROP {INDEX|KEY} [IF EXISTS] index_name\n | DROP FOREIGN KEY [IF EXISTS] fk_symbol\n | DROP CONSTRAINT [IF EXISTS] constraint_name\n | DISABLE KEYS\n | ENABLE KEYS\n | RENAME [TO] new_tbl_name\n | ORDER BY col_name [, col_name] ...\n | RENAME COLUMN old_col_name TO new_col_name\n | RENAME {INDEX|KEY} old_index_name TO new_index_name\n | CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]\n | [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n | DISCARD TABLESPACE\n | IMPORT TABLESPACE\n | ALGORITHM [=] {DEFAULT|INPLACE|COPY|NOCOPY|INSTANT}\n | LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n | FORCE\n | partition_options\n | ADD PARTITION [IF NOT EXISTS] (partition_definition)\n | DROP PARTITION [IF EXISTS] partition_names\n | COALESCE PARTITION number\n | REORGANIZE PARTITION [partition_names INTO (partition_definitions)]\n | ANALYZE PARTITION partition_names\n | CHECK PARTITION partition_names\n | OPTIMIZE PARTITION partition_names\n | REBUILD PARTITION partition_names\n | REPAIR PARTITION partition_names\n | EXCHANGE PARTITION partition_name WITH TABLE tbl_name\n | REMOVE PARTITIONING\n | ADD SYSTEM VERSIONING\n | DROP SYSTEM VERSIONING\nindex_col_name:\n col_name [(length)] [ASC | DESC]\nindex_type:\n USING {BTREE | HASH | RTREE}\nindex_option:\n [ KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n | CLUSTERING={YES| NO} ]\n [ IGNORED | NOT IGNORED ]\ntable_options:\n table_option [[,] table_option] ...\n\nDescription\n-----------\n\nALTER TABLE enables you to change the structure of an existing table. For\nexample, you can add or delete columns, create or destroy indexes, change the\ntype of existing columns, or rename columns or the table itself. You can also\nchange the comment for the table and the storage engine of the table.\n\nIf another connection is using the table, a metadata lock is active, and this\nstatement will wait until the lock is released. This is also true for\nnon-transactional tables.\n\nWhen adding a UNIQUE index on a column (or a set of columns) which have\nduplicated values, an error will be produced and the statement will be\nstopped. To suppress the error and force the creation of UNIQUE indexes,\ndiscarding duplicates, the IGNORE option can be specified. This can be useful\nif a column (or a set of columns) should be UNIQUE but it contains duplicate\nvalues; however, this technique provides no control on which rows are\npreserved and which are deleted. Also, note that IGNORE is accepted but\nignored in ALTER TABLE ... EXCHANGE PARTITION statements.\n\nThis statement can also be used to rename a table. For details see RENAME\nTABLE.\n\nWhen an index is created, the storage engine may use a configurable buffer in\nthe process. Incrementing the buffer speeds up the index creation. Aria and\nMyISAM allocate a buffer whose size is defined by aria_sort_buffer_size or\nmyisam_sort_buffer_size, also used for REPAIR TABLE. InnoDB allocates three\nbuffers whose size is defined by innodb_sort_buffer_size.\n\nPrivileges\n----------\n\nExecuting the ALTER TABLE statement generally requires at least the ALTER\nprivilege for the table or the database..\n\nIf you are renaming a table, then it also requires the DROP, CREATE and INSERT\nprivileges for the table or the database as well.\n\nOnline DDL\n----------\n\nOnline DDL is supported with the ALGORITHM and LOCK clauses.\n\nSee InnoDB Online DDL Overview for more information on online DDL with InnoDB.\n\nALTER ONLINE TABLE\n------------------\n\nALTER ONLINE TABLE also works for partitioned tables.\n\nOnline ALTER TABLE is available by executing the following:\n\nALTER ONLINE TABLE ...;\n\nThis statement has the following semantics:\n\nThis statement is equivalent to the following:\n\nALTER TABLE ... LOCK=NONE;\n\nSee the LOCK alter specification for more information.\n\nThis statement is equivalent to the following:\n\nALTER TABLE ... ALGORITHM=INPLACE;\n\nSee the ALGORITHM alter specification for more information.\n\nWAIT/NOWAIT\n-----------\n\nMariaDB starting with 10.3.0\n----------------------------\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nIF EXISTS\n---------\n\nThe IF EXISTS and IF NOT EXISTS clauses are available for the following:\n\nADD COLUMN [IF NOT EXISTS]\nADD INDEX [IF NOT EXISTS]\nADD FOREIGN KEY [IF NOT EXISTS]\nADD PARTITION [IF NOT EXISTS]\nCREATE INDEX [IF NOT EXISTS]\nDROP COLUMN [IF EXISTS]\nDROP INDEX [IF EXISTS]\nDROP FOREIGN KEY [IF EXISTS]\nDROP PARTITION [IF EXISTS]\nCHANGE COLUMN [IF EXISTS]\nMODIFY COLUMN [IF EXISTS]\nDROP INDEX [IF EXISTS]\nWhen IF EXISTS and IF NOT EXISTS are used in clauses, queries will not report\nerrors when the condition is triggered for that clause. A warning with the\nsame message text will be issued and the ALTER will move on to the next clause\nin the statement (or end if finished).\n\nMariaDB starting with 10.5.2\n----------------------------\nIf this is directive is used after ALTER ... TABLE, one will not get an error\nif the table doesn\'t exist.\n\nColumn Definitions\n------------------\n\nSee CREATE TABLE: Column Definitions for information about column definitions.\n\nIndex Definitions\n-----------------\n\nSee CREATE TABLE: Index Definitions for information about index definitions.\n\nThe CREATE INDEX and DROP INDEX statements can also be used to add or remove\nan index.\n\nCharacter Sets and Collations\n-----------------------------\n\nCONVERT TO CHARACTER SET charset_name [COLLATE collation_name]\n[DEFAULT] CHARACTER SET [=] charset_name\n[DEFAULT] COLLATE [=] collation_name\nSee Setting Character Sets and Collations for details on setting the character\nsets and collations.\n\nAlter Specifications\n--------------------\n\nTable Options\n-------------\n\nSee CREATE TABLE: Table Options for information about table options.\n\nADD COLUMN\n----------\n\n... ADD COLUMN [IF NOT EXISTS] (col_name column_definition,...)\nAdds a column to the table. The syntax is the same as in CREATE TABLE. If you\nare using IF NOT_EXISTS the column will not be added if it was not there\nalready. This is very useful when doing scripts to modify tables.\n\nThe FIRST and AFTER clauses affect the physical order of columns in the\ndatafile. Use FIRST to add a column in the first (leftmost) position, or AFTER\nfollowed by a column name to add the new column in any other position. Note\nthat, nowadays, the physical position of a column is usually irrelevant.\n\nSee also Instant ADD COLUMN for InnoDB.\n\nDROP COLUMN\n-----------\n\n... DROP COLUMN [IF EXISTS] col_name [CASCADE|RESTRICT]\nDrops the column from the table. If you are using IF EXISTS you will not get\nan error if the column didn\'t exist. If the column is part of any index, the\ncolumn will be dropped from them, except if you add a new column with\nidentical name at the same time. The index will be dropped if all columns from\nthe index were dropped. If the column was used in a view or trigger, you will\nget an error next time the view or trigger is accessed.\n\nMariaDB starting with 10.2.8\n----------------------------\nDropping a column that is part of a multi-column UNIQUE constraint is not\npermitted. For example:\n\nCREATE TABLE a (\n a int,\n b int,\n primary key (a,b)\n);\n\nALTER TABLE x DROP COLUMN a;\n[42000][1072] Key column \'A\' doesn\'t exist in table\n\nThe reason is that dropping column a would result in the new constraint that\nall values in column b be unique. In order to drop the column, an explicit\nDROP PRIMARY KEY and ADD PRIMARY KEY would be required. Up until MariaDB\n10.2.7, the column was dropped and the additional constraint applied,\nresulting in the following structure:\n\nALTER TABLE x DROP COLUMN a;\nQuery OK, 0 rows affected (0.46 sec)\n\nDESC x;\n+-------+---------+------+-----+---------+-------+\n| Field | Type | Null | Key | Default | Extra |\n+-------+---------+------+-----+---------+-------+\n| b | int(11) | NO | PRI | NULL | |\n+-------+---------+------+-----+---------+-------+\n\nMariaDB starting with 10.4.0\n----------------------------\nMariaDB 10.4.0 supports instant DROP COLUMN. DROP COLUMN of an indexed column\nwould imply DROP INDEX (and in the case of a non-UNIQUE multi-column index,\npossibly ADD INDEX). These will not be allowed with ALGORITHM=INSTANT, but\nunlike before, they can be allowed with ALGORITHM=NOCOPY\n\nRESTRICT and CASCADE are allowed to make porting from other database systems\neasier. In MariaDB, they do nothing.\n\nMODIFY COLUMN\n-------------\n\nAllows you to modify the type of a column. The column will be at the same\nplace as the original column and all indexes on the column will be kept. Note\nthat when modifying column, you should specify all attributes for the new\ncolumn.\n\nCREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY((a));\nALTER TABLE t1 MODIFY a BIGINT UNSIGNED AUTO_INCREMENT;\n\nCHANGE COLUMN\n-------------\n\nWorks like MODIFY COLUMN except that you can also change the name of the\ncolumn. The column will be at the same place as the original column and all\nindex on the column will be kept.\n\nCREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(a));\nALTER TABLE t1 CHANGE a b BIGINT UNSIGNED AUTO_INCREMENT;\n\nALTER COLUMN\n------------\n\nThis lets you change column options.\n\nCREATE TABLE t1 (a INT UNSIGNED AUTO_INCREMENT, b varchar(50), PRIMARY KEY(a));\nALTER TABLE t1 ALTER b SET DEFAULT \'hello\';\n\nRENAME INDEX/KEY\n----------------\n\nMariaDB starting with 10.5.2\n----------------------------\nFrom MariaDB 10.5.2, it is possible to rename an index using the RENAME INDEX\n(or RENAME KEY) syntax, for example:\n\nALTER TABLE t1 RENAME INDEX i_old TO i_new;\n\nRENAME COLUMN\n-------------\n\nMariaDB starting with 10.5.2\n----------------------------\nFrom MariaDB 10.5.2, it is possible to rename a column using the RENAME COLUMN\nsyntax, for example:\n\nALTER TABLE t1 RENAME COLUMN c_old TO c_new;\n\nADD PRIMARY KEY\n---------------\n\nAdd a primary key.\n\nFor PRIMARY KEY indexes, you can specify a name for the index, but it is\nsilently ignored, and the name of the index is always PRIMARY.\n\nSee Getting Started with Indexes: Primary Key for more information.\n\nDROP PRIMARY KEY\n----------------\n\nDrop a primary key.\n\nFor PRIMARY KEY indexes, you can specify a name for the index, but it is\nsilently ignored, and the name of the index is always PRIMARY.\n\nSee Getting Started with Indexes: Primary Key for more information.\n\nADD FOREIGN KEY\n---------------\n\nAdd a foreign key.\n\nFor FOREIGN KEY indexes, a reference definition must be provided.\n\nFor FOREIGN KEY indexes, you can specify a name for the constraint, using the\nCONSTRAINT keyword. That name will be used in error messages.\n\nFirst, you have to specify the name of the target (parent) table and a column\nor a column list which must be indexed and whose values must match to the\nforeign key\'s values. The MATCH clause is accepted to improve the\ncompatibility with other DBMS\'s, but has no meaning in MariaDB. The ON DELETE\nand ON UPDATE clauses specify what must be done when a DELETE (or a REPLACE)\nstatements attempts to delete a referenced row from the parent table, and when\nan UPDATE statement attempts to modify the referenced foreign key columns in a\nparent table row, respectively. The following options are allowed:\n\n* RESTRICT: The delete/update operation is not performed. The statement\nterminates with a 1451 error (SQLSTATE \'2300\').\n* NO ACTION: Synonym for RESTRICT.\n* CASCADE: The delete/update operation is performed in both tables.\n* SET NULL: The update or delete goes ahead in the parent table, and the\ncorresponding foreign key fields in the child table are set to NULL. (They\nmust not be defined as NOT NULL for this to succeed).\n* SET DEFAULT: This option is implemented only for the legacy PBXT storage\nengine, which is disabled by default and no longer maintained. It sets the\nchild table\'s foreign key fields to their DEFAULT values when the referenced\nparent table key entries are updated or deleted.\n\nIf either clause is omitted, the default behavior for the omitted clause is\nRESTRICT.\n\nSee Foreign Keys for more information.\n\nDROP FOREIGN KEY\n----------------\n\nDrop a foreign key.\n\nSee Foreign Keys for more information.\n\nADD INDEX\n---------\n\nAdd a plain index.\n\nPlain indexes are regular indexes that are not unique, and are not acting as a\nprimary key or a foreign key. They are also not the "specialized" FULLTEXT or\nSPATIAL indexes.\n\nSee Getting Started with Indexes: Plain Indexes for more information.\n\nDROP INDEX\n----------\n\nDrop a plain index.\n\nPlain indexes are regular indexes that are not unique, and are not acting as a\nprimary key or a foreign key. They are also not the "specialized" FULLTEXT or\nSPATIAL indexes.\n\nSee Getting Started with Indexes: Plain Indexes for more information.\n\nADD UNIQUE INDEX\n----------------\n\nAdd a unique index.\n\nThe UNIQUE keyword means that the index will not accept duplicated values,\nexcept for NULLs. An error will raise if you try to insert duplicate values in\na UNIQUE index.\n\nFor UNIQUE indexes, you can specify a name for the constraint, using the\nCONSTRAINT keyword. That name will be used in error messages.\n\nSee Getting Started with Indexes: Unique Index for more information.\n\nDROP UNIQUE INDEX\n-----------------\n\nDrop a unique index.\n\nThe UNIQUE keyword means that the index will not accept duplicated values,\nexcept for NULLs. An error will raise if you try to insert duplicate values in\na UNIQUE index.\n\nFor UNIQUE indexes, you can specify a name for the constraint, using the\nCONSTRAINT keyword. That name will be used in error messages.\n\nSee Getting Started with Indexes: Unique Index for more information.\n\nADD FULLTEXT INDEX\n------------------\n\nAdd a FULLTEXT index.\n\nSee Full-Text Indexes for more information.\n\nDROP FULLTEXT INDEX\n-------------------\n\nDrop a FULLTEXT index.\n\nSee Full-Text Indexes for more information.\n\nADD SPATIAL INDEX\n-----------------\n\nAdd a SPATIAL index.\n\nSee SPATIAL INDEX for more information.\n\nDROP SPATIAL INDEX\n------------------\n\nDrop a SPATIAL index.\n\nSee SPATIAL INDEX for more information.\n\nENABLE/ DISABLE KEYS\n--------------------\n\nDISABLE KEYS will disable all non unique keys for the table for storage\nengines that support this (at least MyISAM and Aria). This can be used to\nspeed up inserts into empty tables.\n\nENABLE KEYS will enable all disabled keys.\n\nRENAME TO\n---------\n\nRenames the table. See also RENAME TABLE.\n\nADD CONSTRAINT\n--------------\n\nModifies the table adding a constraint on a particular column or columns.\n\nMariaDB starting with 10.2.1\n----------------------------\nMariaDB 10.2.1 introduced new ways to define a constraint.\n\nNote: Before MariaDB 10.2.1, constraint expressions were accepted in syntax,\nbut ignored.\n\nALTER TABLE table_name \nADD CONSTRAINT [constraint_name] CHECK(expression);\nBefore a row is inserted or updated, all constraints are evaluated in the\norder they are defined. If any constraint fails, then the row will not be\nupdated. One can use most deterministic functions in a constraint, including\nUDF\'s.\n\nCREATE TABLE account_ledger (\n id INT PRIMARY KEY AUTO_INCREMENT,\n transaction_name VARCHAR(100),\n credit_account VARCHAR(100),\n credit_amount INT,\n debit_account VARCHAR(100),\n debit_amount INT);\n\nALTER TABLE account_ledger \nADD CONSTRAINT is_balanced \n CHECK((debit_amount + credit_amount) = 0);\n\nThe constraint_name is optional. If you don\'t provide one in the ALTER TABLE\nstatement, MariaDB auto-generates a name for you. This is done so that you can\nremove it later using DROP CONSTRAINT clause.\n\nYou can disable all constraint expression checks by setting the variable\ncheck_constraint_checks to OFF. You may find this useful when loading a table\nthat violates some constraints that you want to later find and fix in SQL.\n\nTo view constraints on a table, query information_schema.TABLE_CONSTRAINTS:\n\nSELECT CONSTRAINT_NAME, TABLE_NAME, CONSTRAINT_TYPE \nFROM information_schema.TABLE_CONSTRAINTS\nWHERE TABLE_NAME = \'account_ledger\';\n\n+-----------------+----------------+-----------------+\n| CONSTRAINT_NAME | TABLE_NAME | CONSTRAINT_TYPE |\n+-----------------+----------------+-----------------+\n| is_balanced | account_ledger | CHECK |\n+-----------------+----------------+-----------------+\n\nDROP CONSTRAINT\n---------------\n\nMariaDB starting with 10.2.22\n-----------------------------\nDROP CONSTRAINT for UNIQUE and FOREIGN KEY constraints was introduced in\nMariaDB 10.2.22 and MariaDB 10.3.13.\n\nMariaDB starting with 10.2.1\n----------------------------\nDROP CONSTRAINT for CHECK constraints was introduced in MariaDB 10.2.1\n\nModifies the table, removing the given constraint.\n\nALTER TABLE table_name\nDROP CONSTRAINT constraint_name;\n\nWhen you add a constraint to a table, whether through a CREATE TABLE or ALTER\nTABLE...ADD CONSTRAINT statement, you can either set a constraint_name\nyourself, or allow MariaDB to auto-generate one for you. To view constraints\non a table, query information_schema.TABLE_CONSTRAINTS. For instance,\n\nCREATE TABLE t (\n a INT,\n b INT,\n c INT,\n CONSTRAINT CHECK(a > b),\n CONSTRAINT check_equals CHECK(a = c));\n\nSELECT CONSTRAINT_NAME, TABLE_NAME, CONSTRAINT_TYPE \nFROM information_schema.TABLE_CONSTRAINTS\nWHERE TABLE_NAME = \'t\';\n\n+-----------------+----------------+-----------------+\n| CONSTRAINT_NAME | TABLE_NAME | CONSTRAINT_TYPE |\n+-----------------+----------------+-----------------+\n| check_equals | t | CHECK |\n| CONSTRAINT_1 | t | CHECK |\n+-----------------+----------------+-----------------+\n\nTo remove a constraint from the table, issue an ALTER TABLE...DROP CONSTRAINT\nstatement. For example,\n\nALTER TABLE t DROP CONSTRAINT is_unique;\n\nADD SYSTEM VERSIONING\n---------------------\n\nMariaDB starting with 10.3.4\n----------------------------\nSystem-versioned tables was added in MariaDB 10.3.4.\n\nAdd system versioning.\n\nDROP SYSTEM VERSIONING\n----------------------\n\nMariaDB starting with 10.3.4\n----------------------------\nSystem-versioned tables was added in MariaDB 10.3.4.\n\nDrop system versioning.\n\nADD PERIOD FOR SYSTEM_TIME\n--------------------------\n\nMariaDB starting with 10.3.4\n----------------------------\nSystem-versioned tables was added in MariaDB 10.3.4.\n\nFORCE\n-----\n\nALTER TABLE ... FORCE can force MariaDB to re-build the table.\n\nIn MariaDB 5.5 and before, this could only be done by setting the ENGINE table\noption to its old value. For example, for an InnoDB table, one could execute\nthe following:\n\nALTER TABLE tab_name ENGINE = InnoDB;\n\nThe FORCE option can be used instead. For example, :\n\nALTER TABLE tab_name FORCE;\n\nWith InnoDB, the table rebuild will only reclaim unused space (i.e. the space\npreviously used for deleted rows) if the innodb_file_per_table system variable\nis set to ON. If the system variable is OFF, then the space will not be\nreclaimed, but it will be-re-used for new data that\'s later added.\n\nEXCHANGE PARTITION\n------------------\n\nThis is used to exchange the tablespace files between a partition and another\ntable.\n\nSee copying InnoDB\'s transportable tablespaces for more information.\n\nDISCARD TABLESPACE\n------------------\n\nThis is used to discard an InnoDB table\'s tablespace.\n\nSee copying InnoDB\'s transportable tablespaces for more information.\n\nIMPORT TABLESPACE\n-----------------\n\nThis is used to import an InnoDB table\'s tablespace. The tablespace should\nhave been copied from its original server after executing FLUSH TABLES FOR\nEXPORT.\n\nSee copying InnoDB\'s transportable tablespaces for more information.\n\nALTER TABLE ... IMPORT only applies to InnoDB tables. Most other popular\nstorage engines, such as Aria and MyISAM, will recognize their data files as\nsoon as they\'ve been placed in the proper directory under the datadir, and no\nspecial DDL is required to import them.\n\nALGORITHM\n---------\n\nThe ALTER TABLE statement supports the ALGORITHM clause. This clause is one of\nthe clauses that is used to implement online DDL. ALTER TABLE supports several\ndifferent algorithms. An algorithm can be explicitly chosen for an ALTER TABLE\noperation by setting the ALGORITHM clause. The supported values are:\n\n* ALGORITHM=DEFAULT - This implies the default behavior for the specific\nstatement, such as if no ALGORITHM clause is specified.\n* ALGORITHM=COPY\n* ALGORITHM=INPLACE\n* ALGORITHM=NOCOPY - This was added in MariaDB 10.3.7.\n* ALGORITHM=INSTANT - This was added in MariaDB 10.3.7.\n\nSee InnoDB Online DDL Overview: ALGORITHM for information on how the ALGORITHM\nclause affects InnoDB.\n\nALGORITHM=DEFAULT\n-----------------\n\nThe default behavior, which occurs if ALGORITHM=DEFAULT is specified, or if\nALGORITHM is not specified at all, usually only makes a copy if the operation\ndoesn\'t support being done in-place at all. In this case, the most efficient\navailable algorithm will usually be used.\n\nHowever, in MariaDB 10.3.6 and before, if the value of the old_alter_table\nsystem variable is set to ON, then the default behavior is to perform ALTER\nTABLE operations by making a copy of the table using the old algorithm.\n\nIn MariaDB 10.3.7 and later, the old_alter_table system variable is\ndeprecated. Instead, the alter_algorithm system variable defines the default\nalgorithm for ALTER TABLE operations.\n\nALGORITHM=COPY\n--------------\n\nALGORITHM=COPY is the name for the original ALTER TABLE algorithm from early\nMariaDB versions.\n\nWhen ALGORITHM=COPY is set, MariaDB essentially does the following operations:\n\n-- Create a temporary table with the new definition\nCREATE TEMPORARY TABLE tmp_tab (\n...\n);\n\n-- Copy the data from the original table\nINSERT INTO tmp_tab\n SELECT * FROM original_tab;\n\n-- Drop the original table\nDROP TABLE original_tab;\n\n-- Rename the temporary table, so that it replaces the original one\nRENAME TABLE tmp_tab TO original_tab;\n\nThis algorithm is very inefficient, but it is generic, so it works for all\nstorage engines.\n\nIf ALGORITHM=COPY is specified, then the copy algorithm will be used even if\nit is not necessary. This can result in a lengthy table copy. If multiple\nALTER TABLE operations are required that each require the table to be rebuilt,\nthen it is best to specify all operations in a single ALTER TABLE statement,\nso that the table is only rebuilt once.\n\nALGORITHM=INPLACE\n-----------------\n\nALGORITHM=COPY can be incredibly slow, because the whole table has to be\ncopied and rebuilt. ALGORITHM=INPLACE was introduced as a way to avoid this by\nperforming operations in-place and avoiding the table copy and rebuild, when\npossible.\n\nWhen ALGORITHM=INPLACE is set, the underlying storage engine uses\noptimizations to perform the operation while avoiding the table copy and\nrebuild. However, INPLACE is a bit of a misnomer, since some operations may\nstill require the table to be rebuilt for some storage engines. Regardless,\nseveral operations can be performed without a full copy of the table for some\nstorage engines.\n\nA more accurate name would have been ALGORITHM=ENGINE, where ENGINE refers to\nan "engine-specific" algorithm.\n\nIf an ALTER TABLE operation supports ALGORITHM=INPLACE, then it can be\nperformed using optimizations by the underlying storage engine, but it may\nrebuilt.\n\nSee InnoDB Online DDL Operations with ALGORITHM=INPLACE for more.\n\nALGORITHM=NOCOPY\n----------------\n\nALGORITHM=NOCOPY was introduced in MariaDB 10.3.7.\n\nALGORITHM=INPLACE can sometimes be surprisingly slow in instances where it has\nto rebuild the clustered index, because when the clustered index has to be\nrebuilt, the whole table has to be rebuilt. ALGORITHM=NOCOPY was introduced as\na way to avoid this.\n\nIf an ALTER TABLE operation supports ALGORITHM=NOCOPY, then it can be\nperformed without rebuilding the clustered index.\n\nIf ALGORITHM=NOCOPY is specified for an ALTER TABLE operation that does not\nsupport ALGORITHM=NOCOPY, then an error will be raised. In this case, raising\nan error is preferable, if the alternative is for the operation to rebuild the\nclustered index, and perform unexpectedly slowly.\n\nSee InnoDB Online DDL Operations with ALGORITHM=NOCOPY for more.\n\nALGORITHM=INSTANT\n-----------------\n\nALGORITHM=INSTANT was introduced in MariaDB 10.3.7.\n\nALGORITHM=INPLACE can sometimes be surprisingly slow in instances where it has\nto modify data files. ALGORITHM=INSTANT was introduced as a way to avoid this.\n\nIf an ALTER TABLE operation supports ALGORITHM=INSTANT, then it can be\nperformed without modifying any data files.\n\nIf ALGORITHM=INSTANT is specified for an ALTER TABLE operation that does not\nsupport ALGORITHM=INSTANT, then an error will be raised. In this case, raising\nan error is preferable, if the alternative is for the operation to modify data\nfiles, and perform unexpectedly slowly.\n\nSee InnoDB Online DDL Operations with ALGORITHM=INSTANT for more.\n\nLOCK\n----\n\nThe ALTER TABLE statement supports the LOCK clause. This clause is one of the\nclauses that is used to implement online DDL. ALTER TABLE supports several\ndifferent locking strategies. A locking strategy can be explicitly chosen for\nan ALTER TABLE operation by setting the LOCK clause. The supported values are:\n\n* DEFAULT: Acquire the least restrictive lock on the table that is supported\nfor the specific operation. Permit the maximum amount of concurrency that is\nsupported for the specific operation.\n* NONE: Acquire no lock on the table. Permit all concurrent DML. If this\nlocking strategy is not permitted for an operation, then an error is raised.\n* SHARED: Acquire a read lock on the table. Permit read-only concurrent DML.\nIf this locking strategy is not permitted for an operation, then an error is\nraised.\n* EXCLUSIVE: Acquire a write lock on the table. Do not permit concurrent DML.\n\nDifferent storage engines support different locking strategies for different\noperations. If a specific locking strategy is chosen for an ALTER TABLE\noperation, and that table\'s storage engine does not support that locking\nstrategy for that specific operation, then an error will be raised.\n\nIf the LOCK clause is not explicitly set, then the operation uses LOCK=DEFAULT.\n\nALTER ONLINE TABLE is equivalent to LOCK=NONE. Therefore, the ALTER ONLINE\nTABLE statement can be used to ensure that your ALTER TABLE operation allows\nall concurrent DML.\n\nSee InnoDB Online DDL Overview: LOCK for information on how the LOCK clause\naffects InnoDB.\n\nProgress Reporting\n------------------\n\nMariaDB provides progress reporting for ALTER TABLE statement for clients that\nsupport the new progress reporting protocol. For example, if you were using\nthe mysql client, then the progress report might look like this::\n\nALTER TABLE test ENGINE=Aria;\nStage: 1 of 2 \'copy to tmp table\' 46% of stage\n\nThe progress report is also shown in the output of the SHOW PROCESSLIST\nstatement and in the contents of the information_schema.PROCESSLIST table.\n\nSee Progress Reporting for more information.\n\nAborting ALTER TABLE Operations\n-------------------------------\n\nIf an ALTER TABLE operation is being performed and the connection is killed,\nthe changes will be rolled back in a controlled manner. The rollback can be a\nslow operation as the time it takes is relative to how far the operation has\nprogressed.\n\nMariaDB starting with 10.2.13\n-----------------------------\nAborting ALTER TABLE ... ALGORITHM=COPY was made faster by removing excessive\nundo logging (MDEV-11415). This significantly shortens the time it takes to\nabort a running ALTER TABLE operation.\n\nAtomic ALTER TABLE\n------------------\n\nMariaDB starting with 10.6.1\n----------------------------\nFrom MariaDB 10.6, ALTER TABLE is atomic for most engines, including InnoDB,\nMyRocks, MyISAM and Aria (MDEV-25180). This means that if there is a crash\n(server down or power outage) during an ALTER TABLE operation, after recovery,\neither the old table and associated triggers and status will be intact, or the\nnew table will be active.\n\nIn older MariaDB versions one could get leftover #sql-alter..\',\n\'#sql-backup..\' or \'table_name.frm˝\' files if the system crashed during the\nALTER TABLE operation.\n\nSee Atomic DDL for more information.\n\nReplication\n-----------\n\nMariaDB starting with 10.8.0\n----------------------------\nBefore MariaDB 10.8.0, ALTER TABLE got fully executed on the primary first,\nand only then was it replicated and started executing on replicas. From\nMariaDB 10.8.0, ALTER TABLE gets replicated and starts executing on replicas\nwhen it starts executing on the primary, not when it finishes. This way the\nreplication lag caused by a heavy ALTER TABLE can be completely eliminated\n(MDEV-11675).\n\nExamples\n--------\n\nAdding a new column:\n\nALTER TABLE t1 ADD x INT;\n\nDropping a column:\n\nALTER TABLE t1 DROP x;\n\nModifying the type of a column:\n\nALTER TABLE t1 MODIFY x bigint unsigned;\n\nChanging the name and type of a column:\n\nALTER TABLE t1 CHANGE a b bigint unsigned auto_increment;\n\nCombining multiple clauses in a single ALTER TABLE statement, separated by\ncommas:\n\nALTER TABLE t1 DROP x, ADD x2 INT, CHANGE y y2 INT;\n\nChanging the storage engine and adding a comment:\n\nALTER TABLE t1 \n ENGINE = InnoDB\n COMMENT = \'First of three tables containing usage info\';\n\nRebuilding the table (the previous example will also rebuild the table if it\nwas already InnoDB):\n\nALTER TABLE t1 FORCE;\n\nDropping an index:\n\nALTER TABLE rooms DROP INDEX u;\n\nAdding a unique index:\n\nALTER TABLE rooms ADD UNIQUE INDEX u(room_number);\n\nFrom MariaDB 10.5.3, adding a primary key for an application-time period table\nwith a WITHOUT OVERLAPS constraint:\n\nALTER TABLE rooms ADD PRIMARY KEY(room_number, p WITHOUT OVERLAPS);\n\n\n\nURL: mariadb.com/kb/en/alter-table/','','https://mariadb.com/kb/en/alter-table/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (648,39,'ALTER TABLESPACE','The ALTER TABLESPACE statement is not supported by MariaDB. It was\noriginally inherited from MySQL NDB Cluster. In MySQL 5.7 and later, the\nstatement is also supported for InnoDB. However, MariaDB has chosen not to\ninclude that specific feature. See MDEV-19294 for more information.\n\n\n\nURL: mariadb.com/kb/en/alter-tablespace/','','https://mariadb.com/kb/en/alter-tablespace/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (649,39,'ALTER VIEW','Syntax\n------\n\nALTER\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nDescription\n-----------\n\nThis statement changes the definition of a view, which must exist. The syntax\nis similar to that for CREATE VIEW and the effect is the same as for CREATE OR\nREPLACE VIEW if the view exists. This statement requires the CREATE VIEW and\nDROP privileges for the view, and some privilege for each column referred to\nin the SELECT statement. ALTER VIEW is allowed only to the definer or users\nwith the SUPER privilege.\n\nExample\n-------\n\nALTER VIEW v AS SELECT a, a*3 AS a2 FROM t;\n\n\n\nURL: mariadb.com/kb/en/alter-view/','','https://mariadb.com/kb/en/alter-view/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (650,39,'CONSTRAINT','MariaDB supports the implementation of constraints at the table-level\nusing either CREATE TABLE or ALTER TABLE statements. A table constraint\nrestricts the data you can add to the table. If you attempt to insert invalid\ndata on a column, MariaDB throws an error.\n\nSyntax\n------\n\n[CONSTRAINT [symbol]] constraint_expression\n\nconstraint_expression:\n | PRIMARY KEY [index_type] (index_col_name, ...) [index_option] ...\n | FOREIGN KEY [index_name] (index_col_name, ...)\n REFERENCES tbl_name (index_col_name, ...)\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n | UNIQUE [INDEX|KEY] [index_name]\n [index_type] (index_col_name, ...) [index_option] ...\n | CHECK (check_constraints)\n\nindex_type:\n USING {BTREE | HASH | RTREE}\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_option:\n | KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n | CLUSTERING={YES|NO}\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT\n\nDescription\n-----------\n\nConstraints provide restrictions on the data you can add to a table. This\nallows you to enforce data integrity from MariaDB, rather than through\napplication logic. When a statement violates a constraint, MariaDB throws an\nerror.\n\nThere are four types of table constraints:\n\n+------------------------------------+----------------------------------------+\n| Constraint | Description |\n+------------------------------------+----------------------------------------+\n| PRIMARY KEY | Sets the column for referencing rows. |\n| | Values must be unique and not null. |\n+------------------------------------+----------------------------------------+\n| FOREIGN KEY | Sets the column to reference the |\n| | primary key on another table. |\n+------------------------------------+----------------------------------------+\n| UNIQUE | Requires values in column or columns |\n| | only occur once in the table. |\n+------------------------------------+----------------------------------------+\n| CHECK | Checks whether the data meets the |\n| | given condition. |\n+------------------------------------+----------------------------------------+\n\nThe Information Schema TABLE_CONSTRAINTS Table contains information about\ntables that have constraints.\n\nFOREIGN KEY Constraints\n-----------------------\n\nInnoDB supports foreign key constraints. The syntax for a foreign key\nconstraint definition in InnoDB looks like this:\n\n[CONSTRAINT [symbol]] FOREIGN KEY\n [index_name] (index_col_name, ...)\n REFERENCES tbl_name (index_col_name,...)\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION\n\nThe Information Schema REFERENTIAL_CONSTRAINTS table has more information\nabout foreign keys.\n\nCHECK Constraints\n-----------------\n\nMariaDB starting with 10.2.1\n----------------------------\nFrom MariaDB 10.2.1, constraints are enforced. Before MariaDB 10.2.1\nconstraint expressions were accepted in the syntax but ignored.\n\nIn MariaDB 10.2.1 you can define constraints in 2 different ways:\n\n* CHECK(expression) given as part of a column definition.\n* CONSTRAINT [constraint_name] CHECK (expression)\n\nBefore a row is inserted or updated, all constraints are evaluated in the\norder they are defined. If any constraint expression returns false, then the\nrow will not be inserted or updated. One can use most deterministic functions\nin a constraint, including UDFs.\n\nCREATE TABLE t1 (a INT CHECK (a>2), b INT CHECK (b>2), CONSTRAINT a_greater\nCHECK (a>b));\n\nIf you use the second format and you don\'t give a name to the constraint, then\nthe constraint will get an automatically generated name. This is done so that\nyou can later delete the constraint with ALTER TABLE DROP constraint_name.\n\nOne can disable all constraint expression checks by setting the\ncheck_constraint_checks variable to OFF. This is useful for example when\nloading a table that violates some constraints that you want to later find and\nfix in SQL.\n\nReplication\n-----------\n\nIn row-based replication, only the master checks constraints, and failed\nstatements will not be replicated. In statement-based replication, the slaves\nwill also check constraints. Constraints should therefore be identical, as\nwell as deterministic, in a replication environment.\n\nAuto_increment\n--------------\n\nMariaDB starting with 10.2.6\n----------------------------\n* From MariaDB 10.2.6, auto_increment columns are no longer permitted in check\nconstraints. Previously they were permitted, but would not work correctly. See\nMDEV-11117.\n\nExamples\n--------\n\nCREATE TABLE product (category INT NOT NULL, id INT NOT NULL,\n price DECIMAL,\n PRIMARY KEY(category, id)) ENGINE=INNODB;\nCREATE TABLE customer (id INT NOT NULL,\n PRIMARY KEY (id)) ENGINE=INNODB;\nCREATE TABLE product_order (no INT NOT NULL AUTO_INCREMENT,\n product_category INT NOT NULL,\n product_id INT NOT NULL,\n customer_id INT NOT NULL,\n PRIMARY KEY(no),\n INDEX (product_category, product_id),\n FOREIGN KEY (product_category, product_id)\n REFERENCES product(category, id)\n ON UPDATE CASCADE ON DELETE RESTRICT,\n INDEX (customer_id),\n FOREIGN KEY (customer_id)\n REFERENCES customer(id)) ENGINE=INNODB;\n\nMariaDB starting with 10.2.1\n----------------------------\nThe following examples will work from MariaDB 10.2.1 onwards.\n\nNumeric constraints and comparisons:\n\nCREATE TABLE t1 (a INT CHECK (a>2), b INT CHECK (b>2), CONSTRAINT a_greater\nCHECK (a>b));\n\nINSERT INTO t1(a) VALUES (1);\nERROR 4022 (23000): CONSTRAINT `a` failed for `test`.`t1`\n\nINSERT INTO t1(a,b) VALUES (3,4);\nERROR 4022 (23000): CONSTRAINT `a_greater` failed for `test`.`t1`\n\nINSERT INTO t1(a,b) VALUES (4,3);\nQuery OK, 1 row affected (0.04 sec)\n\nDropping a constraint:\n\nALTER TABLE t1 DROP CONSTRAINT a_greater;\n\nAdding a constraint:\n\nALTER TABLE t1 ADD CONSTRAINT a_greater CHECK (a>b);\n\nDate comparisons and character length:\n\nCREATE TABLE t2 (name VARCHAR(30) CHECK (CHAR_LENGTH(name)>2), start_date\nDATE, \n end_date DATE CHECK (start_date IS NULL OR end_date IS NULL OR\nstart_date<end_date));\n\nINSERT INTO t2(name, start_date, end_date) VALUES(\'Ione\', \'2003-12-15\',\n\'2014-11-09\');\nQuery OK, 1 row affected (0.04 sec)\n\nINSERT INTO t2(name, start_date, end_date) VALUES(\'Io\', \'2003-12-15\',\n\'2014-11-09\');\nERROR 4022 (23000): CONSTRAINT `name` failed for `test`.`t2`\n\nINSERT INTO t2(name, start_date, end_date) VALUES(\'Ione\', NULL, \'2014-11-09\');\nQuery OK, 1 row affected (0.04 sec)\n\nINSERT INTO t2(name, start_date, end_date) VALUES(\'Ione\', \'2015-12-15\',\n\'2014-11-09\');\nERROR 4022 (23000): CONSTRAINT `end_date` failed for `test`.`t2`\n\nA misplaced parenthesis:\n\nCREATE TABLE t3 (name VARCHAR(30) CHECK (CHAR_LENGTH(name>2)), start_date\nDATE, \n end_date DATE CHECK (start_date IS NULL OR end_date IS NULL OR\nstart_date<end_date));\nQuery OK, 0 rows affected (0.32 sec)\n\nINSERT INTO t3(name, start_date, end_date) VALUES(\'Io\', \'2003-12-15\',\n\'2014-11-09\');\nQuery OK, 1 row affected, 1 warning (0.04 sec)\n\nSHOW WARNINGS;\n+---------+------+----------------------------------------+\n| Level | Code | Message |\n+---------+------+----------------------------------------+\n| Warning | 1292 | Truncated incorrect DOUBLE value: \'Io\' |\n+---------+------+----------------------------------------+\n\nCompare the definition of table t2 to table t3. CHAR_LENGTH(name)>2 is very\ndifferent to CHAR_LENGTH(name>2) as the latter mistakenly performs a numeric\ncomparison on the name field, leading to unexpected results.\n\n\n\nURL: mariadb.com/kb/en/constraint/','','https://mariadb.com/kb/en/constraint/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (651,39,'CREATE DATABASE','Syntax\n------\n\nCREATE [OR REPLACE] {DATABASE | SCHEMA} [IF NOT EXISTS] db_name\n [create_specification] ...\n\ncreate_specification:\n [DEFAULT] CHARACTER SET [=] charset_name\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'comment\'\n\nDescription\n-----------\n\nCREATE DATABASE creates a database with the given name. To use this statement,\nyou need the CREATE privilege for the database. CREATE SCHEMA is a synonym for\nCREATE DATABASE.\n\nFor valid identifiers to use as database names, see Identifier Names.\n\nOR REPLACE\n----------\n\nMariaDB starting with 10.1.3\n----------------------------\nThe OR REPLACE clause was added in MariaDB 10.1.3\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP DATABASE IF EXISTS db_name;\nCREATE DATABASE db_name ...;\n\nIF NOT EXISTS\n-------------\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead\nof an error if the specified database already exists.\n\nCOMMENT\n-------\n\nMariaDB starting with 10.5.0\n----------------------------\nFrom MariaDB 10.5.0, it is possible to add a comment of a maximum of 1024\nbytes. If the comment length exceeds this length, a error/warning code 4144 is\nthrown. The database comment is also added to the db.opt file, as well as to\nthe information_schema.schemata table.\n\nExamples\n--------\n\nCREATE DATABASE db1;\nQuery OK, 1 row affected (0.18 sec)\n\nCREATE DATABASE db1;\nERROR 1007 (HY000): Can\'t create database \'db1\'; database exists\n\nCREATE OR REPLACE DATABASE db1;\nQuery OK, 2 rows affected (0.00 sec)\n\nCREATE DATABASE IF NOT EXISTS db1;\nQuery OK, 1 row affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+----------------------------------------------+\n| Level | Code | Message |\n+-------+------+----------------------------------------------+\n| Note | 1007 | Can\'t create database \'db1\'; database exists |\n+-------+------+----------------------------------------------+\n\nSetting the character sets and collation. See Setting Character Sets and\nCollations for more details.\n\nCREATE DATABASE czech_slovak_names \n CHARACTER SET = \'keybcs2\'\n COLLATE = \'keybcs2_bin\';\n\nComments, from MariaDB 10.5.0:\n\nCREATE DATABASE presentations COMMENT \'Presentations for conferences\';\n\n\n\nURL: mariadb.com/kb/en/create-database/','','https://mariadb.com/kb/en/create-database/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (652,39,'CREATE EVENT','Syntax\n------\n\nCREATE [OR REPLACE]\n [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n EVENT\n [IF NOT EXISTS]\n event_name\n ON SCHEDULE schedule\n [ON COMPLETION [NOT] PRESERVE]\n [ENABLE | DISABLE | DISABLE ON SLAVE]\n [COMMENT \'comment\']\n DO sql_statement;\n\nschedule:\n AT timestamp [+ INTERVAL interval] ...\n | EVERY interval\n [STARTS timestamp [+ INTERVAL interval] ...]\n [ENDS timestamp [+ INTERVAL interval] ...]\n\ninterval:\n quantity {YEAR | QUARTER | MONTH | DAY | HOUR | MINUTE |\n WEEK | SECOND | YEAR_MONTH | DAY_HOUR | DAY_MINUTE |\n DAY_SECOND | HOUR_MINUTE | HOUR_SECOND | MINUTE_SECOND}\n\nDescription\n-----------\n\nThis statement creates and schedules a new event. It requires the EVENT\nprivilege for the schema in which the event is to be created.\n\nThe minimum requirements for a valid CREATE EVENT statement are as follows:\n\n* The keywords CREATE EVENT plus an event name, which uniquely identifies\n the event in the current schema. (Prior to MySQL 5.1.12, the event name\n needed to be unique only among events created by the same user on a given\n database.)\n* An ON SCHEDULE clause, which determines when and how often the event\n executes.\n* A DO clause, which contains the SQL statement to be executed by an\n event.\n\nHere is an example of a minimal CREATE EVENT statement:\n\nCREATE EVENT myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;\n\nThe previous statement creates an event named myevent. This event executes\nonce — one hour following its creation — by running an SQL statement that\nincrements the value of the myschema.mytable table\'s mycol column by 1.\n\nThe event_name must be a valid MariaDB identifier with a maximum length of 64\ncharacters. It may be delimited using back ticks, and may be qualified with\nthe name of a database schema. An event is associated with both a MariaDB user\n(the definer) and a schema, and its name must be unique among names of events\nwithin that schema. In general, the rules governing event names are the same\nas those for names of stored routines. See Identifier Names.\n\nIf no schema is indicated as part of event_name, the default (current) schema\nis assumed.\n\nFor valid identifiers to use as event names, see Identifier Names.\n\nOR REPLACE\n----------\n\nThe OR REPLACE clause was included in MariaDB 10.1.4. If used and the event\nalready exists, instead of an error being returned, the existing event will be\ndropped and replaced by the newly defined event.\n\nIF NOT EXISTS\n-------------\n\nIf the IF NOT EXISTS clause is used, MariaDB will return a warning instead of\nan error if the event already exists. Cannot be used together with OR REPLACE.\n\nON SCHEDULE\n-----------\n\nThe ON SCHEDULE clause can be used to specify when the event must be triggered.\n\nAT\n--\n\nIf you want to execute the event only once (one time event), you can use the\nAT keyword, followed by a timestamp. If you use CURRENT_TIMESTAMP, the event\nacts as soon as it is created. As a convenience, you can add one or more\nintervals to that timestamp. You can also specify a timestamp in the past, so\nthat the event is stored but not triggered, until you modify it via ALTER\nEVENT.\n\nThe following example shows how to create an event that will be triggered\ntomorrow at a certain time:\n\nCREATE EVENT example\nON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY + INTERVAL 3 HOUR\nDO something;\n\nYou can also specify that an event must be triggered at a regular interval\n(recurring event). In such cases, use the EVERY clause followed by the\ninterval.\n\nIf an event is recurring, you can specify when the first execution must happen\nvia the STARTS clause and a maximum time for the last execution via the ENDS\nclause. STARTS and ENDS clauses are followed by a timestamp and, optionally,\none or more intervals. The ENDS clause can specify a timestamp in the past, so\nthat the event is stored but not executed until you modify it via ALTER EVENT.\n\nIn the following example, next month a recurring event will be triggered\nhourly for a week:\n\nCREATE EVENT example\nON SCHEDULE EVERY 1 HOUR\nSTARTS CURRENT_TIMESTAMP + INTERVAL 1 MONTH\nENDS CURRENT_TIMESTAMP + INTERVAL 1 MONTH + INTERVAL 1 WEEK\nDO some_task;\n\nIntervals consist of a quantity and a time unit. The time units are the same\nused for other staments and time functions, except that you can\'t use\nmicroseconds for events. For simple time units, like HOUR or MINUTE, the\nquantity is an integer number, for example \'10 MINUTE\'. For composite time\nunits, like HOUR_MINUTE or HOUR_SECOND, the quantity must be a string with all\ninvolved simple values and their separators, for example \'2:30\' or \'2:30:30\'.\n\nON COMPLETION [NOT] PRESERVE\n----------------------------\n\nThe ON COMPLETION clause can be used to specify if the event must be deleted\nafter its last execution (that is, after its AT or ENDS timestamp is past). By\ndefault, events are dropped when they are expired. To explicitly state that\nthis is the desired behaviour, you can use ON COMPLETION NOT PRESERVE.\nInstead, if you want the event to be preserved, you can use ON COMPLETION\nPRESERVE.\n\nIn you specify ON COMPLETION NOT PRESERVE, and you specify a timestamp in the\npast for AT or ENDS clause, the event will be immediatly dropped. In such\ncases, you will get a Note 1558: "Event execution time is in the past and ON\nCOMPLETION NOT PRESERVE is set. The event was dropped immediately after\ncreation".\n\nENABLE/DISABLE/DISABLE ON SLAVE\n-------------------------------\n\nEvents are ENABLEd by default. If you want to stop MariaDB from executing an\nevent, you may specify DISABLE. When it is ready to be activated, you may\nenable it using ALTER EVENT. Another option is DISABLE ON SLAVE, which\nindicates that an event was created on a master and has been replicated to the\nslave, which is prevented from executing the event. If DISABLE ON SLAVE is\nspecifically set, the event will not be executed.\n\nCOMMENT\n-------\n\nThe COMMENT clause may be used to set a comment for the event. Maximum length\nfor comments is 64 characters. The comment is a string, so it must be quoted.\nTo see events comments, you can query the INFORMATION_SCHEMA.EVENTS table (the\ncolumn is named EVENT_COMMENT).\n\nExamples\n--------\n\nMinimal CREATE EVENT statement:\n\nCREATE EVENT myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;\n\nAn event that will be triggered tomorrow at a certain time:\n\nCREATE EVENT example\nON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY + INTERVAL 3 HOUR\nDO something;\n\nNext month a recurring event will be triggered hourly for a week:\n\nCREATE EVENT example\nON SCHEDULE EVERY 1 HOUR\nSTARTS CURRENT_TIMESTAMP + INTERVAL 1 MONTH\nENDS CURRENT_TIMESTAMP + INTERVAL 1 MONTH + INTERVAL 1 WEEK\nDO some_task;\n\nOR REPLACE and IF NOT EXISTS:\n\nCREATE EVENT myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;\nERROR 1537 (HY000): Event \'myevent\' already exists\n\nCREATE OR REPLACE EVENT myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;;\nQuery OK, 0 rows affected (0.00 sec)\n\nCREATE EVENT IF NOT EXISTS myevent\n ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR\n DO\n UPDATE myschema.mytable SET mycol = mycol + 1;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+--------------------------------+\n| Level | Code | Message |\n+-------+------+--------------------------------+\n| Note | 1537 | Event \'myevent\' already exists |\n+-------+------+--------------------------------+\n\n\n\nURL: mariadb.com/kb/en/create-event/','','https://mariadb.com/kb/en/create-event/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (653,39,'CREATE FUNCTION','Syntax\n------\n\nCREATE [OR REPLACE]\n [DEFINER = {user | CURRENT_USER | role | CURRENT_ROLE }]\n [AGGREGATE] FUNCTION [IF NOT EXISTS] func_name ([func_parameter[,...]])\n RETURNS type\n [characteristic ...]\n RETURN func_body\nfunc_parameter:\n [ IN | OUT | INOUT | IN OUT ] param_name type\ntype:\n Any valid MariaDB data type\ncharacteristic:\n LANGUAGE SQL\n | [NOT] DETERMINISTIC\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\nfunc_body:\n Valid SQL procedure statement\n\nDescription\n-----------\n\nUse the CREATE FUNCTION statement to create a new stored function. You must\nhave the CREATE ROUTINE database privilege to use CREATE FUNCTION. A function\ntakes any number of arguments and returns a value from the function body. The\nfunction body can be any valid SQL expression as you would use, for example,\nin any select expression. If you have the appropriate privileges, you can call\nthe function exactly as you would any built-in function. See Security below\nfor details on privileges.\n\nYou can also use a variant of the CREATE FUNCTION statement to install a\nuser-defined function (UDF) defined by a plugin. See CREATE FUNCTION (UDF) for\ndetails.\n\nYou can use a SELECT statement for the function body by enclosing it in\nparentheses, exactly as you would to use a subselect for any other expression.\nThe SELECT statement must return a single value. If more than one column is\nreturned when the function is called, error 1241 results. If more than one row\nis returned when the function is called, error 1242 results. Use a LIMIT\nclause to ensure only one row is returned.\n\nYou can also replace the RETURN clause with a BEGIN...END compound statement.\nThe compound statement must contain a RETURN statement. When the function is\ncalled, the RETURN statement immediately returns its result, and any\nstatements after RETURN are effectively ignored.\n\nBy default, a function is associated with the current database. To associate\nthe function explicitly with a given database, specify the fully-qualified\nname as db_name.func_name when you create it. If the function name is the same\nas the name of a built-in function, you must use the fully qualified name when\nyou call it.\n\nThe parameter list enclosed within parentheses must always be present. If\nthere are no parameters, an empty parameter list of () should be used.\nParameter names are not case sensitive.\n\nEach parameter can be declared to use any valid data type, except that the\nCOLLATE attribute cannot be used.\n\nFor valid identifiers to use as function names, see Identifier Names.\n\nIN | OUT | INOUT | IN OUT\n-------------------------\n\nMariaDB starting with 10.8.0\n----------------------------\nThe function parameter qualifiers for IN, OUT, INOUT, and IN OUT were added in\na 10.8.0 preview release. Prior to 10.8.0 quantifiers were supported only in\nprocedures.\n\nOUT, INOUT and its equivalent IN OUT, are only valid if called from SET and\nnot SELECT. These quantifiers are especially useful for creating functions\nwith more than one return value. This allows functions to be more complex and\nnested.\n\nDELIMITER $$\nCREATE FUNCTION add_func3(IN a INT, IN b INT, OUT c INT) RETURNS INT\nBEGIN\n SET c = 100;\n RETURN a + b;\nEND;\n$$\nDELIMITER ;\n\nSET @a = 2;\nSET @b = 3;\nSET @c = 0;\nSET @res= add_func3(@a, @b, @c);\n\nSELECT add_func3(@a, @b, @c);\nERROR 4186 (HY000): OUT or INOUT argument 3 for function add_func3 is not\nallowed here\n\nDELIMITER $$\nCREATE FUNCTION add_func4(IN a INT, IN b INT, d INT) RETURNS INT\nBEGIN\n DECLARE c, res INT;\n SET res = add_func3(a, b, c) + d;\n if (c > 99) then\n return 3;\n else\n return res;\n end if;\nEND;\n$$\n\nDELIMITER ;\n\nSELECT add_func4(1,2,3);\n+------------------+\n| add_func4(1,2,3) |\n+------------------+\n| 3 |\n+------------------+\n\nAGGREGATE\n---------\n\nMariaDB starting with 10.3.3\n----------------------------\nFrom MariaDB 10.3.3, it is possible to create stored aggregate functions as\nwell. See Stored Aggregate Functions for details.\n\nRETURNS\n-------\n\nThe RETURNS clause specifies the return type of the function. NULL values are\npermitted with all return types.\n\nWhat happens if the RETURN clause returns a value of a different type? It\ndepends on the SQL_MODE in effect at the moment of the function creation.\n\nIf the SQL_MODE is strict (STRICT_ALL_TABLES or STRICT_TRANS_TABLES flags are\nspecified), a 1366 error will be produced.\n\nOtherwise, the value is coerced to the proper type. For example, if a function\nspecifies an ENUM or SET value in the RETURNS clause, but the RETURN clause\nreturns an integer, the value returned from the function is the string for the\ncorresponding ENUM member of set of SET members.\n\nMariaDB stores the SQL_MODE system variable setting that is in effect at the\ntime a routine is created, and always executes the routine with this setting\nin force, regardless of the server SQL mode in effect when the routine is\ninvoked.\n\nLANGUAGE SQL\n------------\n\nLANGUAGE SQL is a standard SQL clause, and it can be used in MariaDB for\nportability. However that clause has no meaning, because SQL is the only\nsupported language for stored functions.\n\nA function is deterministic if it can produce only one result for a given list\nof parameters. If the result may be affected by stored data, server variables,\nrandom numbers or any value that is not explicitly passed, then the function\nis not deterministic. Also, a function is non-deterministic if it uses\nnon-deterministic functions like NOW() or CURRENT_TIMESTAMP(). The optimizer\nmay choose a faster execution plan if it known that the function is\ndeterministic. In such cases, you should declare the routine using the\nDETERMINISTIC keyword. If you want to explicitly state that the function is\nnot deterministic (which is the default) you can use the NOT DETERMINISTIC\nkeywords.\n\nIf you declare a non-deterministic function as DETERMINISTIC, you may get\nincorrect results. If you declare a deterministic function as NOT\nDETERMINISTIC, in some cases the queries will be slower.\n\nOR REPLACE\n----------\n\nMariaDB starting with 10.1.3\n----------------------------\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP FUNCTION IF EXISTS function_name;\nCREATE FUNCTION function_name ...;\n\nwith the exception that any existing privileges for the function are not\ndropped.\n\nIF NOT EXISTS\n-------------\n\nMariaDB starting with 10.1.3\n----------------------------\nIf the IF NOT EXISTS clause is used, MariaDB will return a warning instead of\nan error if the function already exists. Cannot be used together with OR\nREPLACE.\n\n[NOT] DETERMINISTIC\n-------------------\n\nThe [NOT] DETERMINISTIC clause also affects binary logging, because the\nSTATEMENT format can not be used to store or replicate non-deterministic\nstatements.\n\nCONTAINS SQL, NO SQL, READS SQL DATA, and MODIFIES SQL DATA are informative\nclauses that tell the server what the function does. MariaDB does not check in\nany way whether the specified clause is correct. If none of these clauses are\nspecified, CONTAINS SQL is used by default.\n\nMODIFIES SQL DATA\n-----------------\n\nMODIFIES SQL DATA means that the function contains statements that may modify\ndata stored in databases. This happens if the function contains statements\nlike DELETE, UPDATE, INSERT, REPLACE or DDL.\n\nREADS SQL DATA\n--------------\n\nREADS SQL DATA means that the function reads data stored in databases, but\ndoes not modify any data. This happens if SELECT statements are used, but\nthere no write operations are executed.\n\nCONTAINS SQL\n------------\n\nCONTAINS SQL means that the function contains at least one SQL statement, but\nit does not read or write any data stored in a database. Examples include SET\nor DO.\n\nNO SQL\n------\n\nNO SQL means nothing, because MariaDB does not currently support any language\nother than SQL.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nFrom MariaDB 10.3, a subset of Oracle\'s PL/SQL language has been supported in\naddition to the traditional SQL/PSM-based MariaDB syntax. See Oracle mode from\nMariaDB 10.3 for details on changes when running Oracle mode.\n\nSecurity\n--------\n\nYou must have the EXECUTE privilege on a function to call it. MariaDB\nautomatically grants the EXECUTE and ALTER ROUTINE privileges to the account\nthat called CREATE FUNCTION, even if the DEFINER clause was used.\n\nEach function has an account associated as the definer. By default, the\ndefiner is the account that created the function. Use the DEFINER clause to\nspecify a different account as the definer. You must have the SUPER privilege,\nor, from MariaDB 10.5.2, the SET USER privilege, to use the DEFINER clause.\nSee Account Names for details on specifying accounts.\n\nThe SQL SECURITY clause specifies what privileges are used when a function is\ncalled. If SQL SECURITY is INVOKER, the function body will be evaluated using\nthe privileges of the user calling the function. If SQL SECURITY is DEFINER,\nthe function body is always evaluated using the privileges of the definer\naccount. DEFINER is the default.\n\nThis allows you to create functions that grant limited access to certain data.\nFor example, say you have a table that stores some employee information, and\nthat you\'ve granted SELECT privileges only on certain columns to the user\naccount roger.\n\nCREATE TABLE employees (name TINYTEXT, dept TINYTEXT, salary INT);\nGRANT SELECT (name, dept) ON employees TO roger;\n\nTo allow the user the get the maximum salary for a department, define a\nfunction and grant the EXECUTE privilege:\n\nCREATE FUNCTION max_salary (dept TINYTEXT) RETURNS INT RETURN\n (SELECT MAX(salary) FROM employees WHERE employees.dept = dept);\nGRANT EXECUTE ON FUNCTION max_salary TO roger;\n\nSince SQL SECURITY defaults to DEFINER, whenever the user roger calls this\nfunction, the subselect will execute with your privileges. As long as you have\nprivileges to select the salary of each employee, the caller of the function\nwill be able to get the maximum salary for each department without being able\nto see individual salaries.\n\nCharacter sets and collations\n-----------------------------\n\nFunction return types can be declared to use any valid character set and\ncollation. If used, the COLLATE attribute needs to be preceded by a CHARACTER\nSET attribute.\n\nIf the character set and collation are not specifically set in the statement,\nthe database defaults at the time of creation will be used. If the database\ndefaults change at a later stage, the stored function character set/collation\nwill not be changed at the same time; the stored function needs to be dropped\nand recreated to ensure the same character set/collation as the database is\nused.\n\nExamples\n--------\n\nThe following example function takes a parameter, performs an operation using\nan SQL function, and returns the result.\n\nCREATE FUNCTION hello (s CHAR(20))\n RETURNS CHAR(50) DETERMINISTIC\n RETURN CONCAT(\'Hello, \',s,\'!\');\n\nSELECT hello(\'world\');\n+----------------+\n| hello(\'world\') |\n+----------------+\n| Hello, world! |\n+----------------+\n\nYou can use a compound statement in a function to manipulate data with\nstatements like INSERT and UPDATE. The following example creates a counter\nfunction that uses a temporary table to store the current value. Because the\ncompound statement contains statements terminated with semicolons, you have to\nfirst change the statement delimiter with the DELIMITER statement to allow the\nsemicolon to be used in the function body. See Delimiters in the mysql client\nfor more.\n\nCREATE TEMPORARY TABLE counter (c INT);\nINSERT INTO counter VALUES (0);\nDELIMITER //\nCREATE FUNCTION counter () RETURNS INT\n BEGIN\n UPDATE counter SET c = c + 1;\n RETURN (SELECT c FROM counter LIMIT 1);\n END //\nDELIMITER ;\n\nCharacter set and collation:\n\nCREATE FUNCTION hello2 (s CHAR(20))\n RETURNS CHAR(50) CHARACTER SET \'utf8\' COLLATE \'utf8_bin\' DETERMINISTIC\n RETURN CONCAT(\'Hello, \',s,\'!\');\n\n\n\nURL: mariadb.com/kb/en/create-function/','','https://mariadb.com/kb/en/create-function/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (654,39,'CREATE INDEX','Syntax\n------\n\nCREATE [OR REPLACE] [UNIQUE|FULLTEXT|SPATIAL] INDEX \n [IF NOT EXISTS] index_name\n [index_type]\n ON tbl_name (index_col_name,...)\n [WAIT n | NOWAIT]\n [index_option]\n [algorithm_option | lock_option] ...\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH | RTREE}\n\nindex_option:\n [ KEY_BLOCK_SIZE [=] value\n | index_type\n | WITH PARSER parser_name\n | COMMENT \'string\'\n | CLUSTERING={YES| NO} ]\n [ IGNORED | NOT IGNORED ]\n\nalgorithm_option:\n ALGORITHM [=] {DEFAULT|INPLACE|COPY|NOCOPY|INSTANT}\n\nlock_option:\n LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}\n\nDescription\n-----------\n\nCREATE INDEX is mapped to an ALTER TABLE statement to create indexes. See\nALTER TABLE. CREATE INDEX cannot be used to create a PRIMARY KEY; use ALTER\nTABLE instead.\n\nIf another connection is using the table, a metadata lock is active, and this\nstatement will wait until the lock is released. This is also true for\nnon-transactional tables.\n\nAnother shortcut, DROP INDEX, allows the removal of an index.\n\nFor valid identifiers to use as index names, see Identifier Names.\n\nNote that KEY_BLOCK_SIZE is currently ignored in CREATE INDEX, although it is\nincluded in the output of SHOW CREATE TABLE.\n\nPrivileges\n----------\n\nExecuting the CREATE INDEX statement requires the INDEX privilege for the\ntable or the database.\n\nOnline DDL\n----------\n\nOnline DDL is supported with the ALGORITHM and LOCK clauses.\n\nSee InnoDB Online DDL Overview for more information on online DDL with InnoDB.\n\nCREATE OR REPLACE INDEX\n-----------------------\n\nMariaDB starting with 10.1.4\n----------------------------\nThe OR REPLACE clause was added in MariaDB 10.1.4.\n\nIf the OR REPLACE clause is used and if the index already exists, then instead\nof returning an error, the server will drop the existing index and replace it\nwith the newly defined index.\n\nCREATE INDEX IF NOT EXISTS\n--------------------------\n\nIf the IF NOT EXISTS clause is used, then the index will only be created if an\nindex with the same name does not already exist. If the index already exists,\nthen a warning will be triggered by default.\n\nIndex Definitions\n-----------------\n\nSee CREATE TABLE: Index Definitions for information about index definitions.\n\nWAIT/NOWAIT\n-----------\n\nMariaDB starting with 10.3.0\n----------------------------\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nALGORITHM\n---------\n\nSee ALTER TABLE: ALGORITHM for more information.\n\nLOCK\n----\n\nSee ALTER TABLE: LOCK for more information.\n\nProgress Reporting\n------------------\n\nMariaDB provides progress reporting for CREATE INDEX statement for clients\nthat support the new progress reporting protocol. For example, if you were\nusing the mysql client, then the progress report might look like this::\n\nCREATE INDEX ON tab (num);;\nStage: 1 of 2 \'copy to tmp table\' 46% of stage\n\nThe progress report is also shown in the output of the SHOW PROCESSLIST\nstatement and in the contents of the information_schema.PROCESSLIST table.\n\nSee Progress Reporting for more information.\n\nWITHOUT OVERLAPS\n----------------\n\nMariaDB starting with 10.5.3\n----------------------------\nThe WITHOUT OVERLAPS clause allows one to constrain a primary or unique index\nsuch that application-time periods cannot overlap.\n\nExamples\n--------\n\nCreating a unique index:\n\nCREATE UNIQUE INDEX HomePhone ON Employees(Home_Phone);\n\nOR REPLACE and IF NOT EXISTS:\n\nCREATE INDEX xi ON xx5 (x);\nQuery OK, 0 rows affected (0.03 sec)\n\nCREATE INDEX xi ON xx5 (x);\nERROR 1061 (42000): Duplicate key name \'xi\'\n\nCREATE OR REPLACE INDEX xi ON xx5 (x);\nQuery OK, 0 rows affected (0.03 sec)\n\nCREATE INDEX IF NOT EXISTS xi ON xx5 (x);\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+-------------------------+\n| Level | Code | Message |\n+-------+------+-------------------------+\n| Note | 1061 | Duplicate key name \'xi\' |\n+-------+------+-------------------------+\n\nFrom MariaDB 10.5.3, creating a unique index for an application-time period\ntable with a WITHOUT OVERLAPS constraint:\n\nCREATE UNIQUE INDEX u ON rooms (room_number, p WITHOUT OVERLAPS);\n\n\n\nURL: mariadb.com/kb/en/create-index/','','https://mariadb.com/kb/en/create-index/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (655,39,'CREATE PACKAGE','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nCREATE\n [ OR REPLACE]\n [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n PACKAGE [ IF NOT EXISTS ]\n [ db_name . ] package_name\n [ package_characteristic ... ]\n{ AS | IS }\n [ package_specification_element ... ]\nEND [ package_name ]\n\npackage_characteristic:\n COMMENT \'string\'\n | SQL SECURITY { DEFINER | INVOKER }\n\npackage_specification_element:\n FUNCTION_SYM package_specification_function ;\n | PROCEDURE_SYM package_specification_procedure ;\n\npackage_specification_function:\n func_name [ ( func_param [, func_param]... ) ]\n RETURNS func_return_type\n [ package_routine_characteristic... ]\n\npackage_specification_procedure:\n proc_name [ ( proc_param [, proc_param]... ) ]\n [ package_routine_characteristic... ]\n\nfunc_return_type:\n type\n\nfunc_param:\n param_name [ IN | OUT | INOUT | IN OUT ] type\n\nproc_param:\n param_name [ IN | OUT | INOUT | IN OUT ] type\n\ntype:\n Any valid MariaDB explicit or anchored data type\n\npackage_routine_characteristic:\n COMMENT \'string\'\n | LANGUAGE SQL\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n\nDescription\n-----------\n\nThe CREATE PACKAGE statement can be used when Oracle SQL_MODE is set.\n\nThe CREATE PACKAGE creates the specification for a stored package (a\ncollection of logically related stored objects). A stored package\nspecification declares public routines (procedures and functions) of the\npackage, but does not implement these routines.\n\nA package whose specification was created by the CREATE PACKAGE statement,\nshould later be implemented using the CREATE PACKAGE BODY statement.\n\nFunction parameter quantifiers IN | OUT | INOUT | IN OUT\n--------------------------------------------------------\n\nMariaDB starting with 10.8.0\n----------------------------\nThe function parameter quantifiers for IN, OUT, INOUT, and IN OUT where added\nin a 10.8.0 preview release. Prior to 10.8.0 quantifiers were supported only\nin procedures.\n\nOUT, INOUT and its equivalent IN OUT, are only valid if called from SET and\nnot SELECT. These quantifiers are especially useful for creating functions and\nprocedures with more than one return value. This allows functions and\nprocedures to be more complex and nested.\n\nExamples\n--------\n\nSET sql_mode=ORACLE;\nDELIMITER $$\nCREATE OR REPLACE PACKAGE employee_tools AS\n FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);\n PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));\n PROCEDURE raiseSalaryStd(eid INT);\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));\nEND;\n$$\nDELIMITER ;\n\n\n\nURL: mariadb.com/kb/en/create-package/','','https://mariadb.com/kb/en/create-package/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (656,39,'CREATE PACKAGE BODY','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nCREATE [ OR REPLACE ]\n [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n PACKAGE BODY\n [ IF NOT EXISTS ]\n [ db_name . ] package_name\n [ package_characteristic... ]\n{ AS | IS }\n package_implementation_declare_section\n package_implementation_executable_section\nEND [ package_name]\n\npackage_implementation_declare_section:\n package_implementation_item_declaration\n [ package_implementation_item_declaration... ]\n [ package_implementation_routine_definition... ]\n | package_implementation_routine_definition\n [ package_implementation_routine_definition...]\n\npackage_implementation_item_declaration:\n variable_declaration ;\n\nvariable_declaration:\n variable_name[,...] type [:= expr ]\n\npackage_implementation_routine_definition:\n FUNCTION package_specification_function\n [ package_implementation_function_body ] ;\n | PROCEDURE package_specification_procedure\n [ package_implementation_procedure_body ] ;\n\npackage_implementation_function_body:\n { AS | IS } package_routine_body [func_name]\n\npackage_implementation_procedure_body:\n { AS | IS } package_routine_body [proc_name]\n\npackage_routine_body:\n [ package_routine_declarations ]\n BEGIN\n statements [ EXCEPTION exception_handlers ]\n END\n\npackage_routine_declarations:\n package_routine_declaration \';\' [package_routine_declaration \';\']...\n\npackage_routine_declaration:\n variable_declaration\n | condition_name CONDITION FOR condition_value\n | user_exception_name EXCEPTION\n | CURSOR_SYM cursor_name\n [ ( cursor_formal_parameters ) ]\n IS select_statement\n ;\n\npackage_implementation_executable_section:\n END\n | BEGIN\n statement ; [statement ; ]...\n [EXCEPTION exception_handlers]\n END\n\nexception_handlers:\n exception_handler [exception_handler...]\n\nexception_handler:\n WHEN_SYM condition_value [, condition_value]...\n THEN_SYM statement ; [statement ;]...\n\ncondition_value:\n condition_name\n | user_exception_name\n | SQLWARNING\n | SQLEXCEPTION\n | NOT FOUND\n | OTHERS_SYM\n | SQLSTATE [VALUE] sqlstate_value\n | mariadb_error_code\n\nDescription\n-----------\n\nThe CREATE PACKAGE BODY statement can be used when Oracle SQL_MODE is set.\n\nThe CREATE PACKAGE BODY statement creates the package body for a stored\npackage. The package specification must be previously created using the CREATE\nPACKAGE statement.\n\nA package body provides implementations of the package public routines and can\noptionally have:\n\n* package-wide private variables\n* package private routines\n* forward declarations for private routines\n* an executable initialization section\n\nExamples\n--------\n\nSET sql_mode=ORACLE;\nDELIMITER $$\nCREATE OR REPLACE PACKAGE employee_tools AS\n FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);\n PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));\n PROCEDURE raiseSalaryStd(eid INT);\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));\nEND;\n$$\nCREATE PACKAGE BODY employee_tools AS\n -- package body variables\n stdRaiseAmount DECIMAL(10,2):=500;\n\n-- private routines\n PROCEDURE log (eid INT, ecmnt TEXT) AS\n BEGIN\n INSERT INTO employee_log (id, cmnt) VALUES (eid, ecmnt);\n END;\n\n-- public routines\n PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2)) AS\n eid INT;\n BEGIN\n INSERT INTO employee (name, salary) VALUES (ename, esalary);\n eid:= last_insert_id();\n log(eid, \'hire \' || ename);\n END;\n\nFUNCTION getSalary(eid INT) RETURN DECIMAL(10,2) AS\n nSalary DECIMAL(10,2);\n BEGIN\n SELECT salary INTO nSalary FROM employee WHERE id=eid;\n log(eid, \'getSalary id=\' || eid || \' salary=\' || nSalary);\n RETURN nSalary;\n END;\n\nPROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2)) AS\n BEGIN\n UPDATE employee SET salary=salary+amount WHERE id=eid;\n log(eid, \'raiseSalary id=\' || eid || \' amount=\' || amount);\n END;\n\nPROCEDURE raiseSalaryStd(eid INT) AS\n BEGIN\n raiseSalary(eid, stdRaiseAmount);\n log(eid, \'raiseSalaryStd id=\' || eid);\n END;\n\nBEGIN\n -- This code is executed when the current session\n -- accesses any of the package routines for the first time\n log(0, \'Session \' || connection_id() || \' \' || current_user || \' started\');\nEND;\n$$\n\nDELIMITER ;\n\n\n\nURL: mariadb.com/kb/en/create-package-body/','','https://mariadb.com/kb/en/create-package-body/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (657,39,'CREATE PROCEDURE','Syntax\n------\n\nCREATE\n [OR REPLACE]\n [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n PROCEDURE sp_name ([proc_parameter[,...]])\n [characteristic ...] routine_body\n\nproc_parameter:\n [ IN | OUT | INOUT ] param_name type\n\ntype:\n Any valid MariaDB data type\n\ncharacteristic:\n LANGUAGE SQL\n | [NOT] DETERMINISTIC\n | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }\n | SQL SECURITY { DEFINER | INVOKER }\n | COMMENT \'string\'\n\nroutine_body:\n Valid SQL procedure statement\n\nDescription\n-----------\n\nCreates a stored procedure. By default, a routine is associated with the\ndefault database. To associate the routine explicitly with a given database,\nspecify the name as db_name.sp_name when you create it.\n\nWhen the routine is invoked, an implicit USE db_name is performed (and undone\nwhen the routine terminates). The causes the routine to have the given default\ndatabase while it executes. USE statements within stored routines are\ndisallowed.\n\nWhen a stored procedure has been created, you invoke it by using the CALL\nstatement (see CALL).\n\nTo execute the CREATE PROCEDURE statement, it is necessary to have the CREATE\nROUTINE privilege. By default, MariaDB automatically grants the ALTER ROUTINE\nand EXECUTE privileges to the routine creator. See also Stored Routine\nPrivileges.\n\nThe DEFINER and SQL SECURITY clauses specify the security context to be used\nwhen checking access privileges at routine execution time, as described later.\nRequires the SUPER privilege, or, from MariaDB 10.5.2, the SET USER privilege.\n\nIf the routine name is the same as the name of a built-in SQL function, you\nmust use a space between the name and the following parenthesis when defining\nthe routine, or a syntax error occurs. This is also true when you invoke the\nroutine later. For this reason, we suggest that it is better to avoid re-using\nthe names of existing SQL functions for your own stored routines.\n\nThe IGNORE_SPACE SQL mode applies to built-in functions, not to stored\nroutines. It is always allowable to have spaces after a routine name,\nregardless of whether IGNORE_SPACE is enabled.\n\nThe parameter list enclosed within parentheses must always be present. If\nthere are no parameters, an empty parameter list of () should be used.\nParameter names are not case sensitive.\n\nEach parameter can be declared to use any valid data type, except that the\nCOLLATE attribute cannot be used.\n\nFor valid identifiers to use as procedure names, see Identifier Names.\n\nIN/OUT/INOUT\n------------\n\nEach parameter is an IN parameter by default. To specify otherwise for a\nparameter, use the keyword OUT or INOUT before the parameter name.\n\nAn IN parameter passes a value into a procedure. The procedure might modify\nthe value, but the modification is not visible to the caller when the\nprocedure returns. An OUT parameter passes a value from the procedure back to\nthe caller. Its initial value is NULL within the procedure, and its value is\nvisible to the caller when the procedure returns. An INOUT parameter is\ninitialized by the caller, can be modified by the procedure, and any change\nmade by the procedure is visible to the caller when the procedure returns.\n\nFor each OUT or INOUT parameter, pass a user-defined variable in the CALL\nstatement that invokes the procedure so that you can obtain its value when the\nprocedure returns. If you are calling the procedure from within another stored\nprocedure or function, you can also pass a routine parameter or local routine\nvariable as an IN or INOUT parameter.\n\nDETERMINISTIC/NOT DETERMINISTIC\n-------------------------------\n\nDETERMINISTIC and NOT DETERMINISTIC apply only to functions. Specifying\nDETERMINISTC or NON-DETERMINISTIC in procedures has no effect. The default\nvalue is NOT DETERMINISTIC. Functions are DETERMINISTIC when they always\nreturn the same value for the same input. For example, a truncate or substring\nfunction. Any function involving data, therefore, is always NOT DETERMINISTIC.\n\nCONTAINS SQL/NO SQL/READS SQL DATA/MODIFIES SQL DATA\n----------------------------------------------------\n\nCONTAINS SQL, NO SQL, READS SQL DATA, and MODIFIES SQL DATA are informative\nclauses that tell the server what the function does. MariaDB does not check in\nany way whether the specified clause is correct. If none of these clauses are\nspecified, CONTAINS SQL is used by default.\n\nMODIFIES SQL DATA means that the function contains statements that may modify\ndata stored in databases. This happens if the function contains statements\nlike DELETE, UPDATE, INSERT, REPLACE or DDL.\n\nREADS SQL DATA means that the function reads data stored in databases, but\ndoes not modify any data. This happens if SELECT statements are used, but\nthere no write operations are executed.\n\nCONTAINS SQL means that the function contains at least one SQL statement, but\nit does not read or write any data stored in a database. Examples include SET\nor DO.\n\nNO SQL means nothing, because MariaDB does not currently support any language\nother than SQL.\n\nThe routine_body consists of a valid SQL procedure statement. This can be a\nsimple statement such as SELECT or INSERT, or it can be a compound statement\nwritten using BEGIN and END. Compound statements can contain declarations,\nloops, and other control structure statements. See Programmatic and Compound\nStatements for syntax details.\n\nMariaDB allows routines to contain DDL statements, such as CREATE and DROP.\nMariaDB also allows stored procedures (but not stored functions) to contain\nSQL transaction statements such as COMMIT.\n\nFor additional information about statements that are not allowed in stored\nroutines, see Stored Routine Limitations.\n\nInvoking stored procedure from within programs\n----------------------------------------------\n\nFor information about invoking stored procedures from within programs written\nin a language that has a MariaDB/MySQL interface, see CALL.\n\nOR REPLACE\n----------\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP PROCEDURE IF EXISTS name;\nCREATE PROCEDURE name ...;\n\nwith the exception that any existing privileges for the procedure are not\ndropped.\n\nsql_mode\n--------\n\nMariaDB stores the sql_mode system variable setting that is in effect at the\ntime a routine is created, and always executes the routine with this setting\nin force, regardless of the server SQL mode in effect when the routine is\ninvoked.\n\nCharacter Sets and Collations\n-----------------------------\n\nProcedure parameters can be declared with any character set/collation. If the\ncharacter set and collation are not specifically set, the database defaults at\nthe time of creation will be used. If the database defaults change at a later\nstage, the stored procedure character set/collation will not be changed at the\nsame time; the stored procedure needs to be dropped and recreated to ensure\nthe same character set/collation as the database is used.\n\nOracle Mode\n-----------\n\nMariaDB starting with 10.3\n--------------------------\nFrom MariaDB 10.3, a subset of Oracle\'s PL/SQL language has been supported in\naddition to the traditional SQL/PSM-based MariaDB syntax. See Oracle mode from\nMariaDB 10.3 for details on changes when running Oracle mode.\n\nExamples\n--------\n\nThe following example shows a simple stored procedure that uses an OUT\nparameter. It uses the DELIMITER command to set a new delimiter for the\nduration of the process — see Delimiters in the mysql client.\n\nDELIMITER //\n\nCREATE PROCEDURE simpleproc (OUT param1 INT)\n BEGIN\n SELECT COUNT(*) INTO param1 FROM t;\n END;\n//\n\nDELIMITER ;\n\nCALL simpleproc(@a);\n\nSELECT @a;\n+------+\n| @a |\n+------+\n| 1 |\n+------+\n\nCharacter set and collation:\n\nDELIMITER //\n\nCREATE PROCEDURE simpleproc2 (\n OUT param1 CHAR(10) CHARACTER SET \'utf8\' COLLATE \'utf8_bin\'\n)\n BEGIN\n SELECT CONCAT(\'a\'),f1 INTO param1 FROM t;\n END;\n//\n\nDELIMITER ;\n\nCREATE OR REPLACE:\n\nDELIMITER //\n\nCREATE PROCEDURE simpleproc2 (\n OUT param1 CHAR(10) CHARACTER SET \'utf8\' COLLATE \'utf8_bin\'\n)\n BEGIN\n SELECT CONCAT(\'a\'),f1 INTO param1 FROM t;\n END;\n//\nERROR 1304 (42000): PROCEDURE simpleproc2 already exists\n\nDELIMITER ;\n\nDELIMITER //\n\nCREATE OR REPLACE PROCEDURE simpleproc2 (\n OUT param1 CHAR(10) CHARACTER SET \'utf8\' COLLATE \'utf8_bin\'\n)\n BEGIN\n SELECT CONCAT(\'a\'),f1 INTO param1 FROM t;\n END;\n//\nERROR 1304 (42000): PROCEDURE simpleproc2 already exists\n\nDELIMITER ;\nQuery OK, 0 rows affected (0.03 sec)\n\n\n\nURL: mariadb.com/kb/en/create-procedure/','','https://mariadb.com/kb/en/create-procedure/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (658,39,'CREATE SEQUENCE','MariaDB starting with 10.3\n--------------------------\nCREATE SEQUENCE was introduced in MariaDB 10.3.\n\nSyntax\n------\n\nCREATE [OR REPLACE] [TEMPORARY] SEQUENCE [IF NOT EXISTS] sequence_name\n[ INCREMENT [ BY | = ] increment ]\n[ MINVALUE [=] minvalue | NO MINVALUE | NOMINVALUE ]\n[ MAXVALUE [=] maxvalue | NO MAXVALUE | NOMAXVALUE ]\n[ START [ WITH | = ] start ] \n[ CACHE [=] cache | NOCACHE ] [ CYCLE | NOCYCLE] \n[table_options]\nThe options for CREATE SEQUENCE can be given in any order, optionally followed\nby table_options.\n\ntable_options can be any of the normal table options in CREATE TABLE but the\nmost usable ones are ENGINE=... and COMMENT=.\n\nNOMAXVALUE and NOMINVALUE are there to allow one to create SEQUENCEs using the\nOracle syntax.\n\nDescription\n-----------\n\nCREATE SEQUENCE will create a sequence that generates new values when called\nwith NEXT VALUE FOR sequence_name. It\'s an alternative to AUTO INCREMENT when\none wants to have more control of how the numbers are generated. As the\nSEQUENCE caches values (up to CACHE) it can in some cases be much faster than\nAUTO INCREMENT. Another benefit is that one can access the last value\ngenerated by all used sequences, which solves one of the limitations with\nLAST_INSERT_ID().\n\nCREATE SEQUENCE requires the CREATE privilege.\n\nDROP SEQUENCE can be used to drop a sequence, and ALTER SEQUENCE to change it.\n\nArguments to Create\n-------------------\n\nThe following options may be used:\n\n+---------------+-------------------------------+-----------------------------+\n| Option | Default value | Description |\n+---------------+-------------------------------+-----------------------------+\n| INCREMENT | 1 | Increment to use for |\n| | | values. May be negative. |\n| | | Setting an increment of 0 |\n| | | causes the sequence to use |\n| | | the value of the |\n| | | auto_increment_increment |\n| | | system variable at the |\n| | | time of creation, which is |\n| | | always a positive number. |\n| | | (see MDEV-16035). |\n+---------------+-------------------------------+-----------------------------+\n| MINVALUE | 1 if INCREMENT > 0 and | Minimum value for the |\n| | -9223372036854775807 if | sequence |\n| | INCREMENT < 0 | |\n+---------------+-------------------------------+-----------------------------+\n| MAXVALUE | 9223372036854775806 if | Max value for sequence |\n| | INCREMENT > 0 and -1 if | |\n| | INCREMENT < 0 | |\n+---------------+-------------------------------+-----------------------------+\n| START | MINVALUE if INCREMENT > 0 | First value that the |\n| | and MAX_VALUE if INCREMENT< 0 | sequence will generate |\n+---------------+-------------------------------+-----------------------------+\n| CACHE | 1000 | Number of values that |\n| | | should be cached. 0 if no |\n| | | CACHE. The underlying |\n| | | table will be updated |\n| | | first time a new sequence |\n| | | number is generated and |\n| | | each time the cache runs |\n| | | out. |\n+---------------+-------------------------------+-----------------------------+\n\nIf CYCLE is used then the sequence should start again from MINVALUE after it\nhas run out of values. Default value is NOCYCLE.\n\nConstraints on Create Arguments\n-------------------------------\n\nTo be able to create a legal sequence, the following must hold:\n\n* MAXVALUE >= start\n* MAXVALUE > MINVALUE\n* START >= MINVALUE\n* MAXVALUE <= 9223372036854775806 (LONGLONG_MAX-1)\n* MINVALUE >= -9223372036854775807 (LONGLONG_MIN+1)\n\nNote that sequences can\'t generate the maximum/minimum 64 bit number because\nof the constraint of MINVALUE and MAXVALUE.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL and CREATE SEQUENCE is atomic.\n\nExamples\n--------\n\nCREATE SEQUENCE s START WITH 100 INCREMENT BY 10;\n\nCREATE SEQUENCE s2 START WITH -100 INCREMENT BY -10;\n\nThe following statement fails, as the increment conflicts with the defaults\n\nCREATE SEQUENCE s3 START WITH -100 INCREMENT BY 10;\nERROR 4082 (HY000): Sequence \'test.s3\' values are conflicting\n\nThe sequence can be created by specifying workable minimum and maximum values:\n\nCREATE SEQUENCE s3 START WITH -100 INCREMENT BY 10 MINVALUE=-100 MAXVALUE=1000;\n\n\n\nURL: mariadb.com/kb/en/create-sequence/','','https://mariadb.com/kb/en/create-sequence/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (659,39,'CREATE SERVER','Syntax\n------\n\nCREATE [OR REPLACE] SERVER [IF NOT EXISTS] server_name\n FOREIGN DATA WRAPPER wrapper_name\n OPTIONS (option [, option] ...)\n\noption:\n { HOST character-literal\n | DATABASE character-literal\n | USER character-literal\n | PASSWORD character-literal\n | SOCKET character-literal\n | OWNER character-literal\n | PORT numeric-literal }\n\nDescription\n-----------\n\nThis statement creates the definition of a server for use with the Spider,\nConnect, FEDERATED or FederatedX storage engine. The CREATE SERVER statement\ncreates a new row within the servers table within the mysql database. This\nstatement requires the SUPER privilege or, from MariaDB 10.5.2, the FEDERATED\nADMIN privilege.\n\nThe server_name should be a unique reference to the server. Server definitions\nare global within the scope of the server, it is not possible to qualify the\nserver definition to a specific database. server_name has a maximum length of\n64 characters (names longer than 64 characters are silently truncated), and is\ncase insensitive. You may specify the name as a quoted string.\n\nThe wrapper_name may be quoted with single quotes. Supported values are:\n\n* mysql\n* mariadb (in MariaDB 10.3 and later)\n\nFor each option you must specify either a character literal or numeric\nliteral. Character literals are UTF-8, support a maximum length of 64\ncharacters and default to a blank (empty) string. String literals are silently\ntruncated to 64 characters. Numeric literals must be a number between 0 and\n9999, default value is 0.\n\nNote: The OWNER option is currently not applied, and has no effect on the\nownership or operation of the server connection that is created.\n\nThe CREATE SERVER statement creates an entry in the mysql.servers table that\ncan later be used with the CREATE TABLE statement when creating a Spider,\nConnect, FederatedX or FEDERATED table. The options that you specify will be\nused to populate the columns in the mysql.servers table. The table columns are\nServer_name, Host, Db, Username, Password, Port and Socket.\n\nDROP SERVER removes a previously created server definition.\n\nCREATE SERVER is not written to the binary log, irrespective of the binary log\nformat being used. From MariaDB 10.1.13, Galera replicates the CREATE SERVER,\nALTER SERVER and DROP SERVER statements.\n\nFor valid identifiers to use as server names, see Identifier Names.\n\nOR REPLACE\n----------\n\nIf the optional OR REPLACE clause is used, it acts as a shortcut for:\n\nDROP SERVER IF EXISTS name;\nCREATE SERVER server_name ...;\n\nIF NOT EXISTS\n-------------\n\nIf the IF NOT EXISTS clause is used, MariaDB will return a warning instead of\nan error if the server already exists. Cannot be used together with OR REPLACE.\n\nExamples\n--------\n\nCREATE SERVER s\nFOREIGN DATA WRAPPER mysql\nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\n\nOR REPLACE and IF NOT EXISTS:\n\nCREATE SERVER s \nFOREIGN DATA WRAPPER mysql \nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\nERROR 1476 (HY000): The foreign server, s, you are trying to create already\nexists\n\nCREATE OR REPLACE SERVER s \nFOREIGN DATA WRAPPER mysql \nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\nQuery OK, 0 rows affected (0.00 sec)\n\nCREATE SERVER IF NOT EXISTS s \nFOREIGN DATA WRAPPER mysql \nOPTIONS (USER \'Remote\', HOST \'192.168.1.106\', DATABASE \'test\');\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+---------------------------------------------------------------\n+\n| Level | Code | Message \n |\n+-------+------+---------------------------------------------------------------\n+\n| Note | 1476 | The foreign server, s, you are trying to create already\nexists |\n+-------+------+---------------------------------------------------------------\n+\n\n\n\nURL: mariadb.com/kb/en/create-server/','','https://mariadb.com/kb/en/create-server/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (660,39,'CREATE TABLE','Syntax\n------\n\nCREATE [OR REPLACE] [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n (create_definition,...) [table_options ]... [partition_options]\nCREATE [OR REPLACE] [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n [(create_definition,...)] [table_options ]... [partition_options]\n select_statement\nCREATE [OR REPLACE] [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name\n { LIKE old_table_name | (LIKE old_table_name) }\nselect_statement:\n [IGNORE | REPLACE] [AS] SELECT ... (Some legal select statement)\n\nDescription\n-----------\n\nUse the CREATE TABLE statement to create a table with the given name.\n\nIn its most basic form, the CREATE TABLE statement provides a table name\nfollowed by a list of columns, indexes, and constraints. By default, the table\nis created in the default database. Specify a database with db_name.tbl_name.\nIf you quote the table name, you must quote the database name and table name\nseparately as `db_name`.`tbl_name`. This is particularly useful for CREATE\nTABLE ... SELECT, because it allows to create a table into a database, which\ncontains data from other databases. See Identifier Qualifiers.\n\nIf a table with the same name exists, error 1050 results. Use IF NOT EXISTS to\nsuppress this error and issue a note instead. Use SHOW WARNINGS to see notes.\n\nThe CREATE TABLE statement automatically commits the current transaction,\nexcept when using the TEMPORARY keyword.\n\nFor valid identifiers to use as table names, see Identifier Names.\n\nNote: if the default_storage_engine is set to ColumnStore then it needs\nsetting on all UMs. Otherwise when the tables using the default engine are\nreplicated across UMs they will use the wrong engine. You should therefore not\nuse this option as a session variable with ColumnStore.\n\nMicrosecond precision can be between 0-6. If no precision is specified it is\nassumed to be 0, for backward compatibility reasons.\n\nPrivileges\n----------\n\nExecuting the CREATE TABLE statement requires the CREATE privilege for the\ntable or the database.\n\nCREATE OR REPLACE\n-----------------\n\nIf the OR REPLACE clause is used and the table already exists, then instead of\nreturning an error, the server will drop the existing table and replace it\nwith the newly defined table.\n\nThis syntax was originally added to make replication more robust if it has to\nrollback and repeat statements such as CREATE ... SELECT on replicas.\n\nCREATE OR REPLACE TABLE table_name (a int);\n\nis basically the same as:\n\nDROP TABLE IF EXISTS table_name;\nCREATE TABLE table_name (a int);\n\nwith the following exceptions:\n\n* If table_name was locked with LOCK TABLES it will continue to be locked\nafter the statement.\n* Temporary tables are only dropped if the TEMPORARY keyword was used. (With\nDROP TABLE, temporary tables are preferred to be dropped before normal\ntables).\n\nThings to be Aware of With CREATE OR REPLACE\n--------------------------------------------\n\n* The table is dropped first (if it existed), after that the CREATE is done.\nBecause of this, if the CREATE fails, then the table will not exist anymore\nafter the statement. If the table was used with LOCK TABLES it will be\nunlocked.\n* One can\'t use OR REPLACE together with IF EXISTS.\n* Slaves in replication will by default use CREATE OR REPLACE when replicating\nCREATE statements that don\'\'t use IF EXISTS. This can be changed by setting\nthe variable slave-ddl-exec-mode to STRICT.\n\nCREATE TABLE IF NOT EXISTS\n--------------------------\n\nIf the IF NOT EXISTS clause is used, then the table will only be created if a\ntable with the same name does not already exist. If the table already exists,\nthen a warning will be triggered by default.\n\nCREATE TEMPORARY TABLE\n----------------------\n\nUse the TEMPORARY keyword to create a temporary table that is only available\nto the current session. Temporary tables are dropped when the session ends.\nTemporary table names are specific to the session. They will not conflict with\nother temporary tables from other sessions even if they share the same name.\nThey will shadow names of non-temporary tables or views, if they are\nidentical. A temporary table can have the same name as a non-temporary table\nwhich is located in the same database. In that case, their name will reference\nthe temporary table when used in SQL statements. You must have the CREATE\nTEMPORARY TABLES privilege on the database to create temporary tables. If no\nstorage engine is specified, the default_tmp_storage_engine setting will\ndetermine the engine.\n\nROCKSDB temporary tables cannot be created by setting the\ndefault_tmp_storage_engine system variable, or using CREATE TEMPORARY TABLE\nLIKE. Before MariaDB 10.7, they could be specified, but would silently fail,\nand a MyISAM table would be created instead. From MariaDB 10.7 an error is\nreturned. Explicitly creating a temporary table with ENGINE=ROCKSDB has never\nbeen permitted.\n\nCREATE TABLE ... LIKE\n---------------------\n\nUse the LIKE clause instead of a full table definition to create a table with\nthe same definition as another table, including columns, indexes, and table\noptions. Foreign key definitions, as well as any DATA DIRECTORY or INDEX\nDIRECTORY table options specified on the original table, will not be created.\n\nCREATE TABLE ... SELECT\n-----------------------\n\nYou can create a table containing data from other tables using the CREATE ...\nSELECT statement. Columns will be created in the table for each field returned\nby the SELECT query.\n\nYou can also define some columns normally and add other columns from a SELECT.\nYou can also create columns in the normal way and assign them some values\nusing the query, this is done to force a certain type or other field\ncharacteristics. The columns that are not named in the query will be placed\nbefore the others. For example:\n\nCREATE TABLE test (a INT NOT NULL, b CHAR(10)) ENGINE=MyISAM\n SELECT 5 AS b, c, d FROM another_table;\n\nRemember that the query just returns data. If you want to use the same\nindexes, or the same columns attributes ([NOT] NULL, DEFAULT, AUTO_INCREMENT)\nin the new table, you need to specify them manually. Types and sizes are not\nautomatically preserved if no data returned by the SELECT requires the full\nsize, and VARCHAR could be converted into CHAR. The CAST() function can be\nused to forcee the new table to use certain types.\n\nAliases (AS) are taken into account, and they should always be used when you\nSELECT an expression (function, arithmetical operation, etc).\n\nIf an error occurs during the query, the table will not be created at all.\n\nIf the new table has a primary key or UNIQUE indexes, you can use the IGNORE\nor REPLACE keywords to handle duplicate key errors during the query. IGNORE\nmeans that the newer values must not be inserted an identical value exists in\nthe index. REPLACE means that older values must be overwritten.\n\nIf the columns in the new table are more than the rows returned by the query,\nthe columns populated by the query will be placed after other columns. Note\nthat if the strict SQL_MODE is on, and the columns that are not names in the\nquery do not have a DEFAULT value, an error will raise and no rows will be\ncopied.\n\nConcurrent inserts are not used during the execution of a CREATE ... SELECT.\n\nIf the table already exists, an error similar to the following will be\nreturned:\n\nERROR 1050 (42S01): Table \'t\' already exists\n\nIf the IF NOT EXISTS clause is used and the table exists, a note will be\nproduced instead of an error.\n\nTo insert rows from a query into an existing table, INSERT ... SELECT can be\nused.\n\nColumn Definitions\n------------------\n\ncreate_definition:\n { col_name column_definition | index_definition | period_definition | CHECK\n(expr) }\ncolumn_definition:\n data_type\n [NOT NULL | NULL] [DEFAULT default_value | (expression)]\n [ON UPDATE [NOW | CURRENT_TIMESTAMP] [(precision)]]\n [AUTO_INCREMENT] [ZEROFILL] [UNIQUE [KEY] | [PRIMARY] KEY]\n [INVISIBLE] [{WITH|WITHOUT} SYSTEM VERSIONING]\n [COMMENT \'string\'] [REF_SYSTEM_ID = value]\n [reference_definition]\n | data_type [GENERATED ALWAYS]\n AS { { ROW {START|END} } | { (expression) [VIRTUAL | PERSISTENT | STORED] } }\n [UNIQUE [KEY]] [COMMENT \'string\']\nconstraint_definition:\n CONSTRAINT [constraint_name] CHECK (expression)\nNote: Until MariaDB 10.4, MariaDB accepts the shortcut format with a\nREFERENCES clause only in ALTER TABLE and CREATE TABLE statements, but that\nsyntax does nothing. For example:\n\nCREATE TABLE b(for_key INT REFERENCES a(not_key));\n\nMariaDB simply parses it without returning any error or warning, for\ncompatibility with other DBMS\'s. Before MariaDB 10.2.1 this was also true for\nCHECK constraints. However, only the syntax described below creates foreign\nkeys.\n\nFrom MariaDB 10.5, MariaDB will attempt to apply the constraint. See Foreign\nKeys examples.\n\nEach definition either creates a column in the table or specifies and index or\nconstraint on one or more columns. See Indexes below for details on creating\nindexes.\n\nCreate a column by specifying a column name and a data type, optionally\nfollowed by column options. See Data Types for a full list of data types\nallowed in MariaDB.\n\nNULL and NOT NULL\n-----------------\n\nUse the NULL or NOT NULL options to specify that values in the column may or\nmay not be NULL, respectively. By default, values may be NULL. See also NULL\nValues in MariaDB.\n\nDEFAULT Column Option\n---------------------\n\nMariaDB starting with 10.2.1\n----------------------------\nThe DEFAULT clause was enhanced in MariaDB 10.2.1. Some enhancements include\n\n* BLOB and TEXT columns now support DEFAULT.\n* The DEFAULT clause can now be used with an expression or function.\n\nSpecify a default value using the DEFAULT clause. If you don\'t specify DEFAULT\nthen the following rules apply:\n\n* If the column is not defined with NOT NULL, AUTO_INCREMENT or TIMESTAMP, an\nexplicit DEFAULT NULL will be added.\nNote that in MySQL and in MariaDB before 10.1.6, you may get an explicit\nDEFAULT for primary key parts, if not specified with NOT NULL.\n\nThe default value will be used if you INSERT a row without specifying a value\nfor that column, or if you specify DEFAULT for that column. Before MariaDB\n10.2.1 you couldn\'t usually provide an expression or function to evaluate at\ninsertion time. You had to provide a constant default value instead. The one\nexception is that you may use CURRENT_TIMESTAMP as the default value for a\nTIMESTAMP column to use the current timestamp at insertion time.\n\nCURRENT_TIMESTAMP may also be used as the default value for a DATETIME\n\nFrom MariaDB 10.2.1 you can use most functions in DEFAULT. Expressions should\nhave parentheses around them. If you use a non deterministic function in\nDEFAULT then all inserts to the table will be replicated in row mode. You can\neven refer to earlier columns in the DEFAULT expression (excluding\nAUTO_INCREMENT columns):\n\nCREATE TABLE t1 (a int DEFAULT (1+1), b int DEFAULT (a+1));\nCREATE TABLE t2 (a bigint primary key DEFAULT UUID_SHORT());\n\nThe DEFAULT clause cannot contain any stored functions or subqueries, and a\ncolumn used in the clause must already have been defined earlier in the\nstatement.\n\nSince MariaDB 10.2.1, it is possible to assign BLOB or TEXT columns a DEFAULT\nvalue. In earlier versions, assigning a default to these columns was not\npossible.\n\nMariaDB starting with 10.3.3\n----------------------------\nStarting from 10.3.3 you can also use DEFAULT (NEXT VALUE FOR sequence)\n\nAUTO_INCREMENT Column Option\n----------------------------\n\nUse AUTO_INCREMENT to create a column whose value can can be set automatically\nfrom a simple counter. You can only use AUTO_INCREMENT on a column with an\ninteger type. The column must be a key, and there can only be one\nAUTO_INCREMENT column in a table. If you insert a row without specifying a\nvalue for that column (or if you specify 0, NULL, or DEFAULT as the value),\nthe actual value will be taken from the counter, with each insertion\nincrementing the counter by one. You can still insert a value explicitly. If\nyou insert a value that is greater than the current counter value, the counter\nis set based on the new value. An AUTO_INCREMENT column is implicitly NOT\nNULL. Use LAST_INSERT_ID to get the AUTO_INCREMENT value most recently used by\nan INSERT statement.\n\nZEROFILL Column Option\n----------------------\n\nIf the ZEROFILL column option is specified for a column using a numeric data\ntype, then the column will be set to UNSIGNED and the spaces used by default\nto pad the field are replaced with zeros. ZEROFILL is ignored in expressions\nor as part of a UNION. ZEROFILL is a non-standard MySQL and MariaDB\nenhancement.\n\nPRIMARY KEY Column Option\n-------------------------\n\nUse PRIMARY KEY to make a column a primary key. A primary key is a special\ntype of a unique key. There can be at most one primary key per table, and it\nis implicitly NOT NULL.\n\nSpecifying a column as a unique key creates a unique index on that column. See\nthe Index Definitions section below for more information.\n\nUNIQUE KEY Column Option\n------------------------\n\nUse UNIQUE KEY (or just UNIQUE) to specify that all values in the column must\nbe distinct from each other. Unless the column is NOT NULL, there may be\nmultiple rows with NULL in the column.\n\nSpecifying a column as a unique key creates a unique index on that column. See\nthe Index Definitions section below for more information.\n\nCOMMENT Column Option\n---------------------\n\nYou can provide a comment for each column using the COMMENT clause. The\nmaximum length is 1024 characters. Use the SHOW FULL COLUMNS statement to see\ncolumn comments.\n\nREF_SYSTEM_ID\n-------------\n\nREF_SYSTEM_ID can be used to specify Spatial Reference System IDs for spatial\ndata type columns.\n\nGenerated Columns\n-----------------\n\nA generated column is a column in a table that cannot explicitly be set to a\nspecific value in a DML query. Instead, its value is automatically generated\nbased on an expression. This expression might generate the value based on the\nvalues of other columns in the table, or it might generate the value by\ncalling built-in functions or user-defined functions (UDFs).\n\nThere are two types of generated columns:\n\n* PERSISTENT or STORED: This type\'s value is actually stored in the table.\n* VIRTUAL: This type\'s value is not stored at all. Instead, the value is\ngenerated dynamically when the table is queried. This type is the default.\n\nGenerated columns are also sometimes called computed columns or virtual\ncolumns.\n\nFor a complete description about generated columns and their limitations, see\nGenerated (Virtual and Persistent/Stored) Columns.\n\nCOMPRESSED\n----------\n\nMariaDB starting with 10.3.3\n----------------------------\nCertain columns may be compressed. See Storage-Engine Independent Column\nCompression.\n\nINVISIBLE\n---------\n\nMariaDB starting with 10.3.3\n----------------------------\nColumns may be made invisible, and hidden in certain contexts. See Invisible\nColumns.\n\nWITH SYSTEM VERSIONING Column Option\n------------------------------------\n\nMariaDB starting with 10.3.4\n----------------------------\nColumns may be explicitly marked as included from system versioning. See\nSystem-versioned tables for details.\n\nWITHOUT SYSTEM VERSIONING Column Option\n---------------------------------------\n\nMariaDB starting with 10.3.4\n----------------------------\nColumns may be explicitly marked as excluded from system versioning. See\nSystem-versioned tables for details.\n\nIndex Definitions\n-----------------\n\nindex_definition:\n {INDEX|KEY} [index_name] [index_type] (index_col_name,...) [index_option]\n...\n {{{|}}} {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (index_col_name,...)\n[index_option] ...\n {{{|}}} [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...)\n[index_option] ...\n {{{|}}} [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY] [index_name] [index_type]\n(index_col_name,...) [index_option] ...\n {{{|}}} [CONSTRAINT [symbol]] FOREIGN KEY [index_name] (index_col_name,...)\nreference_definition\n\nindex_col_name:\n col_name [(length)] [ASC | DESC]\n\nindex_type:\n USING {BTREE | HASH | RTREE}\n\nindex_option:\n [ KEY_BLOCK_SIZE [=] value\n {{{|}}} index_type\n {{{|}}} WITH PARSER parser_name\n {{{|}}} COMMENT \'string\'\n {{{|}}} CLUSTERING={YES| NO} ]\n [ IGNORED | NOT IGNORED ]\n\nreference_definition:\n REFERENCES tbl_name (index_col_name,...)\n [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE]\n [ON DELETE reference_option]\n [ON UPDATE reference_option]\n\nreference_option:\n RESTRICT | CASCADE | SET NULL | NO ACTION\n\nINDEX and KEY are synonyms.\n\nIndex names are optional, if not specified an automatic name will be assigned.\nIndex name are needed to drop indexes and appear in error messages when a\nconstraint is violated.\n\nIndex Categories\n----------------\n\nPlain Indexes\n-------------\n\nPlain indexes are regular indexes that are not unique, and are not acting as a\nprimary key or a foreign key. They are also not the "specialized" FULLTEXT or\nSPATIAL indexes.\n\nSee Getting Started with Indexes: Plain Indexes for more information.\n\nPRIMARY KEY\n-----------\n\nFor PRIMARY KEY indexes, you can specify a name for the index, but it is\nignored, and the name of the index is always PRIMARY. From MariaDB 10.3.18 and\nMariaDB 10.4.8, a warning is explicitly issued if a name is specified. Before\nthen, the name was silently ignored.\n\nSee Getting Started with Indexes: Primary Key for more information.\n\nUNIQUE\n------\n\nThe UNIQUE keyword means that the index will not accept duplicated values,\nexcept for NULLs. An error will raise if you try to insert duplicate values in\na UNIQUE index.\n\nFor UNIQUE indexes, you can specify a name for the constraint, using the\nCONSTRAINT keyword. That name will be used in error messages.\n\nSee Getting Started with Indexes: Unique Index for more information.\n\nFOREIGN KEY\n-----------\n\nFor FOREIGN KEY indexes, a reference definition must be provided.\n\nFor FOREIGN KEY indexes, you can specify a name for the constraint, using the\nCONSTRAINT keyword. That name will be used in error messages.\n\nFirst, you have to specify the name of the target (parent) table and a column\nor a column list which must be indexed and whose values must match to the\nforeign key\'s values. The MATCH clause is accepted to improve the\ncompatibility with other DBMS\'s, but has no meaning in MariaDB. The ON DELETE\nand ON UPDATE clauses specify what must be done when a DELETE (or a REPLACE)\nstatements attempts to delete a referenced row from the parent table, and when\nan UPDATE statement attempts to modify the referenced foreign key columns in a\nparent table row, respectively. The following options are allowed:\n\n* RESTRICT: The delete/update operation is not performed. The statement\nterminates with a 1451 error (SQLSTATE \'2300\').\n* NO ACTION: Synonym for RESTRICT.\n* CASCADE: The delete/update operation is performed in both tables.\n* SET NULL: The update or delete goes ahead in the parent table, and the\ncorresponding foreign key fields in the child table are set to NULL. (They\nmust not be defined as NOT NULL for this to succeed).\n* SET DEFAULT: This option is currently implemented only for the PBXT storage\nengine, which is disabled by default and no longer maintained. It sets the\nchild table\'s foreign key fields to their DEFAULT values when the referenced\nparent table key entries are updated or deleted.\n\nIf either clause is omitted, the default behavior for the omitted clause is\nRESTRICT.\n\nSee Foreign Keys for more information.\n\nFULLTEXT\n--------\n\nUse the FULLTEXT keyword to create full-text indexes.\n\nSee Full-Text Indexes for more information.\n\nSPATIAL\n-------\n\nUse the SPATIAL keyword to create geometric indexes.\n\nSee SPATIAL INDEX for more information.\n\nIndex Options\n-------------\n\nKEY_BLOCK_SIZE Index Option\n---------------------------\n\nThe KEY_BLOCK_SIZE index option is similar to the KEY_BLOCK_SIZE table option.\n\nWith the InnoDB storage engine, if you specify a non-zero value for the\nKEY_BLOCK_SIZE table option for the whole table, then the table will\nimplicitly be created with the ROW_FORMAT table option set to COMPRESSED.\nHowever, this does not happen if you just set the KEY_BLOCK_SIZE index option\nfor one or more indexes in the table. The InnoDB storage engine ignores the\nKEY_BLOCK_SIZE index option. However, the SHOW CREATE TABLE statement may\nstill report it for the index.\n\nFor information about the KEY_BLOCK_SIZE index option, see the KEY_BLOCK_SIZE\ntable option below.\n\nIndex Types\n-----------\n\nEach storage engine supports some or all index types. See Storage Engine Index\nTypes for details on permitted index types for each storage engine.\n\nDifferent index types are optimized for different kind of operations:\n\n* BTREE is the default type, and normally is the best choice. It is supported\nby all storage engines. It can be used to compare a column\'s value with a\nvalue using the =, >, >=, <, <=, BETWEEN, and LIKE operators. BTREE can also\nbe used to find NULL values. Searches against an index prefix are possible.\n* HASH is only supported by the MEMORY storage engine. HASH indexes can only\nbe used for =, <=, and >= comparisons. It can not be used for the ORDER BY\nclause. Searches against an index prefix are not possible.\n* RTREE is the default for SPATIAL indexes, but if the storage engine does not\nsupport it BTREE can be used.\n\nIndex columns names are listed between parenthesis. After each column, a\nprefix length can be specified. If no length is specified, the whole column\nwill be indexed. ASC and DESC can be specified for compatibility with are\nDBMS\'s, but have no meaning in MariaDB.\n\nWITH PARSER Index Option\n------------------------\n\nThe WITH PARSER index option only applies to FULLTEXT indexes and contains the\nfulltext parser name. The fulltext parser must be an installed plugin.\n\nCOMMENT Index Option\n--------------------\n\nA comment of up to 1024 characters is permitted with the COMMENT index option.\n\nThe COMMENT index option allows you to specify a comment with user-readable\ntext describing what the index is for. This information is not used by the\nserver itself.\n\nCLUSTERING Index Option\n-----------------------\n\nThe CLUSTERING index option is only valid for tables using the TokuDB storage\nengine.\n\nIGNORED / NOT IGNORED\n---------------------\n\nMariaDB starting with 10.6.0\n----------------------------\nFrom MariaDB 10.6.0, indexes can be specified to be ignored by the optimizer.\nSee Ignored Indexes.\n\nPeriods\n-------\n\nMariaDB starting with 10.3.4\n----------------------------\n\nperiod_definition:\n PERIOD FOR SYSTEM_TIME (start_column_name, end_column_name)\nMariaDB supports a subset of the standard syntax for periods. At the moment\nit\'s only used for creating System-versioned tables. Both columns must be\ncreated, must be either of a TIMESTAMP(6) or BIGINT UNSIGNED type, and be\ngenerated as ROW START and ROW END accordingly. See System-versioned tables\nfor details.\n\nThe table must also have the WITH SYSTEM VERSIONING clause.\n\nConstraint Expressions\n----------------------\n\nMariaDB starting with 10.2.1\n----------------------------\nMariaDB 10.2.1 introduced new ways to define a constraint.\n\nNote: Before MariaDB 10.2.1, constraint expressions were accepted in the\nsyntax but ignored.\n\nMariaDB 10.2.1 introduced two ways to define a constraint:\n\n* CHECK(expression) given as part of a column definition.\n* CONSTRAINT [constraint_name] CHECK (expression)\n\nBefore a row is inserted or updated, all constraints are evaluated in the\norder they are defined. If any constraints fails, then the row will not be\nupdated. One can use most deterministic functions in a constraint, including\nUDFs.\n\ncreate table t1 (a int check(a>0) ,b int check (b> 0), constraint abc check\n(a>b));\n\nIf you use the second format and you don\'t give a name to the constraint, then\nthe constraint will get a auto generated name. This is done so that you can\nlater delete the constraint with ALTER TABLE DROP constraint_name.\n\nOne can disable all constraint expression checks by setting the variable\ncheck_constraint_checks to OFF. This is useful for example when loading a\ntable that violates some constraints that you want to later find and fix in\nSQL.\n\nSee CONSTRAINT for more information.\n\nTable Options\n-------------\n\nFor each individual table you create (or alter), you can set some table\noptions. The general syntax for setting options is:\n\n<OPTION_NAME> = <option_value>, [<OPTION_NAME> = <option_value> ...]\n\nThe equal sign is optional.\n\nSome options are supported by the server and can be used for all tables, no\nmatter what storage engine they use; other options can be specified for all\nstorage engines, but have a meaning only for some engines. Also, engines can\nextend CREATE TABLE with new options.\n\nIf the IGNORE_BAD_TABLE_OPTIONS SQL_MODE is enabled, wrong table options\ngenerate a warning; otherwise, they generate an error.\n\ntable_option: \n [STORAGE] ENGINE [=] engine_name\n | AUTO_INCREMENT [=] value\n | AVG_ROW_LENGTH [=] value\n | [DEFAULT] CHARACTER SET [=] charset_name\n | CHECKSUM [=] {0 | 1}\n | [DEFAULT] COLLATE [=] collation_name\n | COMMENT [=] \'string\'\n | CONNECTION [=] \'connect_string\'\n | DATA DIRECTORY [=] \'absolute path to directory\'\n | DELAY_KEY_WRITE [=] {0 | 1}\n | ENCRYPTED [=] {YES | NO}\n | ENCRYPTION_KEY_ID [=] value\n | IETF_QUOTES [=] {YES | NO}\n | INDEX DIRECTORY [=] \'absolute path to directory\'\n | INSERT_METHOD [=] { NO | FIRST | LAST }\n | KEY_BLOCK_SIZE [=] value\n | MAX_ROWS [=] value\n | MIN_ROWS [=] value\n | PACK_KEYS [=] {0 | 1 | DEFAULT}\n | PAGE_CHECKSUM [=] {0 | 1}\n | PAGE_COMPRESSED [=] {0 | 1}\n | PAGE_COMPRESSION_LEVEL [=] {0 .. 9}\n | PASSWORD [=] \'string\'\n | ROW_FORMAT [=] {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT|PAGE}\n | SEQUENCE [=] {0|1}\n | STATS_AUTO_RECALC [=] {DEFAULT|0|1}\n | STATS_PERSISTENT [=] {DEFAULT|0|1}\n | STATS_SAMPLE_PAGES [=] {DEFAULT|value}\n | TABLESPACE tablespace_name\n | TRANSACTIONAL [=] {0 | 1}\n | UNION [=] (tbl_name[,tbl_name]...)\n | WITH SYSTEM VERSIONING\n\n[STORAGE] ENGINE\n----------------\n\n[STORAGE] ENGINE specifies a storage engine for the table. If this option is\nnot used, the default storage engine is used instead. That is, the\ndefault_storage_engine session option value if it is set, or the value\nspecified for the --default-storage-engine mysqld startup option, or the\ndefault storage engine, InnoDB. If the specified storage engine is not\ninstalled and active, the default value will be used, unless the\nNO_ENGINE_SUBSTITUTION SQL MODE is set (default). This is only true for CREATE\nTABLE, not for ALTER TABLE. For a list of storage engines that are present in\nyour server, issue a SHOW ENGINES.\n\nAUTO_INCREMENT\n--------------\n\nAUTO_INCREMENT specifies the initial value for the AUTO_INCREMENT primary key.\nThis works for MyISAM, Aria, InnoDB, MEMORY, and ARCHIVE tables. You can\nchange this option with ALTER TABLE, but in that case the new value must be\nhigher than the highest value which is present in the AUTO_INCREMENT column.\nIf the storage engine does not support this option, you can insert (and then\ndelete) a row having the wanted value - 1 in the AUTO_INCREMENT column.\n\nAVG_ROW_LENGTH\n--------------\n\nAVG_ROW_LENGTH is the average rows size. It only applies to tables using\nMyISAM and Aria storage engines that have the ROW_FORMAT table option set to\nFIXED format.\n\nMyISAM uses MAX_ROWS and AVG_ROW_LENGTH to decide the maximum size of a table\n(default: 256TB, or the maximum file size allowed by the system).\n\n[DEFAULT] CHARACTER SET/CHARSET\n-------------------------------\n\n[DEFAULT] CHARACTER SET (or [DEFAULT] CHARSET) is used to set a default\ncharacter set for the table. This is the character set used for all columns\nwhere an explicit character set is not specified. If this option is omitted or\nDEFAULT is specified, database\'s default character set will be used. See\nSetting Character Sets and Collations for details on setting the character\nsets.\n\nCHECKSUM/TABLE_CHECKSUM\n-----------------------\n\nCHECKSUM (or TABLE_CHECKSUM) can be set to 1 to maintain a live checksum for\nall table\'s rows. This makes write operations slower, but CHECKSUM TABLE will\nbe very fast. This option is only supported for MyISAM and Aria tables.\n\n[DEFAULT] COLLATE\n-----------------\n\n[DEFAULT] COLLATE is used to set a default collation for the table. This is\nthe collation used for all columns where an explicit character set is not\nspecified. If this option is omitted or DEFAULT is specified, database\'s\ndefault option will be used. See Setting Character Sets and Collations for\ndetails on setting the collations\n\nCOMMENT\n-------\n\nCOMMENT is a comment for the table. The maximum length is 2048 characters.\nAlso used to define table parameters when creating a Spider table.\n\nCONNECTION\n----------\n\nCONNECTION is used to specify a server name or a connection string for a\nSpider, CONNECT, Federated or FederatedX table.\n\nDATA DIRECTORY/INDEX DIRECTORY\n------------------------------\n\nDATA DIRECTORY and INDEX DIRECTORY are supported for MyISAM and Aria, and DATA\nDIRECTORY is also supported by InnoDB if the innodb_file_per_table server\nsystem variable is enabled, but only in CREATE TABLE, not in ALTER TABLE. So,\ncarefully choose a path for InnoDB tables at creation time, because it cannot\nbe changed without dropping and re-creating the table. These options specify\nthe paths for data files and index files, respectively. If these options are\nomitted, the database\'s directory will be used to store data files and index\nfiles. Note that these table options do not work for partitioned tables (use\nthe partition options instead), or if the server has been invoked with the\n--skip-symbolic-links startup option. To avoid the overwriting of old files\nwith the same name that could be present in the directories, you can use the\n--keep_files_on_create option (an error will be issued if files already\nexist). These options are ignored if the NO_DIR_IN_CREATE SQL_MODE is enabled\n(useful for replication slaves). Also note that symbolic links cannot be used\nfor InnoDB tables.\n\nDATA DIRECTORY works by creating symlinks from where the table would normally\nhave been (inside the datadir) to where the option specifies. For security\nreasons, to avoid bypassing the privilege system, the server does not permit\nsymlinks inside the datadir. Therefore, DATA DIRECTORY cannot be used to\nspecify a location inside the datadir. An attempt to do so will result in an\nerror 1210 (HY000) Incorrect arguments to DATA DIRECTORY.\n\nDELAY_KEY_WRITE\n---------------\n\nDELAY_KEY_WRITE is supported by MyISAM and Aria, and can be set to 1 to speed\nup write operations. In that case, when data are modified, the indexes are not\nupdated until the table is closed. Writing the changes to the index file\naltogether can be much faster. However, note that this option is applied only\nif the delay_key_write server variable is set to \'ON\'. If it is \'OFF\' the\ndelayed index writes are always disabled, and if it is \'ALL\' the delayed index\nwrites are always used, disregarding the value of DELAY_KEY_WRITE.\n\nENCRYPTED\n---------\n\nThe ENCRYPTED table option can be used to manually set the encryption status\nof an InnoDB table. See InnoDB Encryption for more information.\n\nAria does not support the ENCRYPTED table option. See MDEV-18049.\n\nSee Data-at-Rest Encryption for more information.\n\nENCRYPTION_KEY_ID\n-----------------\n\nThe ENCRYPTION_KEY_ID table option can be used to manually set the encryption\nkey of an InnoDB table. See InnoDB Encryption for more information.\n\nAria does not support the ENCRYPTION_KEY_ID table option. See MDEV-18049.\n\nSee Data-at-Rest Encryption for more information.\n\nIETF_QUOTES\n-----------\n\nFor the CSV storage engine, the IETF_QUOTES option, when set to YES, enables\nIETF-compatible parsing of embedded quote and comma characters. Enabling this\noption for a table improves compatibility with other tools that use CSV, but\nis not compatible with MySQL CSV tables, or MariaDB CSV tables created without\nthis option. Disabled by default.\n\nINSERT_METHOD\n-------------\n\nINSERT_METHOD is only used with MERGE tables. This option determines in which\nunderlying table the new rows should be inserted. If you set it to \'NO\' (which\nis the default) no new rows can be added to the table (but you will still be\nable to perform INSERTs directly against the underlying tables). FIRST means\nthat the rows are inserted into the first table, and LAST means that thet are\ninserted into the last table.\n\nKEY_BLOCK_SIZE\n--------------\n\nKEY_BLOCK_SIZE is used to determine the size of key blocks, in bytes or\nkilobytes. However, this value is just a hint, and the storage engine could\nmodify or ignore it. If KEY_BLOCK_SIZE is set to 0, the storage engine\'s\ndefault value will be used.\n\nWith the InnoDB storage engine, if you specify a non-zero value for the\nKEY_BLOCK_SIZE table option for the whole table, then the table will\nimplicitly be created with the ROW_FORMAT table option set to COMPRESSED.\n\nMIN_ROWS/MAX_ROWS\n-----------------\n\nMIN_ROWS and MAX_ROWS let the storage engine know how many rows you are\nplanning to store as a minimum and as a maximum. These values will not be used\nas real limits, but they help the storage engine to optimize the table.\nMIN_ROWS is only used by MEMORY storage engine to decide the minimum memory\nthat is always allocated. MAX_ROWS is used to decide the minimum size for\nindexes.\n\nPACK_KEYS\n---------\n\nPACK_KEYS can be used to determine whether the indexes will be compressed. Set\nit to 1 to compress all keys. With a value of 0, compression will not be used.\nWith the DEFAULT value, only long strings will be compressed. Uncompressed\nkeys are faster.\n\nPAGE_CHECKSUM\n-------------\n\nPAGE_CHECKSUM is only applicable to Aria tables, and determines whether\nindexes and data should use page checksums for extra safety.\n\nPAGE_COMPRESSED\n---------------\n\nPAGE_COMPRESSED is used to enable InnoDB page compression for InnoDB tables.\n\nPAGE_COMPRESSION_LEVEL\n----------------------\n\nPAGE_COMPRESSION_LEVEL is used to set the compression level for InnoDB page\ncompression for InnoDB tables. The table must also have the PAGE_COMPRESSED\ntable option set to 1.\n\nValid values for PAGE_COMPRESSION_LEVEL are 1 (the best speed) through 9 (the\nbest compression), .\n\nPASSWORD\n--------\n\nPASSWORD is unused.\n\nRAID_TYPE\n---------\n\nRAID_TYPE is an obsolete option, as the raid support has been disabled since\nMySQL 5.0.\n\nROW_FORMAT\n----------\n\nThe ROW_FORMAT table option specifies the row format for the data file.\nPossible values are engine-dependent.\n\nSupported MyISAM Row Formats\n----------------------------\n\nFor MyISAM, the supported row formats are:\n\n* FIXED\n* DYNAMIC\n* COMPRESSED\n\nThe COMPRESSED row format can only be set by the myisampack command line tool.\n\nSee MyISAM Storage Formats for more information.\n\nSupported Aria Row Formats\n--------------------------\n\nFor Aria, the supported row formats are:\n\n* PAGE\n* FIXED\n* DYNAMIC.\n\nSee Aria Storage Formats for more information.\n\nSupported InnoDB Row Formats\n----------------------------\n\nFor InnoDB, the supported row formats are:\n\n* COMPACT\n* REDUNDANT\n* COMPRESSED\n* DYNAMIC.\n\nIf the ROW_FORMAT table option is set to FIXED for an InnoDB table, then the\nserver will either return an error or a warning depending on the value of the\ninnodb_strict_mode system variable. If the innodb_strict_mode system variable\nis set to OFF, then a warning is issued, and MariaDB will create the table\nusing the default row format for the specific MariaDB server version. If the\ninnodb_strict_mode system variable is set to ON, then an error will be raised.\n\nSee InnoDB Storage Formats for more information.\n\nOther Storage Engines and ROW_FORMAT\n------------------------------------\n\nOther storage engines do not support the ROW_FORMAT table option.\n\nSEQUENCE\n--------\n\nMariaDB starting with 10.3\n--------------------------\nIf the table is a sequence, then it will have the SEQUENCE set to 1.\n\nSTATS_AUTO_RECALC\n-----------------\n\nSTATS_AUTO_RECALC indicates whether to automatically recalculate persistent\nstatistics (see STATS_PERSISTENT, below) for an InnoDB table. If set to 1,\nstatistics will be recalculated when more than 10% of the data has changed.\nWhen set to 0, stats will be recalculated only when an ANALYZE TABLE is run.\nIf set to DEFAULT, or left out, the value set by the innodb_stats_auto_recalc\nsystem variable applies. See InnoDB Persistent Statistics.\n\nSTATS_PERSISTENT\n----------------\n\nSTATS_PERSISTENT indicates whether the InnoDB statistics created by ANALYZE\nTABLE will remain on disk or not. It can be set to 1 (on disk), 0 (not on\ndisk, the pre-MariaDB 10 behavior), or DEFAULT (the same as leaving out the\noption), in which case the value set by the innodb_stats_persistent system\nvariable will apply. Persistent statistics stored on disk allow the statistics\nto survive server restarts, and provide better query plan stability. See\nInnoDB Persistent Statistics.\n\nSTATS_SAMPLE_PAGES\n------------------\n\nSTATS_SAMPLE_PAGES indicates how many pages are used to sample index\nstatistics. If 0 or DEFAULT, the default value, the innodb_stats_sample_pages\nvalue is used. See InnoDB Persistent Statistics.\n\nTRANSACTIONAL\n-------------\n\nTRANSACTIONAL is only applicable for Aria tables. In future Aria tables\ncreated with this option will be fully transactional, but currently this\nprovides a form of crash protection. See Aria Storage Engine for more details.\n\nUNION\n-----\n\nUNION must be specified when you create a MERGE table. This option contains a\ncomma-separated list of MyISAM tables which are accessed by the new table. The\nlist is enclosed between parenthesis. Example: UNION = (t1,t2)\n\nWITH SYSTEM VERSIONING\n----------------------\n\nWITH SYSTEM VERSIONING is used for creating System-versioned tables.\n\nPartitions\n----------\n\npartition_options:\n PARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY(column_list)\n | RANGE(expr)\n | LIST(expr)\n | SYSTEM_TIME [INTERVAL time_quantity time_unit] [LIMIT num] }\n [PARTITIONS num]\n [SUBPARTITION BY\n { [LINEAR] HASH(expr)\n | [LINEAR] KEY(column_list) }\n [SUBPARTITIONS num]\n ]\n [(partition_definition [, partition_definition] ...)]\npartition_definition:\n PARTITION partition_name\n [VALUES {LESS THAN {(expr) | MAXVALUE} | IN (value_list)}]\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'comment_text\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n [NODEGROUP [=] node_group_id]\n [(subpartition_definition [, subpartition_definition] ...)]\nsubpartition_definition:\n SUBPARTITION logical_name\n [[STORAGE] ENGINE [=] engine_name]\n [COMMENT [=] \'comment_text\' ]\n [DATA DIRECTORY [=] \'data_dir\']\n [INDEX DIRECTORY [=] \'index_dir\']\n [MAX_ROWS [=] max_number_of_rows]\n [MIN_ROWS [=] min_number_of_rows]\n [TABLESPACE [=] tablespace_name]\n [NODEGROUP [=] node_group_id]\nIf the PARTITION BY clause is used, the table will be partitioned. A partition\nmethod must be explicitly indicated for partitions and subpartitions.\nPartition methods are:\n\n* [LINEAR] HASH creates a hash key which will be used to read and write rows.\nThe partition function can be any valid SQL expression which returns an\nINTEGER number. Thus, it is possible to use the HASH method on an integer\ncolumn, or on functions which accept integer columns as an argument. However,\nVALUES LESS THAN and VALUES IN clauses can not be used with HASH. An example:\n\nCREATE TABLE t1 (a INT, b CHAR(5), c DATETIME)\n PARTITION BY HASH ( YEAR(c) );\n\n[LINEAR] HASH can be used for subpartitions, too.\n\n* [LINEAR] KEY is similar to HASH, but the index has an even distribution of\ndata. Also, the expression can only be a column or a list of columns. VALUES\nLESS THAN and VALUES IN clauses can not be used with KEY.\n* RANGE partitions the rows using on a range of values, using the VALUES LESS\nTHAN operator. VALUES IN is not allowed with RANGE. The partition function can\nbe any valid SQL expression which returns a single value.\n* LIST assigns partitions based on a table\'s column with a restricted set of\npossible values. It is similar to RANGE, but VALUES IN must be used for at\nleast 1 columns, and VALUES LESS THAN is disallowed.\n* SYSTEM_TIME partitioning is used for System-versioned tables to store\nhistorical data separately from current data.\n\nOnly HASH and KEY can be used for subpartitions, and they can be [LINEAR].\n\nIt is possible to define up to 1024 partitions and subpartitions.\n\nThe number of defined partitions can be optionally specified as PARTITION\ncount. This can be done to avoid specifying all partitions individually. But\nyou can also declare each individual partition and, additionally, specify a\nPARTITIONS count clause; in the case, the number of PARTITIONs must equal\ncount.\n\nAlso see Partitioning Types Overview.\n\nSequences\n---------\n\nMariaDB starting with 10.3\n--------------------------\nCREATE TABLE can also be used to create a SEQUENCE. See CREATE SEQUENCE and\nSequence Overview.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL. CREATE TABLE is atomic, except for CREATE\nOR REPLACE, which is only crash safe.\n\nExamples\n--------\n\ncreate table if not exists test (\na bigint auto_increment primary key,\nname varchar(128) charset utf8,\nkey name (name(32))\n) engine=InnoDB default charset latin1;\n\nThis example shows a couple of things:\n\n* Usage of IF NOT EXISTS; If the table already existed, it will not be\ncreated. There will not be any error for the client, just a warning.\n* How to create a PRIMARY KEY that is automatically generated.\n* How to specify a table-specific character set and another for a column.\n* How to create an index (name) that is only partly indexed (to save space).\n\nThe following clauses will work from MariaDB 10.2.1 only.\n\nCREATE TABLE t1(\n a int DEFAULT (1+1),\n b int DEFAULT (a+1),\n expires DATETIME DEFAULT(NOW() + INTERVAL 1 YEAR),\n x BLOB DEFAULT USER()\n);\n\n\n\nURL: mariadb.com/kb/en/create-table/','','https://mariadb.com/kb/en/create-table/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (661,39,'CREATE TABLESPACE','The CREATE TABLESPACE statement is not supported by MariaDB. It was\noriginally inherited from MySQL NDB Cluster. In MySQL 5.7 and later, the\nstatement is also supported for InnoDB. However, MariaDB has chosen not to\ninclude that specific feature. See MDEV-19294 for more information.\n\n\n\nURL: mariadb.com/kb/en/create-tablespace/','','https://mariadb.com/kb/en/create-tablespace/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (662,39,'CREATE TRIGGER','Syntax\n------\n\nCREATE [OR REPLACE]\n [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n TRIGGER [IF NOT EXISTS] trigger_name trigger_time trigger_event\n ON tbl_name FOR EACH ROW\n [{ FOLLOWS | PRECEDES } other_trigger_name ]\n trigger_stmt;\n\nDescription\n-----------\n\nThis statement creates a new trigger. A trigger is a named database object\nthat is associated with a table, and that activates when a particular event\noccurs for the table. The trigger becomes associated with the table named\ntbl_name, which must refer to a permanent table. You cannot associate a\ntrigger with a TEMPORARY table or a view.\n\nCREATE TRIGGER requires the TRIGGER privilege for the table associated with\nthe trigger.\n\nMariaDB starting with 10.2.3\n----------------------------\nYou can have multiple triggers for the same trigger_time and trigger_event.\n\nFor valid identifiers to use as trigger names, see Identifier Names.\n\nOR REPLACE\n----------\n\nMariaDB starting with 10.1.4\n----------------------------\nIf used and the trigger already exists, instead of an error being returned,\nthe existing trigger will be dropped and replaced by the newly defined trigger.\n\nDEFINER\n-------\n\nThe DEFINER clause determines the security context to be used when checking\naccess privileges at trigger activation time. Usage requires the SUPER\nprivilege, or, from MariaDB 10.5.2, the SET USER privilege.\n\nIF NOT EXISTS\n-------------\n\nMariaDB starting with 10.1.4\n----------------------------\nIf the IF NOT EXISTS clause is used, the trigger will only be created if a\ntrigger of the same name does not exist. If the trigger already exists, by\ndefault a warning will be returned.\n\ntrigger_time\n------------\n\ntrigger_time is the trigger action time. It can be BEFORE or AFTER to indicate\nthat the trigger activates before or after each row to be modified.\n\ntrigger_event\n-------------\n\ntrigger_event indicates the kind of statement that activates the trigger. The\ntrigger_event can be one of the following:\n\n* INSERT: The trigger is activated whenever a new row is inserted into the\ntable; for example, through INSERT, LOAD DATA, and REPLACE statements.\n* UPDATE: The trigger is activated whenever a row is modified; for example,\nthrough UPDATE statements.\n* DELETE: The trigger is activated whenever a row is deleted from the table;\nfor example, through DELETE and REPLACE statements. However, DROP TABLE and\nTRUNCATE statements on the table do not activate this trigger, because they do\nnot use DELETE. Dropping a partition does not activate DELETE triggers, either.\n\nFOLLOWS/PRECEDES other_trigger_name\n-----------------------------------\n\nMariaDB starting with 10.2.3\n----------------------------\nThe FOLLOWS other_trigger_name and PRECEDES other_trigger_name options were\nadded in MariaDB 10.2.3 as part of supporting multiple triggers per action\ntime. This is the same syntax used by MySQL 5.7, although MySQL 5.7 does not\nhave multi-trigger support.\n\nFOLLOWS adds the new trigger after another trigger while PRECEDES adds the new\ntrigger before another trigger. If neither option is used, the new trigger is\nadded last for the given action and time.\n\nFOLLOWS and PRECEDES are not stored in the trigger definition. However the\ntrigger order is guaranteed to not change over time. mariadb-dump/mysqldump\nand other backup methods will not change trigger order. You can verify the\ntrigger order from the ACTION_ORDER column in INFORMATION_SCHEMA.TRIGGERS\ntable.\n\nSELECT trigger_name, action_order FROM information_schema.triggers \n WHERE event_object_table=\'t1\';\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL and CREATE TRIGGER is atomic.\n\nExamples\n--------\n\nCREATE DEFINER=`root`@`localhost` TRIGGER increment_animal\n AFTER INSERT ON animals FOR EACH ROW\n UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\n\nOR REPLACE and IF NOT EXISTS\n\nCREATE DEFINER=`root`@`localhost` TRIGGER increment_animal\n AFTER INSERT ON animals FOR EACH ROW\n UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\nERROR 1359 (HY000): Trigger already exists\n\nCREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER increment_animal\n AFTER INSERT ON animals FOR EACH ROW\n UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\nQuery OK, 0 rows affected (0.12 sec)\n\nCREATE DEFINER=`root`@`localhost` TRIGGER IF NOT EXISTS increment_animal\n AFTER INSERT ON animals FOR EACH ROW\n UPDATE animal_count SET animal_count.animals = animal_count.animals+1;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------+\n| Level | Code | Message |\n+-------+------+------------------------+\n| Note | 1359 | Trigger already exists |\n+-------+------+------------------------+\n1 row in set (0.00 sec)\n\n\n\nURL: mariadb.com/kb/en/create-trigger/','','https://mariadb.com/kb/en/create-trigger/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (663,39,'CREATE VIEW','Syntax\n------\n\nCREATE\n [OR REPLACE]\n [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}]\n [DEFINER = { user | CURRENT_USER | role | CURRENT_ROLE }]\n [SQL SECURITY { DEFINER | INVOKER }]\n VIEW [IF NOT EXISTS] view_name [(column_list)]\n AS select_statement\n [WITH [CASCADED | LOCAL] CHECK OPTION]\n\nDescription\n-----------\n\nThe CREATE VIEW statement creates a new view, or replaces an existing one if\nthe OR REPLACE clause is given. If the view does not exist, CREATE OR REPLACE\nVIEW is the same as CREATE VIEW. If the view does exist, CREATE OR REPLACE\nVIEW is the same as ALTER VIEW.\n\nThe select_statement is a SELECT statement that provides the definition of the\nview. (When you select from the view, you select in effect using the SELECT\nstatement.) select_statement can select from base tables or other views.\n\nThe view definition is "frozen" at creation time, so changes to the underlying\ntables afterwards do not affect the view definition. For example, if a view is\ndefined as SELECT * on a table, new columns added to the table later do not\nbecome part of the view. A SHOW CREATE VIEW shows that such queries are\nrewritten and column names are included in the view definition.\n\nThe view definition must be a query that does not return errors at view\ncreation times. However, the base tables used by the views might be altered\nlater and the query may not be valid anymore. In this case, querying the view\nwill result in an error. CHECK TABLE helps in finding this kind of problems.\n\nThe ALGORITHM clause affects how MariaDB processes the view. The DEFINER and\nSQL SECURITY clauses specify the security context to be used when checking\naccess privileges at view invocation time. The WITH CHECK OPTION clause can be\ngiven to constrain inserts or updates to rows in tables referenced by the\nview. These clauses are described later in this section.\n\nThe CREATE VIEW statement requires the CREATE VIEW privilege for the view, and\nsome privilege for each column selected by the SELECT statement. For columns\nused elsewhere in the SELECT statement you must have the SELECT privilege. If\nthe OR REPLACE clause is present, you must also have the DROP privilege for\nthe view.\n\nA view belongs to a database. By default, a new view is created in the default\ndatabase. To create the view explicitly in a given database, specify the name\nas db_name.view_name when you create it.\n\nCREATE VIEW test.v AS SELECT * FROM t;\n\nBase tables and views share the same namespace within a database, so a\ndatabase cannot contain a base table and a view that have the same name.\n\nViews must have unique column names with no duplicates, just like base tables.\nBy default, the names of the columns retrieved by the SELECT statement are\nused for the view column names. To define explicit names for the view columns,\nthe optional column_list clause can be given as a list of comma-separated\nidentifiers. The number of names in column_list must be the same as the number\nof columns retrieved by the SELECT statement.\n\nMySQL until 5.1.28\n------------------\nPrior to MySQL 5.1.29, When you modify an existing view, the current view\ndefinition is backed up and saved. It is stored in that table\'s database\ndirectory, in a subdirectory named arc. The backup file for a view v is named\nv.frm-00001. If you alter the view again, the next backup is named\nv.frm-00002. The three latest view backup definitions are stored. Backed up\nview definitions are not preserved by mysqldump, or any other such programs,\nbut you can retain them using a file copy operation. However, they are not\nneeded for anything but to provide you with a backup of your previous view\ndefinition. It is safe to remove these backup definitions, but only while\nmysqld is not running. If you delete the arc subdirectory or its files while\nmysqld is running, you will receive an error the next time you try to alter\nthe view:\n\nMariaDB [test]> ALTER VIEW v AS SELECT * FROM t; \nERROR 6 (HY000): Error on delete of \'.\test\arc/v.frm-0004\' (Errcode: 2)\n\nColumns retrieved by the SELECT statement can be simple references to table\ncolumns. They can also be expressions that use functions, constant values,\noperators, and so forth.\n\nUnqualified table or view names in the SELECT statement are interpreted with\nrespect to the default database. A view can refer to tables or views in other\ndatabases by qualifying the table or view name with the proper database name.\n\nA view can be created from many kinds of SELECT statements. It can refer to\nbase tables or other views. It can use joins, UNION, and subqueries. The\nSELECT need not even refer to any tables. The following example defines a view\nthat selects two columns from another table, as well as an expression\ncalculated from those columns:\n\nCREATE TABLE t (qty INT, price INT);\n\nINSERT INTO t VALUES(3, 50);\n\nCREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;\n\nSELECT * FROM v;\n+------+-------+-------+\n| qty | price | value |\n+------+-------+-------+\n| 3 | 50 | 150 |\n+------+-------+-------+\n\nA view definition is subject to the following restrictions:\n\n* The SELECT statement cannot contain a subquery in the FROM clause.\n* The SELECT statement cannot refer to system or user variables.\n* Within a stored program, the definition cannot refer to program parameters\nor local variables.\n* The SELECT statement cannot refer to prepared statement parameters.\n* Any table or view referred to in the definition must exist. However, after a\nview has been created, it is possible to drop a table or view that the\ndefinition refers to. In this case, use of the view results in an error. To\ncheck a view definition for problems of this kind, use the CHECK TABLE\nstatement.\n* The definition cannot refer to a TEMPORARY table, and you cannot create a\nTEMPORARY view.\n* Any tables named in the view definition must exist at definition time.\n* You cannot associate a trigger with a view.\n* For valid identifiers to use as view names, see Identifier Names.\n\nORDER BY is allowed in a view definition, but it is ignored if you select from\na view using a statement that has its own ORDER BY.\n\nFor other options or clauses in the definition, they are added to the options\nor clauses of the statement that references the view, but the effect is\nundefined. For example, if a view definition includes a LIMIT clause, and you\nselect from the view using a statement that has its own LIMIT clause, it is\nundefined which limit applies. This same principle applies to options such as\nALL, DISTINCT, or SQL_SMALL_RESULT that follow the SELECT keyword, and to\nclauses such as INTO, FOR UPDATE, and LOCK IN SHARE MODE.\n\nThe PROCEDURE clause cannot be used in a view definition, and it cannot be\nused if a view is referenced in the FROM clause.\n\nIf you create a view and then change the query processing environment by\nchanging system variables, that may affect the results that you get from the\nview:\n\nCREATE VIEW v (mycol) AS SELECT \'abc\';\n\nSET sql_mode = \'\';\n\nSELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| mycol | \n+-------+\n\nSET sql_mode = \'ANSI_QUOTES\';\n\nSELECT "mycol" FROM v;\n+-------+\n| mycol |\n+-------+\n| abc | \n+-------+\n\nThe DEFINER and SQL SECURITY clauses determine which MariaDB account to use\nwhen checking access privileges for the view when a statement is executed that\nreferences the view. They were added in MySQL 5.1.2. The legal SQL SECURITY\ncharacteristic values are DEFINER and INVOKER. These indicate that the\nrequired privileges must be held by the user who defined or invoked the view,\nrespectively. The default SQL SECURITY value is DEFINER.\n\nIf a user value is given for the DEFINER clause, it should be a MariaDB\naccount in \'user_name\'@\'host_name\' format (the same format used in the GRANT\nstatement). The user_name and host_name values both are required. The definer\ncan also be given as CURRENT_USER or CURRENT_USER(). The default DEFINER value\nis the user who executes the CREATE VIEW statement. This is the same as\nspecifying DEFINER = CURRENT_USER explicitly.\n\nIf you specify the DEFINER clause, these rules determine the legal DEFINER\nuser values:\n\n* If you do not have the SUPER privilege, or, from MariaDB 10.5.2, the SET\nUSER privilege, the only legal user value is your own account, either\nspecified literally or by using CURRENT_USER. You cannot set the definer to\nsome other account.\n* If you have the SUPER privilege, or, from MariaDB 10.5.2, the SET USER\nprivilege, you can specify any syntactically legal account name. If the\naccount does not actually exist, a warning is generated.\n* If the SQL SECURITY value is DEFINER but the definer account does not exist\nwhen the view is referenced, an error occurs.\n\nWithin a view definition, CURRENT_USER returns the view\'s DEFINER value by\ndefault. For views defined with the SQL SECURITY INVOKER characteristic,\nCURRENT_USER returns the account for the view\'s invoker. For information about\nuser auditing within views, see\nhttp://dev.mysql.com/doc/refman/5.1/en/account-activity-auditing.html.\n\nWithin a stored routine that is defined with the SQL SECURITY DEFINER\ncharacteristic, CURRENT_USER returns the routine\'s DEFINER value. This also\naffects a view defined within such a program, if the view definition contains\na DEFINER value of CURRENT_USER.\n\nView privileges are checked like this:\n\n* At view definition time, the view creator must have the privileges needed to\nuse the top-level objects accessed by the view. For example, if the view\ndefinition refers to table columns, the creator must have privileges for the\ncolumns, as described previously. If the definition refers to a stored\nfunction, only the privileges needed to invoke the function can be checked.\nThe privileges required when the function runs can be checked only as it\nexecutes: For different invocations of the function, different execution paths\nwithin the function might be taken.\n* When a view is referenced, privileges for objects accessed by the view are\nchecked against the privileges held by the view creator or invoker, depending\non whether the SQL SECURITY characteristic is DEFINER or INVOKER, respectively.\n* If reference to a view causes execution of a stored function, privilege\nchecking for statements executed within the function depend on whether the\nfunction is defined with a SQL SECURITY characteristic of DEFINER or INVOKER.\nIf the security characteristic is DEFINER, the function runs with the\nprivileges of its creator. If the characteristic is INVOKER, the function runs\nwith the privileges determined by the view\'s SQL SECURITY characteristic.\n\nExample: A view might depend on a stored function, and that function might\ninvoke other stored routines. For example, the following view invokes a stored\nfunction f():\n\nCREATE VIEW v AS SELECT * FROM t WHERE t.id = f(t.name);\n\nSuppose that f() contains a statement such as this:\n\nIF name IS NULL then\n CALL p1();\nELSE\n CALL p2();\nEND IF;\n\nThe privileges required for executing statements within f() need to be checked\nwhen f() executes. This might mean that privileges are needed for p1() or\np2(), depending on the execution path within f(). Those privileges must be\nchecked at runtime, and the user who must possess the privileges is determined\nby the SQL SECURITY values of the view v and the function f().\n\nThe DEFINER and SQL SECURITY clauses for views are extensions to standard SQL.\nIn standard SQL, views are handled using the rules for SQL SECURITY INVOKER.\n\nIf you invoke a view that was created before MySQL 5.1.2, it is treated as\nthough it was created with a SQL SECURITY DEFINER clause and with a DEFINER\nvalue that is the same as your account. However, because the actual definer is\nunknown, MySQL issues a warning. To make the warning go away, it is sufficient\nto re-create the view so that the view definition includes a DEFINER clause.\n\nThe optional ALGORITHM clause is an extension to standard SQL. It affects how\nMariaDB processes the view. ALGORITHM takes three values: MERGE, TEMPTABLE, or\nUNDEFINED. The default algorithm is UNDEFINED if no ALGORITHM clause is\npresent. See View Algorithms for more information.\n\nSome views are updatable. That is, you can use them in statements such as\nUPDATE, DELETE, or INSERT to update the contents of the underlying table. For\na view to be updatable, there must be a one-to-one relationship between the\nrows in the view and the rows in the underlying table. There are also certain\nother constructs that make a view non-updatable. See Inserting and Updating\nwith Views.\n\nWITH CHECK OPTION\n-----------------\n\nThe WITH CHECK OPTION clause can be given for an updatable view to prevent\ninserts or updates to rows except those for which the WHERE clause in the\nselect_statement is true.\n\nIn a WITH CHECK OPTION clause for an updatable view, the LOCAL and CASCADED\nkeywords determine the scope of check testing when the view is defined in\nterms of another view. The LOCAL keyword restricts the CHECK OPTION only to\nthe view being defined. CASCADED causes the checks for underlying views to be\nevaluated as well. When neither keyword is given, the default is CASCADED.\n\nFor more information about updatable views and the WITH CHECK OPTION clause,\nsee Inserting and Updating with Views.\n\nIF NOT EXISTS\n-------------\n\nMariaDB starting with 10.1.3\n----------------------------\nThe IF NOT EXISTS clause was added in MariaDB 10.1.3\n\nWhen the IF NOT EXISTS clause is used, MariaDB will return a warning instead\nof an error if the specified view already exists. Cannot be used together with\nthe OR REPLACE clause.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL and CREATE VIEW is atomic.\n\nExamples\n--------\n\nCREATE TABLE t (a INT, b INT) ENGINE = InnoDB;\n\nINSERT INTO t VALUES (1,1), (2,2), (3,3);\n\nCREATE VIEW v AS SELECT a, a*2 AS a2 FROM t;\n\nSELECT * FROM v;\n+------+------+\n| a | a2 |\n+------+------+\n| 1 | 2 |\n| 2 | 4 |\n| 3 | 6 |\n+------+------+\n\nOR REPLACE and IF NOT EXISTS:\n\nCREATE VIEW v AS SELECT a, a*2 AS a2 FROM t;\nERROR 1050 (42S01): Table \'v\' already exists\n\nCREATE OR REPLACE VIEW v AS SELECT a, a*2 AS a2 FROM t;\nQuery OK, 0 rows affected (0.04 sec)\n\nCREATE VIEW IF NOT EXISTS v AS SELECT a, a*2 AS a2 FROM t;\nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+--------------------------+\n| Level | Code | Message |\n+-------+------+--------------------------+\n| Note | 1050 | Table \'v\' already exists |\n+-------+------+--------------------------+\n\n\n\nURL: mariadb.com/kb/en/create-view/','','https://mariadb.com/kb/en/create-view/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (664,39,'DROP DATABASE','Syntax\n------\n\nDROP {DATABASE | SCHEMA} [IF EXISTS] db_name\n\nDescription\n-----------\n\nDROP DATABASE drops all tables in the database and deletes the database. Be\nvery careful with this statement! To use DROP DATABASE, you need the DROP\nprivilege on the database. DROP SCHEMA is a synonym for DROP DATABASE.\n\nImportant: When a database is dropped, user privileges on the database are not\nautomatically dropped. See GRANT.\n\nIF EXISTS\n---------\n\nUse IF EXISTS to prevent an error from occurring for databases that do not\nexist. A NOTE is generated for each non-existent database when using IF\nEXISTS. See SHOW WARNINGS.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL.\n\nDROP DATABASE is implemented as\n\nloop over all tables\n DROP TABLE table\n\nEach individual DROP TABLE is atomic while DROP DATABASE as a whole is\ncrash-safe.\n\nExamples\n--------\n\nDROP DATABASE bufg;\nQuery OK, 0 rows affected (0.39 sec)\n\nDROP DATABASE bufg;\nERROR 1008 (HY000): Can\'t drop database \'bufg\'; database doesn\'t exist\n\n\W\nShow warnings enabled.\n\nDROP DATABASE IF EXISTS bufg;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\nNote (Code 1008): Can\'t drop database \'bufg\'; database doesn\'t exist\n\n\n\nURL: mariadb.com/kb/en/drop-database/','','https://mariadb.com/kb/en/drop-database/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (665,39,'DROP EVENT','Syntax\n------\n\nDROP EVENT [IF EXISTS] event_name\n\nDescription\n-----------\n\nThis statement drops the event named event_name. The event immediately ceases\nbeing active, and is deleted completely from the server.\n\nIf the event does not exist, the error ERROR 1517 (HY000): Unknown event\n\'event_name\' results. You can override this and cause the statement to\ngenerate a NOTE for non-existent events instead by using IF EXISTS. See SHOW\nWARNINGS.\n\nThis statement requires the EVENT privilege. In MySQL 5.1.11 and earlier, an\nevent could be dropped only by its definer, or by a user having the SUPER\nprivilege.\n\nExamples\n--------\n\nDROP EVENT myevent3;\n\nUsing the IF EXISTS clause:\n\nDROP EVENT IF EXISTS myevent3;\nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+-------------------------------+\n| Level | Code | Message |\n+-------+------+-------------------------------+\n| Note | 1305 | Event myevent3 does not exist |\n+-------+------+-------------------------------+\n\n\n\nURL: mariadb.com/kb/en/drop-event/','','https://mariadb.com/kb/en/drop-event/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (666,39,'DROP FUNCTION','Syntax\n------\n\nDROP FUNCTION [IF EXISTS] f_name\n\nDescription\n-----------\n\nThe DROP FUNCTION statement is used to drop a stored function or a\nuser-defined function (UDF). That is, the specified routine is removed from\nthe server, along with all privileges specific to the function. You must have\nthe ALTER ROUTINE privilege for the routine in order to drop it. If the\nautomatic_sp_privileges server system variable is set, both the ALTER ROUTINE\nand EXECUTE privileges are granted automatically to the routine creator - see\nStored Routine Privileges.\n\nIF EXISTS\n---------\n\nThe IF EXISTS clause is a MySQL/MariaDB extension. It prevents an error from\noccurring if the function does not exist. A NOTE is produced that can be\nviewed with SHOW WARNINGS.\n\nFor dropping a user-defined functions (UDF), see DROP FUNCTION UDF.\n\nExamples\n--------\n\nDROP FUNCTION hello;\nQuery OK, 0 rows affected (0.042 sec)\n\nDROP FUNCTION hello;\nERROR 1305 (42000): FUNCTION test.hello does not exist\n\nDROP FUNCTION IF EXISTS hello;\nQuery OK, 0 rows affected, 1 warning (0.000 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------------------+\n| Level | Code | Message |\n+-------+------+------------------------------------+\n| Note | 1305 | FUNCTION test.hello does not exist |\n+-------+------+------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/drop-function/','','https://mariadb.com/kb/en/drop-function/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (667,39,'DROP INDEX','Syntax\n------\n\nDROP INDEX [IF EXISTS] index_name ON tbl_name \n [WAIT n |NOWAIT]\n\nDescription\n-----------\n\nDROP INDEX drops the index named index_name from the table tbl_name. This\nstatement is mapped to an ALTER TABLE statement to drop the index.\n\nIf another connection is using the table, a metadata lock is active, and this\nstatement will wait until the lock is released. This is also true for\nnon-transactional tables.\n\nSee ALTER TABLE.\n\nAnother shortcut, CREATE INDEX, allows the creation of an index.\n\nTo remove the primary key, `PRIMARY` must be specified as index_name. Note\nthat the quotes are necessary, because PRIMARY is a keyword.\n\nPrivileges\n----------\n\nExecuting the DROP INDEX statement requires the INDEX privilege for the table\nor the database.\n\nOnline DDL\n----------\n\nOnline DDL is used by default with InnoDB, when the drop index operation\nsupports it.\n\nSee InnoDB Online DDL Overview for more information on online DDL with InnoDB.\n\nDROP INDEX IF EXISTS ...\n------------------------\n\nIf the IF EXISTS clause is used, then MariaDB will return a warning instead of\nan error if the index does not exist.\n\nWAIT/NOWAIT\n-----------\n\nMariaDB starting with 10.3.0\n----------------------------\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nProgress Reporting\n------------------\n\nMariaDB provides progress reporting for DROP INDEX statement for clients that\nsupport the new progress reporting protocol. For example, if you were using\nthe mysql client, then the progress report might look like this::\n\n\n\nURL: mariadb.com/kb/en/drop-index/','','https://mariadb.com/kb/en/drop-index/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (668,39,'DROP PACKAGE','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nDROP PACKAGE [IF EXISTS] [ db_name . ] package_name\n\nDescription\n-----------\n\nThe DROP PACKAGE statement can be used when Oracle SQL_MODE is set.\n\nThe DROP PACKAGE statement drops a stored package entirely:\n\n* Drops the package specification (earlier created using the CREATE PACKAGE\nstatement).\n* Drops the package implementation, if the implementation was already created\nusing the CREATE PACKAGE BODY statement.\n\n\n\nURL: mariadb.com/kb/en/drop-package/','','https://mariadb.com/kb/en/drop-package/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (669,39,'DROP PACKAGE BODY','MariaDB starting with 10.3.5\n----------------------------\nOracle-style packages were introduced in MariaDB 10.3.5.\n\nSyntax\n------\n\nDROP PACKAGE BODY [IF EXISTS] [ db_name . ] package_name\n\nDescription\n-----------\n\nThe DROP PACKAGE BODY statement can be used when Oracle SQL_MODE is set.\n\nThe DROP PACKAGE BODY statement drops the package body (i.e the\nimplementation), previously created using the CREATE PACKAGE BODY statement.\n\nNote, DROP PACKAGE BODY drops only the package implementation, but does not\ndrop the package specification. Use DROP PACKAGE to drop the package entirely\n(i.e. both implementation and specification).\n\n\n\nURL: mariadb.com/kb/en/drop-package-body/','','https://mariadb.com/kb/en/drop-package-body/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (670,39,'DROP PROCEDURE','Syntax\n------\n\nDROP PROCEDURE [IF EXISTS] sp_name\n\nDescription\n-----------\n\nThis statement is used to drop a stored procedure. That is, the specified\nroutine is removed from the server along with all privileges specific to the\nprocedure. You must have the ALTER ROUTINE privilege for the routine. If the\nautomatic_sp_privileges server system variable is set, that privilege and\nEXECUTE are granted automatically to the routine creator - see Stored Routine\nPrivileges.\n\nThe IF EXISTS clause is a MySQL/MariaDB extension. It prevents an error from\noccurring if the procedure or function does not exist. A NOTE is produced that\ncan be viewed with SHOW WARNINGS.\n\nWhile this statement takes effect immediately, threads which are executing a\nprocedure can continue execution.\n\nExamples\n--------\n\nDROP PROCEDURE simpleproc;\n\nIF EXISTS:\n\nDROP PROCEDURE simpleproc;\nERROR 1305 (42000): PROCEDURE test.simpleproc does not exist\n\nDROP PROCEDURE IF EXISTS simpleproc;\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------------------------+\n| Level | Code | Message |\n+-------+------+------------------------------------------+\n| Note | 1305 | PROCEDURE test.simpleproc does not exist |\n+-------+------+------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/drop-procedure/','','https://mariadb.com/kb/en/drop-procedure/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (671,39,'DROP SEQUENCE','MariaDB starting with 10.3\n--------------------------\nDROP SEQUENCE was introduced in MariaDB 10.3.\n\nSyntax\n------\n\nDROP [TEMPORARY] SEQUENCE [IF EXISTS] [/*COMMENT TO SAVE*/]\n sequence_name [, sequence_name] ...\n\nDescription\n-----------\n\nDROP SEQUENCE removes one or more sequences created with CREATE SEQUENCE. You\nmust have the DROP privilege for each sequence. MariaDB returns an error\nindicating by name which non-existing tables it was unable to drop, but it\nalso drops all of the tables in the list that do exist.\n\nImportant: When a table is dropped, user privileges on the table are not\nautomatically dropped. See GRANT.\n\nIf another connection is using the sequence, a metadata lock is active, and\nthis statement will wait until the lock is released. This is also true for\nnon-transactional tables.\n\nFor each referenced sequence, DROP SEQUENCE drops a temporary sequence with\nthat name, if it exists. If it does not exist, and the TEMPORARY keyword is\nnot used, it drops a non-temporary sequence with the same name, if it exists.\nThe TEMPORARY keyword ensures that a non-temporary sequence will not\naccidentally be dropped.\n\nUse IF EXISTS to prevent an error from occurring for sequences that do not\nexist. A NOTE is generated for each non-existent sequence when using IF\nEXISTS. See SHOW WARNINGS.\n\nDROP SEQUENCE requires the DROP privilege.\n\nNotes\n-----\n\nDROP SEQUENCE only removes sequences, not tables. However, DROP TABLE can\nremove both sequences and tables.\n\n\n\nURL: mariadb.com/kb/en/drop-sequence/','','https://mariadb.com/kb/en/drop-sequence/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (672,39,'DROP SERVER','Syntax\n------\n\nDROP SERVER [ IF EXISTS ] server_name\n\nDescription\n-----------\n\nDrops the server definition for the server named server_name. The\ncorresponding row within the mysql.servers table will be deleted. This\nstatement requires the SUPER privilege or, from MariaDB 10.5.2, the FEDERATED\nADMIN privilege.\n\nDropping a server for a table does not affect any FederatedX, FEDERATED,\nConnect or Spider tables that used this connection information when they were\ncreated.\n\nDROP SERVER is not written to the binary log, irrespective of the binary log\nformat being used. From MariaDB 10.1.13, Galera replicates the CREATE SERVER,\nALTER SERVER and DROP SERVER statements.\n\nIF EXISTS\n---------\n\nIf the IF EXISTS clause is used, MariaDB will not return an error if the\nserver does not exist. Unlike all other statements, DROP SERVER IF EXISTS does\nnot issue a note if the server does not exist. See MDEV-9400.\n\nExamples\n--------\n\nDROP SERVER s;\n\nIF EXISTS:\n\nDROP SERVER s;\nERROR 1477 (HY000): The foreign server name you are trying to reference \n does not exist. Data source error: s\n\nDROP SERVER IF EXISTS s;\nQuery OK, 0 rows affected (0.00 sec)\n\n\n\nURL: mariadb.com/kb/en/drop-server/','','https://mariadb.com/kb/en/drop-server/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (673,39,'DROP TABLE','Syntax\n------\n\nDROP [TEMPORARY] TABLE [IF EXISTS] [/*COMMENT TO SAVE*/]\n tbl_name [, tbl_name] ...\n [WAIT n|NOWAIT]\n [RESTRICT | CASCADE]\n\nDescription\n-----------\n\nDROP TABLE removes one or more tables. You must have the DROP privilege for\neach table. All table data and the table definition are removed, as well as\ntriggers associated to the table, so be careful with this statement! If any of\nthe tables named in the argument list do not exist, MariaDB returns an error\nindicating by name which non-existing tables it was unable to drop, but it\nalso drops all of the tables in the list that do exist.\n\nImportant: When a table is dropped, user privileges on the table are not\nautomatically dropped. See GRANT.\n\nIf another thread is using the table in an explicit transaction or an\nautocommit transaction, then the thread acquires a metadata lock (MDL) on the\ntable. The DROP TABLE statement will wait in the "Waiting for table metadata\nlock" thread state until the MDL is released. MDLs are released in the\nfollowing cases:\n\n* If an MDL is acquired in an explicit transaction, then the MDL will be\nreleased when the transaction ends.\n* If an MDL is acquired in an autocommit transaction, then the MDL will be\nreleased when the statement ends.\n* Transactional and non-transactional tables are handled the same.\n\nNote that for a partitioned table, DROP TABLE permanently removes the table\ndefinition, all of its partitions, and all of the data which was stored in\nthose partitions. It also removes the partitioning definition (.par) file\nassociated with the dropped table.\n\nFor each referenced table, DROP TABLE drops a temporary table with that name,\nif it exists. If it does not exist, and the TEMPORARY keyword is not used, it\ndrops a non-temporary table with the same name, if it exists. The TEMPORARY\nkeyword ensures that a non-temporary table will not accidentally be dropped.\n\nUse IF EXISTS to prevent an error from occurring for tables that do not exist.\nA NOTE is generated for each non-existent table when using IF EXISTS. See SHOW\nWARNINGS.\n\nIf a foreign key references this table, the table cannot be dropped. In this\ncase, it is necessary to drop the foreign key first.\n\nRESTRICT and CASCADE are allowed to make porting from other database systems\neasier. In MariaDB, they do nothing.\n\nThe comment before the table names (/*COMMENT TO SAVE*/) is stored in the\nbinary log. That feature can be used by replication tools to send their\ninternal messages.\n\nIt is possible to specify table names as db_name.tab_name. This is useful to\ndelete tables from multiple databases with one statement. See Identifier\nQualifiers for details.\n\nThe DROP privilege is required to use DROP TABLE on non-temporary tables. For\ntemporary tables, no privilege is required, because such tables are only\nvisible for the current session.\n\nNote: DROP TABLE automatically commits the current active transaction, unless\nyou use the TEMPORARY keyword.\n\nMariaDB starting with 10.5.4\n----------------------------\nFrom MariaDB 10.5.4, DROP TABLE reliably deletes table remnants inside a\nstorage engine even if the .frm file is missing. Before then, a missing .frm\nfile would result in the statement failing.\n\nMariaDB starting with 10.3.1\n----------------------------\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nDROP TABLE in replication\n-------------------------\n\nDROP TABLE has the following characteristics in replication:\n\n* DROP TABLE IF EXISTS are always logged.\n* DROP TABLE without IF EXISTS for tables that don\'t exist are not written to\nthe binary log.\n* Dropping of TEMPORARY tables are prefixed in the log with TEMPORARY. These\ndrops are only logged when running statement or mixed mode replication.\n* One DROP TABLE statement can be logged with up to 3 different DROP\nstatements:\nDROP TEMPORARY TABLE list_of_non_transactional_temporary_tables\nDROP TEMPORARY TABLE list_of_transactional_temporary_tables\nDROP TABLE list_of_normal_tables\n\nDROP TABLE on the primary is treated on the replica as DROP TABLE IF EXISTS.\nYou can change that by setting slave-ddl-exec-mode to STRICT.\n\nDropping an Internal #sql-... Table\n-----------------------------------\n\nFrom MariaDB 10.6, DROP TABLE is atomic and the following does not apply.\nUntil MariaDB 10.5, if the mariadbd/mysqld process is killed during an ALTER\nTABLE you may find a table named #sql-... in your data directory. In MariaDB\n10.3, InnoDB tables with this prefix will be deleted automatically during\nstartup. From MariaDB 10.4, these temporary tables will always be deleted\nautomatically.\n\nIf you want to delete one of these tables explicitly you can do so by using\nthe following syntax:\n\nDROP TABLE `#mysql50##sql-...`;\n\nWhen running an ALTER TABLE…ALGORITHM=INPLACE that rebuilds the table, InnoDB\nwill create an internal #sql-ib table. Until MariaDB 10.3.2, for these tables,\nthe .frm file will be called something else. In order to drop such a table\nafter a server crash, you must rename the #sql*.frm file to match the\n#sql-ib*.ibd file.\n\nFrom MariaDB 10.3.3, the same name as the .frm file is used for the\nintermediate copy of the table. The #sql-ib names are used by TRUNCATE and\ndelayed DROP.\n\nFrom MariaDB 10.2.19 and MariaDB 10.3.10, the #sql-ib tables will be deleted\nautomatically.\n\nDropping All Tables in a Database\n---------------------------------\n\nThe best way to drop all tables in a database is by executing DROP DATABASE,\nwhich will drop the database itself, and all tables in it.\n\nHowever, if you want to drop all tables in the database, but you also want to\nkeep the database itself and any other non-table objects in it, then you would\nneed to execute DROP TABLE to drop each individual table. You can construct\nthese DROP TABLE commands by querying the TABLES table in the\ninformation_schema database. For example:\n\nSELECT CONCAT(\'DROP TABLE IF EXISTS `\', TABLE_SCHEMA, \'`.`\', TABLE_NAME, \'`;\')\nFROM information_schema.TABLES\nWHERE TABLE_SCHEMA = \'mydb\';\n\nAtomic DROP TABLE\n-----------------\n\nMariaDB starting with 10.6.1\n----------------------------\nFrom MariaDB 10.6, DROP TABLE for a single table is atomic (MDEV-25180) for\nmost engines, including InnoDB, MyRocks, MyISAM and Aria.\n\nThis means that if there is a crash (server down or power outage) during DROP\nTABLE, all tables that have been processed so far will be completely dropped,\nincluding related trigger files and status entries, and the binary log will\ninclude a DROP TABLE statement for the dropped tables. Tables for which the\ndrop had not started will be left intact.\n\nIn older MariaDB versions, there was a small chance that, during a server\ncrash happening in the middle of DROP TABLE, some storage engines that were\nusing multiple storage files, like MyISAM, could have only a part of its\ninternal files dropped.\n\nIn MariaDB 10.5, DROP TABLE was extended to be able to delete a table that was\nonly partly dropped (MDEV-11412) as explained above. Atomic DROP TABLE is the\nfinal piece to make DROP TABLE fully reliable.\n\nDropping multiple tables is crash-safe.\n\nSee Atomic DDL for more information.\n\nExamples\n--------\n\nDROP TABLE Employees, Customers;\n\nNotes\n-----\n\nBeware that DROP TABLE can drop both tables and sequences. This is mainly done\nto allow old tools like mysqldump to work with sequences.\n\n\n\nURL: mariadb.com/kb/en/drop-table/','','https://mariadb.com/kb/en/drop-table/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (674,39,'DROP TABLESPACE','The DROP TABLESPACE statement is not supported by MariaDB. It was\noriginally inherited from MySQL NDB Cluster. In MySQL 5.7 and later, the\nstatement is also supported for InnoDB. However, MariaDB has chosen not to\ninclude that specific feature. See MDEV-19294 for more information.\n\n\n\nURL: mariadb.com/kb/en/drop-tablespace/','','https://mariadb.com/kb/en/drop-tablespace/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (675,39,'DROP TRIGGER','Syntax\n------\n\nDROP TRIGGER [IF EXISTS] [schema_name.]trigger_name\n\nDescription\n-----------\n\nThis statement drops a trigger. The schema (database) name is optional. If the\nschema is omitted, the trigger is dropped from the default schema. Its use\nrequires the TRIGGER privilege for the table associated with the trigger.\n\nUse IF EXISTS to prevent an error from occurring for a trigger that does not\nexist. A NOTE is generated for a non-existent trigger when using IF EXISTS.\nSee SHOW WARNINGS.\n\nNote: Triggers for a table are also dropped if you drop the table.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL and DROP TRIGGER is atomic.\n\nExamples\n--------\n\nDROP TRIGGER test.example_trigger;\n\nUsing the IF EXISTS clause:\n\nDROP TRIGGER IF EXISTS test.example_trigger;\nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+------------------------+\n| Level | Code | Message |\n+-------+------+------------------------+\n| Note | 1360 | Trigger does not exist |\n+-------+------+------------------------+\n\n\n\nURL: mariadb.com/kb/en/drop-trigger/','','https://mariadb.com/kb/en/drop-trigger/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (676,39,'DROP VIEW','Syntax\n------\n\nDROP VIEW [IF EXISTS]\n view_name [, view_name] ...\n [RESTRICT | CASCADE]\n\nDescription\n-----------\n\nDROP VIEW removes one or more views. You must have the DROP privilege for each\nview. If any of the views named in the argument list do not exist, MariaDB\nreturns an error indicating by name which non-existing views it was unable to\ndrop, but it also drops all of the views in the list that do exist.\n\nThe IF EXISTS clause prevents an error from occurring for views that don\'t\nexist. When this clause is given, a NOTE is generated for each non-existent\nview. See SHOW WARNINGS.\n\nRESTRICT and CASCADE, if given, are parsed and ignored.\n\nIt is possible to specify view names as db_name.view_name. This is useful to\ndelete views from multiple databases with one statement. See Identifier\nQualifiers for details.\n\nThe DROP privilege is required to use DROP TABLE on non-temporary tables. For\ntemporary tables, no privilege is required, because such tables are only\nvisible for the current session.\n\nIf a view references another view, it will be possible to drop the referenced\nview. However, the other view will reference a view which does not exist any\nmore. Thus, querying it will produce an error similar to the following:\n\nERROR 1356 (HY000): View \'db_name.view_name\' references invalid table(s) or \ncolumn(s) or function(s) or definer/invoker of view lack rights to use them\n\nThis problem is reported in the output of CHECK TABLE.\n\nNote that it is not necessary to use DROP VIEW to replace an existing view,\nbecause CREATE VIEW has an OR REPLACE clause.\n\nAtomic DDL\n----------\n\nMariaDB starting with 10.6.1\n----------------------------\nMariaDB 10.6.1 supports Atomic DDL and DROP VIEW for a singular view is\natomic. Dropping multiple views is crash-safe.\n\nExamples\n--------\n\nDROP VIEW v,v2;\n\nGiven views v and v2, but no view v3\n\nDROP VIEW v,v2,v3;\nERROR 1051 (42S02): Unknown table \'v3\'\n\nDROP VIEW IF EXISTS v,v2,v3;\nQuery OK, 0 rows affected, 1 warning (0.01 sec)\n\nSHOW WARNINGS;\n+-------+------+-------------------------+\n| Level | Code | Message |\n+-------+------+-------------------------+\n| Note | 1051 | Unknown table \'test.v3\' |\n+-------+------+-------------------------+\n\n\n\nURL: mariadb.com/kb/en/drop-view/','','https://mariadb.com/kb/en/drop-view/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (677,39,'MERGE','Description\n-----------\n\nThe MERGE storage engine, also known as the MRG_MyISAM engine, is a collection\nof identical MyISAM tables that can be used as one. "Identical" means that all\ntables have identical column and index information. You cannot merge MyISAM\ntables in which the columns are listed in a different order, do not have\nexactly the same columns, or have the indexes in different order. However, any\nor all of the MyISAM tables can be compressed with myisampack. Columns names\nand indexes names can be different, as long as data types and NULL/NOT NULL\nclauses are the same. Differences in table options such as AVG_ROW_LENGTH,\nMAX_ROWS, or PACK_KEYS do not matter.\n\nEach index in a MERGE table must match an index in underlying MyISAM tables,\nbut the opposite is not true. Also, a MERGE table cannot have a PRIMARY KEY or\nUNIQUE indexes, because it cannot enforce uniqueness over all underlying\ntables.\n\nThe following options are meaningful for MERGE tables:\n\n* UNION. This option specifies the list of the underlying MyISAM tables. The\nlist is enclosed between parentheses and separated with commas.\n* INSERT_METHOD. This options specifies whether, and how, INSERTs are allowed\nfor the table. Allowed values are: NO (INSERTs are not allowed), FIRST (new\nrows will be written into the first table specified in the UNION list), LAST\n(new rows will be written into the last table specified in the UNION list).\nThe default value is NO.\n\nIf you define a MERGE table with a definition which is different from the\nunderlying MyISAM tables, or one of the underlying tables is not MyISAM, the\nCREATE TABLE statement will not return any error. But any statement which\ninvolves the table will produce an error like the following:\n\nERROR 1168 (HY000): Unable to open underlying table which is differently\ndefined \n or of non-MyISAM type or doesn\'t exist\n\nA CHECK TABLE will show more information about the problem.\n\nThe error is also produced if the table is properly define, but an underlying\ntable\'s definition changes at some point in time.\n\nIf you try to insert a new row into a MERGE table with INSERT_METHOD=NO, you\nwill get an error like the following:\n\nERROR 1036 (HY000): Table \'tbl_name\' is read only\n\nIt is possible to build a MERGE table on MyISAM tables which have one or more\nvirtual columns. MERGE itself does not support virtual columns, thus such\ncolumns will be seen as regular columns. The data types and sizes will still\nneed to be identical, and they cannot be NOT NULL.\n\nExamples\n--------\n\nCREATE TABLE t1 (\n a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n message CHAR(20)) ENGINE=MyISAM;\n\nCREATE TABLE t2 (\n a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n message CHAR(20)) ENGINE=MyISAM;\n\nINSERT INTO t1 (message) VALUES (\'Testing\'),(\'table\'),(\'t1\');\n\nINSERT INTO t2 (message) VALUES (\'Testing\'),(\'table\'),(\'t2\');\n\nCREATE TABLE total (\n a INT NOT NULL AUTO_INCREMENT,\n message CHAR(20), INDEX(a))\n ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST;\n\nSELECT * FROM total;\n+---+---------+\n| a | message |\n+---+---------+\n| 1 | Testing |\n| 2 | table |\n| 3 | t1 |\n| 1 | Testing |\n| 2 | table |\n| 3 | t2 |\n+---+---------+\n\nIn the following example, we\'ll create three MyISAM tables, and then a MERGE\ntable on them. However, one of them uses a different data type for the column\nb, so a SELECT will produce an error:\n\nCREATE TABLE t1 (\n a INT,\n b INT\n) ENGINE = MyISAM;\n\nCREATE TABLE t2 (\n a INT,\n b INT\n) ENGINE = MyISAM;\n\nCREATE TABLE t3 (\n a INT,\n b TINYINT\n) ENGINE = MyISAM;\n\nCREATE TABLE t_mrg (\n a INT,\n b INT\n) ENGINE = MERGE,UNION=(t1,t2,t3);\n\nSELECT * FROM t_mrg;\nERROR 1168 (HY000): Unable to open underlying table which is differently\ndefined\n or of non-MyISAM type or doesn\'t exist\n\nTo find out what\'s wrong, we\'ll use a CHECK TABLE:\n\nCHECK TABLE t_mrg\G\n*************************** 1. row ***************************\n Table: test.t_mrg\n Op: check\nMsg_type: Error\nMsg_text: Table \'test.t3\' is differently defined or of non-MyISAM type or\ndoesn\'t exist\n*************************** 2. row ***************************\n Table: test.t_mrg\n Op: check\nMsg_type: Error\nMsg_text: Unable to open underlying table which is differently defined or of\nnon-MyISAM type or doesn\'t exist\n*************************** 3. row ***************************\n Table: test.t_mrg\n Op: check\nMsg_type: error\nMsg_text: Corrupt\n\nNow, we know that the problem is in t3\'s definition.\n\n\n\nURL: mariadb.com/kb/en/merge/','','https://mariadb.com/kb/en/merge/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (678,39,'RENAME TABLE','Syntax\n------\n\nRENAME TABLE[S] [IF EXISTS] tbl_name \n [WAIT n | NOWAIT]\n TO new_tbl_name\n [, tbl_name2 TO new_tbl_name2] ...\n\nDescription\n-----------\n\nThis statement renames one or more tables or views, but not the privileges\nassociated with them.\n\nIF EXISTS\n---------\n\nMariaDB starting with 10.5.2\n----------------------------\nIf this directive is used, one will not get an error if the table to be\nrenamed doesn\'t exist.\n\nThe rename operation is done atomically, which means that no other session can\naccess any of the tables while the rename is running. For example, if you have\nan existing table old_table, you can create another table new_table that has\nthe same structure but is empty, and then replace the existing table with the\nempty one as follows (assuming that backup_table does not already exist):\n\nCREATE TABLE new_table (...);\nRENAME TABLE old_table TO backup_table, new_table TO old_table;\n\ntbl_name can optionally be specified as db_name.tbl_name. See Identifier\nQualifiers. This allows to use RENAME to move a table from a database to\nanother (as long as they are on the same filesystem):\n\nRENAME TABLE db1.t TO db2.t;\n\nNote that moving a table to another database is not possible if it has some\ntriggers. Trying to do so produces the following error:\n\nERROR 1435 (HY000): Trigger in wrong schema\n\nAlso, views cannot be moved to another database:\n\nERROR 1450 (HY000): Changing schema from \'old_db\' to \'new_db\' is not allowed.\n\nMultiple tables can be renamed in a single statement. The presence or absence\nof the optional S (RENAME TABLE or RENAME TABLES) has no impact, whether a\nsingle or multiple tables are being renamed.\n\nIf a RENAME TABLE renames more than one table and one renaming fails, all\nrenames executed by the same statement are rolled back.\n\nRenames are always executed in the specified order. Knowing this, it is also\npossible to swap two tables\' names:\n\nRENAME TABLE t1 TO tmp_table,\n t2 TO t1,\n tmp_table TO t2;\n\nWAIT/NOWAIT\n-----------\n\nMariaDB starting with 10.3.0\n----------------------------\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nPrivileges\n----------\n\nExecuting the RENAME TABLE statement requires the DROP, CREATE and INSERT\nprivileges for the table or the database.\n\nAtomic RENAME TABLE\n-------------------\n\nMariaDB starting with 10.6.1\n----------------------------\nFrom MariaDB 10.6, RENAME TABLE is atomic for most engines, including InnoDB,\nMyRocks, MyISAM and Aria (MDEV-23842). This means that if there is a crash\n(server down or power outage) during RENAME TABLE, all tables will revert to\ntheir original names and any changes to trigger files will be reverted.\n\nIn older MariaDB version there was a small chance that, during a server crash\nhappening in the middle of RENAME TABLE, some tables could have been renamed\n(in the worst case partly) while others would not be renamed.\n\nSee Atomic DDL for more information.\n\n\n\nURL: mariadb.com/kb/en/rename-table/','','https://mariadb.com/kb/en/rename-table/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (679,39,'TRUNCATE TABLE','Syntax\n------\n\nTRUNCATE [TABLE] tbl_name\n [WAIT n | NOWAIT]\n\nDescription\n-----------\n\nTRUNCATE TABLE empties a table completely. It requires the DROP privilege. See\nGRANT.\n\ntbl_name can also be specified in the form db_name.tbl_name (see Identifier\nQualifiers).\n\nLogically, TRUNCATE TABLE is equivalent to a DELETE statement that deletes all\nrows, but there are practical differences under some circumstances.\n\nTRUNCATE TABLE will fail for an InnoDB table if any FOREIGN KEY constraints\nfrom other tables reference the table, returning the error:\n\nERROR 1701 (42000): Cannot truncate a table referenced in a foreign key\nconstraint\n\nForeign Key constraints between columns in the same table are permitted.\n\nFor an InnoDB table, if there are no FOREIGN KEY constraints, InnoDB performs\nfast truncation by dropping the original table and creating an empty one with\nthe same definition, which is much faster than deleting rows one by one. The\nAUTO_INCREMENT counter is reset by TRUNCATE TABLE, regardless of whether there\nis a FOREIGN KEY constraint.\n\nThe count of rows affected by TRUNCATE TABLE is accurate only when it is\nmapped to a DELETE statement.\n\nFor other storage engines, TRUNCATE TABLE differs from DELETE in the following\nways:\n\n* Truncate operations drop and re-create the table, which is much\n faster than deleting rows one by one, particularly for large tables.\n* Truncate operations cause an implicit commit.\n* Truncation operations cannot be performed if the session holds an\n active table lock.\n* Truncation operations do not return a meaningful value for the number\n of deleted rows. The usual result is "0 rows affected," which should\n be interpreted as "no information."\n* As long as the table format file tbl_name.frm is valid, the\n table can be re-created as an empty table\n with TRUNCATE TABLE, even if the data or index files have become\n corrupted.\n* The table handler does not remember the last\n used AUTO_INCREMENT value, but starts counting\n from the beginning. This is true even for MyISAM and InnoDB, which normally\n do not reuse sequence values.\n* When used with partitioned tables, TRUNCATE TABLE preserves\n the partitioning; that is, the data and index files are dropped and\n re-created, while the partition definitions (.par) file is\n unaffected.\n* Since truncation of a table does not make any use of DELETE,\n the TRUNCATE statement does not invoke ON DELETE triggers.\n* TRUNCATE TABLE will only reset the values in the Performance Schema summary\ntables to zero or null, and will not remove the rows.\n\nFor the purposes of binary logging and replication, TRUNCATE TABLE is treated\nas DROP TABLE followed by CREATE TABLE (DDL rather than DML).\n\nTRUNCATE TABLE does not work on views. Currently, TRUNCATE TABLE drops all\nhistorical records from a system-versioned table.\n\nMariaDB starting with 10.3.0\n----------------------------\n\nWAIT/NOWAIT\n-----------\n\nSet the lock wait timeout. See WAIT and NOWAIT.\n\nOracle-mode\n-----------\n\nOracle-mode from MariaDB 10.3 permits the optional keywords REUSE STORAGE or\nDROP STORAGE to be used.\n\nTRUNCATE [TABLE] tbl_name [{DROP | REUSE} STORAGE] [WAIT n | NOWAIT]\n\nThese have no effect on the operation.\n\nPerformance\n-----------\n\nTRUNCATE TABLE is faster than DELETE, because it drops and re-creates a table.\n\nWith InnoDB, TRUNCATE TABLE is slower if innodb_file_per_table=ON is set (the\ndefault). This is because TRUNCATE TABLE unlinks the underlying tablespace\nfile, which can be an expensive operation. See MDEV-8069 for more details.\n\nThe performance issues with innodb_file_per_table=ON can be exacerbated in\ncases where the InnoDB buffer pool is very large and\ninnodb_adaptive_hash_index=ON is set. In that case, using DROP TABLE followed\nby CREATE TABLE instead of TRUNCATE TABLE may perform better. Setting\ninnodb_adaptive_hash_index=OFF (it defaults to ON before MariaDB 10.5) can\nalso help. In MariaDB 10.2 only, from MariaDB 10.2.19, this performance can\nalso be improved by setting innodb_safe_truncate=OFF. See MDEV-9459 for more\ndetails.\n\nSetting innodb_adaptive_hash_index=OFF can also improve TRUNCATE TABLE\nperformance in general. See MDEV-16796 for more details.\n\n\n\nURL: mariadb.com/kb/en/truncate-table/','','https://mariadb.com/kb/en/truncate-table/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (680,40,'LASTVAL','LASTVAL is a synonym for PREVIOUS VALUE for sequence_name.\n\n\n\nURL: mariadb.com/kb/en/lastval/','','https://mariadb.com/kb/en/lastval/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (681,40,'NEXT VALUE for sequence_name','MariaDB starting with 10.3\n--------------------------\nSEQUENCEs were introduced in MariaDB 10.3\n\nSyntax\n------\n\nNEXT VALUE FOR sequence\n\nor\n\nNEXTVAL(sequence_name)\n\nor in Oracle mode (SQL_MODE=ORACLE)\n\nsequence_name.nextval\n\nNEXT VALUE FOR is ANSI SQL syntax while NEXTVAL() is PostgreSQL syntax.\n\nDescription\n-----------\n\nGenerate next value for a SEQUENCE.\n\n* You can greatly speed up NEXT VALUE by creating the sequence with the CACHE\noption. If not, every NEXT VALUE usage will cause changes in the stored\nSEQUENCE table.\n* When using NEXT VALUE the value will be reserved at once and will not be\nreused, except if the SEQUENCE was created with CYCLE. This means that when\nyou are using SEQUENCEs you have to expect gaps in the generated sequence\nnumbers.\n* If one updates the SEQUENCE with SETVAL() or ALTER SEQUENCE ... RESTART,\nNEXT VALUE FOR will notice this and start from the next requested value.\n* FLUSH TABLES will close the sequence and the next sequence number generated\nwill be according to what\'s stored in the SEQUENCE object. In effect, this\nwill discard the cached values.\n* A server restart (or closing the current connection) also causes a drop of\nall cached values. The cached sequence numbers are reserved only for the\ncurrent connection.\n* NEXT VALUE requires the INSERT privilege.\n\nMariaDB starting with 10.3.3\n----------------------------\n* You can also use NEXT VALUE FOR sequence for column DEFAULT.\n\n\n\nURL: mariadb.com/kb/en/next-value-for-sequence_name/','','https://mariadb.com/kb/en/next-value-for-sequence_name/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (682,40,'NEXTVAL','NEXTVAL is a synonym for NEXT VALUE for sequence_name.\n\n\n\nURL: mariadb.com/kb/en/nextval/','','https://mariadb.com/kb/en/nextval/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (683,40,'PREVIOUS VALUE FOR sequence_name','MariaDB starting with 10.3\n--------------------------\nSEQUENCEs were introduced in MariaDB 10.3.\n\nSyntax\n------\n\nPREVIOUS VALUE FOR sequence_name\n\nor\n\nLASTVAL(sequence_name)\n\nor in Oracle mode (SQL_MODE=ORACLE)\n\nsequence_name.currval\n\nPREVIOUS VALUE FOR is IBM DB2 syntax while LASTVAL() is PostgreSQL syntax.\n\nDescription\n-----------\n\nGet last value in the current connection generated from a sequence.\n\n* If the sequence has not yet been used by the connection, PREVIOUS VALUE FOR\nreturns NULL (the same thing applies with a new connection which doesn\'t see a\nlast value for an existing sequence).\n* If a SEQUENCE has been dropped and re-created then it\'s treated as a new\nSEQUENCE and PREVIOUS VALUE FOR will return NULL.\n* FLUSH TABLES has no effect on PREVIOUS VALUE FOR.\n* Previous values for all used sequences are stored per connection until\nconnection ends.\n* PREVIOUS VALUE FOR requires the SELECT privilege.\n\nExample\n-------\n\nCREATE SEQUENCE s START WITH 100 INCREMENT BY 10;\n\nSELECT PREVIOUS VALUE FOR s;\n+----------------------+\n| PREVIOUS VALUE FOR s |\n+----------------------+\n| NULL |\n+----------------------+\n\n# The function works for sequences only, if the table is used an error is\ngenerated\nSELECT PREVIOUS VALUE FOR t;\nERROR 4089 (42S02): \'test.t\' is not a SEQUENCE\n\n# Call the NEXT VALUE FOR s:\nSELECT NEXT VALUE FOR s;\n+------------------+\n| NEXT VALUE FOR s |\n+------------------+\n| 100 |\n+------------------+\n\nSELECT PREVIOUS VALUE FOR s;\n+----------------------+\n| PREVIOUS VALUE FOR s |\n+----------------------+\n| 100 |\n+----------------------+\n\nNow try to start the new connection and check that the last value is still\nNULL, before updating the value in the new connection after the output of the\nnew connection gets current value (110 in the example below). Note that first\nconnection cannot see this change and the result of last value still remains\nthe same (100 in the example above).\n\n$ .mysql -uroot test -e"SELECT PREVIOUS VALUE FOR s; SELECT NEXT VALUE FOR s;\nSELECT PREVIOUS VALUE FOR s;"\n+----------------------+\n| PREVIOUS VALUE FOR s |\n+----------------------+\n| NULL |\n+----------------------+\n+------------------+\n| NEXT VALUE FOR s |\n+------------------+\n| 110 |\n+------------------+\n+----------------------+\n| PREVIOUS VALUE FOR s |\n+----------------------+\n| 110 |\n+----------------------+\n\n\n\nURL: mariadb.com/kb/en/previous-value-for-sequence_name/','','https://mariadb.com/kb/en/previous-value-for-sequence_name/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (684,40,'Sequence Overview','MariaDB starting with 10.3\n--------------------------\nSequences were introduced in MariaDB 10.3.\n\nIntroduction\n------------\n\nA sequence is an object that generates a sequence of numeric values, as\nspecified by the CREATE SEQUENCE statement.\n\nCREATE SEQUENCE will create a sequence that generates new values when called\nwith NEXT VALUE FOR sequence_name. It\'s an alternative to AUTO INCREMENT when\none wants to have more control of how the numbers are generated. As the\nSEQUENCE caches values (up to the CACHE value in the CREATE SEQUENCE\nstatement, by default 1000) it can in some cases be much faster than AUTO\nINCREMENT. Another benefit is that one can access the last value generated by\nall used sequences, which solves one of the limitations with LAST_INSERT_ID().\n\nCreating a Sequence\n-------------------\n\nThe CREATE SEQUENCE statement is used to create a sequence. Here is an example\nof a sequence starting at 100, incrementing by 10 each time:\n\nCREATE SEQUENCE s START WITH 100 INCREMENT BY 10;\n\nThe CREATE SEQUENCE statement, along with defaults, can be viewd with the SHOW\nCREATE SEQUENCE STATEMENT, for example:\n\nSHOW CREATE SEQUENCE s\G\n*************************** 1. row ***************************\n Table: s\nCreate Table: CREATE SEQUENCE `s` start with 100 minvalue 1 maxvalue\n9223372036854775806 \n increment by 10 cache 1000 nocycle ENGINE=InnoDB\n\nUsing Sequence Objects\n----------------------\n\nTo get the next value from a sequence, use\n\nNEXT VALUE FOR sequence_name\n\nor\n\nNEXTVAL(sequence_name)\n\nor in Oracle mode (SQL_MODE=ORACLE)\n\nsequence_name.nextval\n\nFor retrieving the last value used by the current connection from a sequence\nuse:\n\nPREVIOUS VALUE FOR sequence_name\n\nor\n\nLASTVAL(sequence_name)\n\nor in Oracle mode (SQL_MODE=ORACLE)\n\nsequence_name.currval\n\nFor example:\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n| 100 |\n+------------+\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n| 110 |\n+------------+\n\nSELECT LASTVAL(s);\n+------------+\n| LASTVAL(s) |\n+------------+\n| 110 |\n+------------+\n\nUsing Sequences in DEFAULT\n--------------------------\n\nMariaDB starting with 10.3.3\n----------------------------\nStarting from 10.3.3 you can use Sequences in DEFAULT:\n\ncreate sequence s1;\ncreate table t1 (a int primary key default (next value for s1), b int);\ninsert into t1 (b) values (1),(2);\nselect * from t1;\n+---+------+\n| a | b |\n+---+------+\n| 1 | 1 |\n| 2 | 2 |\n+---+------+\n\nChanging a Sequence\n-------------------\n\nThe ALTER SEQUENCE statement is used for changing sequences. For example, to\nrestart the sequence at another value:\n\nALTER SEQUENCE s RESTART 50;\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n| 50 |\n+------------+\n\nThe SETVAL function can also be used to set the next value to be returned for\na SEQUENCE, for example:\n\nSELECT SETVAL(s, 100);\n+----------------+\n| SETVAL(s, 100) |\n+----------------+\n| 100 |\n+----------------+\n\nSETVAL can only be used to increase the sequence value. Attempting to set a\nlower value will fail, returning NULL:\n\nSELECT SETVAL(s, 50);\n+---------------+\n| SETVAL(s, 50) |\n+---------------+\n| NULL |\n+---------------+\n\nDropping a Sequence\n-------------------\n\nThe DROP SEQUENCE statement is used to drop a sequence, for example:\n\nDROP SEQUENCE s;\n\nReplication\n-----------\n\nIf one wants to use Sequences in a master-master setup or with Galera one\nshould use INCREMENT=0. This will tell the Sequence to use\nauto_increment_increment and auto_increment_offset to generate unique values\nfor each server.\n\nStandards Compliance\n--------------------\n\nMariaDB 10.3 supports both ANSI SQL and Oracle syntax for sequences.\n\nHowever as SEQUENCE is implemented as a special kind of table, it uses the\nsame namespace as tables. The benefits are that sequences show up in SHOW\nTABLES, and one can also create a sequence with CREATE TABLE and drop it with\nDROP TABLE. One can SELECT from it as from any other table. This ensures that\nall old tools that work with tables should work with sequences.\n\nSince sequence objects act as regular tables in many contexts, they will be\naffected by LOCK TABLES. This is not the case in other DBMS, such as Oracle,\nwhere LOCK TABLE does not affect sequences.\n\nNotes\n-----\n\nOne of the goals with the Sequence implementation is that all old tools, such\nas mysqldump, should work unchanged, while still keeping the normal usage of\nsequence standard compatibly.\n\nTo make this possible, sequence is currently implemented as a table with a few\nexclusive properties.\n\nThe special properties for sequence tables are:\n\n* A sequence table has always one row.\n* When one creates a sequence, either with CREATE TABLE or CREATE SEQUENCE,\none row will be inserted.\n* If one tries to insert into a sequence table, the single row will be\nupdated. This allows mysqldump to work but also gives the additional benefit\nthat one can change all properties of a sequence with a single insert. New\napplications should of course also use ALTER SEQUENCE.\n* UPDATE or DELETE can\'t be performed on Sequence objects.\n* Doing a select on the sequence shows the current state of the sequence,\nexcept the values that are reserved in the cache. The next_value column shows\nthe next value not reserved by the cache.\n* FLUSH TABLES will close the sequence and the next sequence number generated\nwill be according to what\'s stored in the Sequence object. In effect, this\nwill discard the cached values.\n* A number of normal table operations work on Sequence tables. See next\nsection.\n\nTable Operations that Work with Sequences\n-----------------------------------------\n\n* SHOW CREATE TABLE sequence_name. This shows the table structure that is\nbehind the SEQUENCE including the field names that can be used with SELECT or\neven CREATE TABLE.\n* CREATE TABLE sequence-structure ... SEQUENCE=1\n* ALTER TABLE sequence RENAME TO sequence2\n* RENAME TABLE sequence_name TO new_sequence_name\n* DROP TABLE sequence_name. This is allowed mainly to get old tools like\nmysqldump to work with sequence tables.\n* SHOW TABLES\n\nImplementation\n--------------\n\nInternally, sequence tables are created as a normal table without rollback\n(the InnoDB, Aria and MySAM engines support this), wrapped by a sequence\nengine object. This allowed us to create sequences with almost no performance\nimpact for normal tables. (The cost is one \'if\' per insert if the binary log\nis enabled).\n\nUnderlying Table Structure\n--------------------------\n\nThe following example shows the table structure of sequences and how it can be\nused as a table. (Output of results are slightly edited to make them easier to\nread)\n\ncreate sequence t1;\nshow create sequence t1\G\n*************************** 1. row ***************************\n CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806\n increment by 1 cache 1000 nocycle ENGINE=InnoDB\n\nshow create table t1\G\n*************************** 1. row ***************************\nCreate Table: CREATE TABLE `t1` (\n `next_not_cached_value` bigint(21) NOT NULL,\n `minimum_value` bigint(21) NOT NULL,\n `maximum_value` bigint(21) NOT NULL,\n `start_value` bigint(21) NOT NULL COMMENT \'start value when sequences is\ncreated or value if RESTART is used\',\n `increment` bigint(21) NOT NULL COMMENT \'increment value\',\n `cache_size` bigint(21) unsigned NOT NULL,\n `cycle_option` tinyint(1) unsigned NOT NULL COMMENT \'0 if no cycles are\nallowed, 1 if the sequence should begin a new cycle when maximum_value is\npassed\',\n `cycle_count` bigint(21) NOT NULL COMMENT \'How many cycles have been done\'\n) ENGINE=InnoDB SEQUENCE=1\n\nselect * from t1\G\nnext_not_cached_value: 1\n minimum_value: 1\n maximum_value: 9223372036854775806\n start_value: 1\n increment: 1\n cache_size: 1000\n cycle_option: 0\n cycle_count: 0\n\nThe cycle_count column is incremented every time the sequence wraps around.\n\nCredits\n-------\n\n* Thanks to Jianwe Zhao from Aliyun for his work on SEQUENCE in AliSQL, which\ngave ideas and inspiration for this work.\n* Thanks to Peter Gulutzan,who helped test and gave useful comments about the\nimplementation.\n\n\n\nURL: mariadb.com/kb/en/sequence-overview/','','https://mariadb.com/kb/en/sequence-overview/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (685,40,'SETVAL()','MariaDB starting with 10.3.1\n----------------------------\nSEQUENCEs were introduced in MariaDB 10.3.\n\nSyntax\n------\n\nSETVAL(sequence_name, next_value, [is_used, [round]])\n\nDescription\n-----------\n\nSet the next value to be returned for a SEQUENCE.\n\nThis function is compatible with PostgreSQL syntax, extended with the round\nargument.\n\nIf the is_used argument is not given or is 1 or true, then the next used value\nwill one after the given value. If is_used is 0 or false then the next\ngenerated value will be the given value.\n\nIf round is used then it will set the round value (or the internal cycle\ncount, starting at zero) for the sequence. If round is not used, it\'s assumed\nto be 0.\n\nnext_value must be an integer literal.\n\nFor SEQUENCE tables defined with CYCLE (see CREATE SEQUENCE) one should use\nboth next_value and round to define the next value. In this case the current\nsequence value is defined to be round, next_value.\n\nThe result returned by SETVAL() is next_value or NULL if the given next_value\nand round is smaller than the current value.\n\nSETVAL() will not set the SEQUENCE value to a something that is less than its\ncurrent value. This is needed to ensure that SETVAL() is replication safe. If\nyou want to set the SEQUENCE to a smaller number use ALTER SEQUENCE.\n\nIf CYCLE is used, first round and then next_value are compared to see if the\nvalue is bigger than the current value.\n\nInternally, in the MariaDB server, SETVAL() is used to inform slaves that a\nSEQUENCE has changed value. The slave may get SETVAL() statements out of\norder, but this is ok as only the biggest one will have an effect.\n\nSETVAL requires the INSERT privilege.\n\nExamples\n--------\n\nSELECT setval(foo, 42); -- Next nextval will return 43\nSELECT setval(foo, 42, true); -- Same as above\nSELECT setval(foo, 42, false); -- Next nextval will return 42\n\nSETVAL setting higher and lower values on a sequence with an increment of 10:\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n| 50 |\n+------------+\n\nSELECT SETVAL(s, 100);\n+----------------+\n| SETVAL(s, 100) |\n+----------------+\n| 100 |\n+----------------+\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n| 110 |\n+------------+\n\nSELECT SETVAL(s, 50);\n+---------------+\n| SETVAL(s, 50) |\n+---------------+\n| NULL |\n+---------------+\n\nSELECT NEXTVAL(s);\n+------------+\n| NEXTVAL(s) |\n+------------+\n| 120 |\n+------------+\n\nExample demonstrating round:\n\nCREATE OR REPLACE SEQUENCE s1\n START WITH 1\n MINVALUE 1\n MAXVALUE 99\n INCREMENT BY 1\n CACHE 20\n CYCLE;\n\nSELECT SETVAL(s1, 99, 1, 0);\n+----------------------+\n| SETVAL(s1, 99, 1, 0) |\n+----------------------+\n| 99 |\n+----------------------+\n\nSELECT NEXTVAL(s1);\n+-------------+\n| NEXTVAL(s1) |\n+-------------+\n| 1 |\n+-------------+\n\nThe following statement returns NULL, as the given next_value and round is\nsmaller than the current value.\n\nSELECT SETVAL(s1, 99, 1, 0);\n+----------------------+\n| SETVAL(s1, 99, 1, 0) |\n+----------------------+\n| NULL |\n+----------------------+\n\nSELECT NEXTVAL(s1);\n+-------------+\n| NEXTVAL(s1) |\n+-------------+\n| 2 |\n+-------------+\n\nIncreasing the round from zero to 1 will allow next_value to be returned.\n\nSELECT SETVAL(s1, 99, 1, 1);\n+----------------------+\n| SETVAL(s1, 99, 1, 1) |\n+----------------------+\n| 99 |\n+----------------------+\n\nSELECT NEXTVAL(s1);\n+-------------+\n| NEXTVAL(s1) |\n+-------------+\n| 1 |\n+-------------+\n\n\n\nURL: mariadb.com/kb/en/setval/','','https://mariadb.com/kb/en/setval/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (686,41,'JSON_ARRAY','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_ARRAY([value[, value2] ...])\n\nDescription\n-----------\n\nReturns a JSON array containing the listed values. The list can be empty.\n\nExample\n-------\n\nSELECT Json_Array(56, 3.1416, \'My name is "Foo"\', NULL);\n+--------------------------------------------------+\n| Json_Array(56, 3.1416, \'My name is "Foo"\', NULL) |\n+--------------------------------------------------+\n| [56, 3.1416, "My name is \"Foo\"", null] |\n+--------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_array/','','https://mariadb.com/kb/en/json_array/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (687,41,'JSON_ARRAY_APPEND','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_ARRAY_APPEND(json_doc, path, value[, path, value] ...)\n\nDescription\n-----------\n\nAppends values to the end of the specified arrays within a JSON document,\nreturning the result, or NULL if any of the arguments are NULL.\n\nEvaluation is performed from left to right, with the resulting document from\nthe previous pair becoming the new value against which the next pair is\nevaluated.\n\nIf the json_doc is not a valid JSON document, or if any of the paths are not\nvalid, or contain a * or ** wildcard, an error is returned.\n\nExamples\n--------\n\nSET @json = \'[1, 2, [3, 4]]\';\n\nSELECT JSON_ARRAY_APPEND(@json, \'$[0]\', 5)\n+-------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$[0]\', 5) |\n+-------------------------------------+\n| [[1, 5], 2, [3, 4]] |\n+-------------------------------------+\n\nSELECT JSON_ARRAY_APPEND(@json, \'$[1]\', 6);\n+-------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$[1]\', 6) |\n+-------------------------------------+\n| [1, [2, 6], [3, 4]] |\n+-------------------------------------+\n\nSELECT JSON_ARRAY_APPEND(@json, \'$[1]\', 6, \'$[2]\', 7);\n+------------------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$[1]\', 6, \'$[2]\', 7) |\n+------------------------------------------------+\n| [1, [2, 6], [3, 4, 7]] |\n+------------------------------------------------+\n\nSELECT JSON_ARRAY_APPEND(@json, \'$\', 5);\n+----------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$\', 5) |\n+----------------------------------+\n| [1, 2, [3, 4], 5] |\n+----------------------------------+\n\nSET @json = \'{"A": 1, "B": [2], "C": [3, 4]}\';\n\nSELECT JSON_ARRAY_APPEND(@json, \'$.B\', 5);\n+------------------------------------+\n| JSON_ARRAY_APPEND(@json, \'$.B\', 5) |\n+------------------------------------+\n| {"A": 1, "B": [2, 5], "C": [3, 4]} |\n+------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_array_append/','','https://mariadb.com/kb/en/json_array_append/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (688,41,'JSON_ARRAY_INSERT','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_ARRAY_INSERT(json_doc, path, value[, path, value] ...)\n\nDescription\n-----------\n\nInserts a value into a JSON document, returning the modified document, or NULL\nif any of the arguments are NULL.\n\nEvaluation is performed from left to right, with the resulting document from\nthe previous pair becoming the new value against which the next pair is\nevaluated.\n\nIf the json_doc is not a valid JSON document, or if any of the paths are not\nvalid, or contain a * or ** wildcard, an error is returned.\n\nExamples\n--------\n\nSET @json = \'[1, 2, [3, 4]]\';\n\nSELECT JSON_ARRAY_INSERT(@json, \'$[0]\', 5);\n+-------------------------------------+\n| JSON_ARRAY_INSERT(@json, \'$[0]\', 5) |\n+-------------------------------------+\n| [5, 1, 2, [3, 4]] |\n+-------------------------------------+\n\nSELECT JSON_ARRAY_INSERT(@json, \'$[1]\', 6);\n+-------------------------------------+\n| JSON_ARRAY_INSERT(@json, \'$[1]\', 6) |\n+-------------------------------------+\n| [1, 6, 2, [3, 4]] |\n+-------------------------------------+\n\nSELECT JSON_ARRAY_INSERT(@json, \'$[1]\', 6, \'$[2]\', 7);\n+------------------------------------------------+\n| JSON_ARRAY_INSERT(@json, \'$[1]\', 6, \'$[2]\', 7) |\n+------------------------------------------------+\n| [1, 6, 7, 2, [3, 4]] |\n+------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_array_insert/','','https://mariadb.com/kb/en/json_array_insert/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (689,41,'JSON_COMPACT','MariaDB starting with 10.2.4\n----------------------------\nThis function was added in MariaDB 10.2.4.\n\nSyntax\n------\n\nJSON_COMPACT(json_doc)\n\nDescription\n-----------\n\nRemoves all unnecessary spaces so the json document is as short as possible.\n\nExample\n-------\n\nSET @j = \'{ "A": 1, "B": [2, 3]}\';\n\nSELECT JSON_COMPACT(@j), @j;\n+-------------------+------------------------+\n| JSON_COMPACT(@j) | @j |\n+-------------------+------------------------+\n| {"A":1,"B":[2,3]} | { "A": 1, "B": [2, 3]} |\n+-------------------+------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_compact/','','https://mariadb.com/kb/en/json_compact/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (690,41,'JSON_CONTAINS','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_CONTAINS(json_doc, val[, path])\n\nDescription\n-----------\n\nReturns whether or not the specified value is found in the given JSON document\nor, optionally, at the specified path within the document. Returns 1 if it\ndoes, 0 if not and NULL if any of the arguments are null. An error occurs if\nthe document or path is not valid, or contains the * or ** wildcards.\n\nExamples\n--------\n\nSET @json = \'{"A": 0, "B": {"C": 1}, "D": 2}\';\n\nSELECT JSON_CONTAINS(@json, \'2\', \'$.A\');\n+----------------------------------+\n| JSON_CONTAINS(@json, \'2\', \'$.A\') |\n+----------------------------------+\n| 0 |\n+----------------------------------+\n\nSELECT JSON_CONTAINS(@json, \'2\', \'$.D\');\n+----------------------------------+\n| JSON_CONTAINS(@json, \'2\', \'$.D\') |\n+----------------------------------+\n| 1 |\n+----------------------------------+\n\nSELECT JSON_CONTAINS(@json, \'{"C": 1}\', \'$.A\');\n+-----------------------------------------+\n| JSON_CONTAINS(@json, \'{"C": 1}\', \'$.A\') |\n+-----------------------------------------+\n| 0 |\n+-----------------------------------------+\n\nSELECT JSON_CONTAINS(@json, \'{"C": 1}\', \'$.B\');\n+-----------------------------------------+\n| JSON_CONTAINS(@json, \'{"C": 1}\', \'$.B\') |\n+-----------------------------------------+\n| 1 |\n+-----------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_contains/','','https://mariadb.com/kb/en/json_contains/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (691,41,'JSON_CONTAINS_PATH','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_CONTAINS_PATH(json_doc, return_arg, path[, path] ...)\n\nDescription\n-----------\n\nIndicates whether the given JSON document contains data at the specified path\nor paths. Returns 1 if it does, 0 if not and NULL if any of the arguments are\nnull.\n\nThe return_arg can be one or all:\n\n* one - Returns 1 if at least one path exists within the JSON document. \n* all - Returns 1 only if all paths exist within the JSON document.\n\nExamples\n--------\n\nSET @json = \'{"A": 1, "B": [2], "C": [3, 4]}\';\n\nSELECT JSON_CONTAINS_PATH(@json, \'one\', \'$.A\', \'$.D\');\n+------------------------------------------------+\n| JSON_CONTAINS_PATH(@json, \'one\', \'$.A\', \'$.D\') |\n+------------------------------------------------+\n| 1 |\n+------------------------------------------------+\n1 row in set (0.00 sec)\n\nSELECT JSON_CONTAINS_PATH(@json, \'all\', \'$.A\', \'$.D\');\n+------------------------------------------------+\n| JSON_CONTAINS_PATH(@json, \'all\', \'$.A\', \'$.D\') |\n+------------------------------------------------+\n| 0 |\n+------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_contains_path/','','https://mariadb.com/kb/en/json_contains_path/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (692,41,'JSON_DEPTH','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_DEPTH(json_doc)\n\nDescription\n-----------\n\nReturns the maximum depth of the given JSON document, or NULL if the argument\nis null. An error will occur if the argument is an invalid JSON document.\n\n* Scalar values or empty arrays or objects have a depth of 1.\n* Arrays or objects that are not empty but contain only elements or member\nvalues of depth 1 will have a depth of 2.\n* In other cases, the depth will be greater than 2.\n\nExamples\n--------\n\nSELECT JSON_DEPTH(\'[]\'), JSON_DEPTH(\'true\'), JSON_DEPTH(\'{}\');\n+------------------+--------------------+------------------+\n| JSON_DEPTH(\'[]\') | JSON_DEPTH(\'true\') | JSON_DEPTH(\'{}\') |\n+------------------+--------------------+------------------+\n| 1 | 1 | 1 |\n+------------------+--------------------+------------------+\n\nSELECT JSON_DEPTH(\'[1, 2, 3]\'), JSON_DEPTH(\'[[], {}, []]\');\n+-------------------------+----------------------------+\n| JSON_DEPTH(\'[1, 2, 3]\') | JSON_DEPTH(\'[[], {}, []]\') |\n+-------------------------+----------------------------+\n| 2 | 2 |\n+-------------------------+----------------------------+\n\nSELECT JSON_DEPTH(\'[1, 2, [3, 4, 5, 6], 7]\');\n+---------------------------------------+\n| JSON_DEPTH(\'[1, 2, [3, 4, 5, 6], 7]\') |\n+---------------------------------------+\n| 3 |\n+---------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_depth/','','https://mariadb.com/kb/en/json_depth/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (693,41,'JSON_DETAILED','MariaDB starting with 10.2.4\n----------------------------\nThis function was added in MariaDB 10.2.4.\n\nSyntax\n------\n\nJSON_DETAILED(json_doc[, tab_size])\n\nDescription\n-----------\n\nRepresents JSON in the most understandable way emphasizing nested structures.\n\nExample\n-------\n\nSET @j = \'{ "A":1,"B":[2,3]}\';\n\nSELECT @j;\n+--------------------+\n| @j |\n+--------------------+\n| { "A":1,"B":[2,3]} |\n+--------------------+\n\nSELECT JSON_DETAILED(@j);\n+------------------------------------------------------------+\n| JSON_DETAILED(@j) |\n+------------------------------------------------------------+\n| {\n "A": 1,\n "B":\n [\n 2,\n 3\n ]\n} |\n+------------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_detailed/','','https://mariadb.com/kb/en/json_detailed/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (694,41,'JSON_EXISTS','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nDescription\n-----------\n\nDetermines whether a specified JSON value exists in the given data. Returns 1\nif found, 0 if not, or NULL if any of the inputs were NULL.\n\nExamples\n--------\n\nSELECT JSON_EXISTS(\'{"key1":"xxxx", "key2":[1, 2, 3]}\', "$.key2");\n+------------------------------------------------------------+\n| JSON_EXISTS(\'{"key1":"xxxx", "key2":[1, 2, 3]}\', "$.key2") |\n+------------------------------------------------------------+\n| 1 |\n+------------------------------------------------------------+\n\nSELECT JSON_EXISTS(\'{"key1":"xxxx", "key2":[1, 2, 3]}\', "$.key3");\n+------------------------------------------------------------+\n| JSON_EXISTS(\'{"key1":"xxxx", "key2":[1, 2, 3]}\', "$.key3") |\n+------------------------------------------------------------+\n| 0 |\n+------------------------------------------------------------+\n\nSELECT JSON_EXISTS(\'{"key1":"xxxx", "key2":[1, 2, 3]}\', "$.key2[1]");\n+---------------------------------------------------------------+\n| JSON_EXISTS(\'{"key1":"xxxx", "key2":[1, 2, 3]}\', "$.key2[1]") |\n+---------------------------------------------------------------+\n| 1 |\n+---------------------------------------------------------------+\n\nSELECT JSON_EXISTS(\'{"key1":"xxxx", "key2":[1, 2, 3]}\', "$.key2[10]");\n+----------------------------------------------------------------+\n| JSON_EXISTS(\'{"key1":"xxxx", "key2":[1, 2, 3]}\', "$.key2[10]") |\n+----------------------------------------------------------------+\n| 0 |\n+----------------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_exists/','','https://mariadb.com/kb/en/json_exists/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (695,41,'JSON_EXTRACT','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_EXTRACT(json_doc, path[, path] ...)\n\nDescription\n-----------\n\nExtracts data from a JSON document. The extracted data is selected from the\nparts matching the path arguments. Returns all matched values; either as a\nsingle matched value, or, if the arguments could return multiple values, a\nresult autowrapped as an array in the matching order.\n\nReturns NULL if no paths match or if any of the arguments are NULL.\n\nAn error will occur if any path argument is not a valid path, or if the\njson_doc argument is not a valid JSON document.\n\nThe path expression be a JSONPath expression as supported by MariaDB\n\nExamples\n--------\n\nSET @json = \'[1, 2, [3, 4]]\';\n\nSELECT JSON_EXTRACT(@json, \'$[1]\');\n+-----------------------------+\n| JSON_EXTRACT(@json, \'$[1]\') |\n+-----------------------------+\n| 2 |\n+-----------------------------+\n\nSELECT JSON_EXTRACT(@json, \'$[2]\');\n+-----------------------------+\n| JSON_EXTRACT(@json, \'$[2]\') |\n+-----------------------------+\n| [3, 4] |\n+-----------------------------+\n\nSELECT JSON_EXTRACT(@json, \'$[2][1]\');\n+--------------------------------+\n| JSON_EXTRACT(@json, \'$[2][1]\') |\n+--------------------------------+\n| 4 |\n+--------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_extract/','','https://mariadb.com/kb/en/json_extract/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (696,41,'JSON_INSERT','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_INSERT(json_doc, path, val[, path, val] ...)\n\nDescription\n-----------\n\nInserts data into a JSON document, returning the resulting document or NULL if\nany argument is null.\n\nAn error will occur if the JSON document is not invalid, or if any of the\npaths are invalid or contain a * or ** wildcard.\n\nJSON_INSERT can only insert data while JSON_REPLACE can only update. JSON_SET\ncan update or insert data.\n\nExamples\n--------\n\nSET @json = \'{ "A": 0, "B": [1, 2]}\';\n\nSELECT JSON_INSERT(@json, \'$.C\', \'[3, 4]\');\n+--------------------------------------+\n| JSON_INSERT(@json, \'$.C\', \'[3, 4]\') |\n+--------------------------------------+\n| { "A": 0, "B": [1, 2], "C":"[3, 4]"} |\n+--------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_insert/','','https://mariadb.com/kb/en/json_insert/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (697,41,'JSON_KEYS','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_KEYS(json_doc[, path])\n\nDescription\n-----------\n\nReturns the keys as a JSON array from the top-level value of a JSON object or,\nif the optional path argument is provided, the top-level keys from the path.\n\nExcludes keys from nested sub-objects in the top level value. The resulting\narray will be empty if the selected object is empty.\n\nReturns NULL if any of the arguments are null, a given path does not locate an\nobject, or if the json_doc argument is not an object.\n\nAn error will occur if JSON document is invalid, the path is invalid or if the\npath contains a * or ** wildcard.\n\nExamples\n--------\n\nSELECT JSON_KEYS(\'{"A": 1, "B": {"C": 2}}\');\n+--------------------------------------+\n| JSON_KEYS(\'{"A": 1, "B": {"C": 2}}\') |\n+--------------------------------------+\n| ["A", "B"] |\n+--------------------------------------+\n\nSELECT JSON_KEYS(\'{"A": 1, "B": 2, "C": {"D": 3}}\', \'$.C\');\n+-----------------------------------------------------+\n| JSON_KEYS(\'{"A": 1, "B": 2, "C": {"D": 3}}\', \'$.C\') |\n+-----------------------------------------------------+\n| ["D"] |\n+-----------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_keys/','','https://mariadb.com/kb/en/json_keys/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (698,41,'JSON_LENGTH','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_LENGTH(json_doc[, path])\n\nDescription\n-----------\n\nReturns the length of a JSON document, or, if the optional path argument is\ngiven, the length of the value within the document specified by the path.\n\nReturns NULL if any of the arguments argument are null or the path argument\ndoes not identify a value in the document.\n\nAn error will occur if the JSON document is invalid, the path is invalid or if\nthe path contains a * or ** wildcard.\n\nLength will be determined as follow:\n\n* A scalar\'s length is always 1.\n* If an array, the number of elements in the array.\n* If an object, the number of members in the object.\n\nThe length of nested arrays or objects are not counted.\n\nExamples\n--------\n\n\n\nURL: mariadb.com/kb/en/json_length/','','https://mariadb.com/kb/en/json_length/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (699,41,'JSON_LOOSE','MariaDB starting with 10.2.4\n----------------------------\nThis function was added in MariaDB 10.2.4.\n\nSyntax\n------\n\nJSON_LOOSE(json_doc)\n\nDescription\n-----------\n\nAdds spaces to a JSON document to make it look more readable.\n\nExample\n-------\n\nSET @j = \'{ "A":1,"B":[2,3]}\';\n\nSELECT JSON_LOOSE(@j), @j;\n+-----------------------+--------------------+\n| JSON_LOOSE(@j) | @j |\n+-----------------------+--------------------+\n| {"A": 1, "B": [2, 3]} | { "A":1,"B":[2,3]} |\n+-----------------------+--------------------+\n\n\n\nURL: mariadb.com/kb/en/json_loose/','','https://mariadb.com/kb/en/json_loose/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (700,41,'JSON_MERGE','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_MERGE(json_doc, json_doc[, json_doc] ...)\n\nDescription\n-----------\n\nMerges the given JSON documents.\n\nReturns the merged result,or NULL if any argument is NULL.\n\nAn error occurs if any of the arguments are not valid JSON documents.\n\nJSON_MERGE has been deprecated since MariaDB 10.2.25, MariaDB 10.3.16 and\nMariaDB 10.4.5. JSON_MERGE_PATCH is an RFC 7396-compliant replacement, and\nJSON_MERGE_PRESERVE is a synonym.\n\nExample\n-------\n\nSET @json1 = \'[1, 2]\';\nSET @json2 = \'[3, 4]\';\n\nSELECT JSON_MERGE(@json1,@json2);\n+---------------------------+\n| JSON_MERGE(@json1,@json2) |\n+---------------------------+\n| [1, 2, 3, 4] |\n+---------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_merge/','','https://mariadb.com/kb/en/json_merge/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (701,41,'JSON_OBJECT','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_OBJECT([key, value[, key, value] ...])\n\nDescription\n-----------\n\nReturns a JSON object containing the given key/value pairs. The key/value list\ncan be empty.\n\nAn error will occur if there are an odd number of arguments, or any key name\nis NULL.\n\nExample\n-------\n\nSELECT JSON_OBJECT("id", 1, "name", "Monty");\n+---------------------------------------+\n| JSON_OBJECT("id", 1, "name", "Monty") |\n+---------------------------------------+\n| {"id": 1, "name": "Monty"} |\n+---------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_object/','','https://mariadb.com/kb/en/json_object/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (702,41,'JSON_QUERY','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_QUERY(json_doc, path)\n\nDescription\n-----------\n\nGiven a JSON document, returns an object or array specified by the path.\nReturns NULL if not given a valid JSON document, or if there is no match.\n\nExamples\n--------\n\nselect json_query(\'{"key1":{"a":1, "b":[1,2]}}\', \'$.key1\');\n+-----------------------------------------------------+\n| json_query(\'{"key1":{"a":1, "b":[1,2]}}\', \'$.key1\') |\n+-----------------------------------------------------+\n| {"a":1, "b":[1,2]} |\n+-----------------------------------------------------+\n\nselect json_query(\'{"key1":123, "key1": [1,2,3]}\', \'$.key1\');\n+-------------------------------------------------------+\n| json_query(\'{"key1":123, "key1": [1,2,3]}\', \'$.key1\') |\n+-------------------------------------------------------+\n| [1,2,3] |\n+-------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_query/','','https://mariadb.com/kb/en/json_query/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (703,41,'JSON_QUOTE','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_QUOTE(json_value)\n\nDescription\n-----------\n\nQuotes a string as a JSON value, usually for producing valid JSON string\nliterals for inclusion in JSON documents. Wraps the string with double quote\ncharacters and escapes interior quotes and other special characters, returning\na utf8mb4 string.\n\nReturns NULL if the argument is NULL.\n\nExamples\n--------\n\nSELECT JSON_QUOTE(\'A\'), JSON_QUOTE("B"), JSON_QUOTE(\'"C"\');\n+-----------------+-----------------+-------------------+\n| JSON_QUOTE(\'A\') | JSON_QUOTE("B") | JSON_QUOTE(\'"C"\') |\n+-----------------+-----------------+-------------------+\n| "A" | "B" | "\"C\"" |\n+-----------------+-----------------+-------------------+\n\n\n\nURL: mariadb.com/kb/en/json_quote/','','https://mariadb.com/kb/en/json_quote/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (704,41,'JSON_REMOVE','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_REMOVE(json_doc, path[, path] ...)\n\nDescription\n-----------\n\nRemoves data from a JSON document returning the result, or NULL if any of the\narguments are null. If the element does not exist in the document, no changes\nare made.\n\nAn error will occur if JSON document is invalid, the path is invalid or if the\npath contains a * or ** wildcard.\n\nPath arguments are evaluated from left to right, with the result from the\nearlier evaluation being used as the value for the next.\n\nExamples\n--------\n\nSELECT JSON_REMOVE(\'{"A": 1, "B": 2, "C": {"D": 3}}\', \'$.C\');\n+-------------------------------------------------------+\n| JSON_REMOVE(\'{"A": 1, "B": 2, "C": {"D": 3}}\', \'$.C\') |\n+-------------------------------------------------------+\n| {"A": 1, "B": 2} |\n+-------------------------------------------------------+\n\nSELECT JSON_REMOVE(\'["A", "B", ["C", "D"], "E"]\', \'$[1]\');\n+----------------------------------------------------+\n| JSON_REMOVE(\'["A", "B", ["C", "D"], "E"]\', \'$[1]\') |\n+----------------------------------------------------+\n| ["A", ["C", "D"], "E"] |\n+----------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_remove/','','https://mariadb.com/kb/en/json_remove/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (705,41,'JSON_REPLACE','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_REPLACE(json_doc, path, val[, path, val] ...)\n\nDescription\n-----------\n\nReplaces existing values in a JSON document, returning the result, or NULL if\nany of the arguments are NULL.\n\nAn error will occur if the JSON document is invalid, the path is invalid or if\nthe path contains a * or ** wildcard.\n\nPaths and values are evaluated from left to right, with the result from the\nearlier evaluation being used as the value for the next.\n\nJSON_REPLACE can only update data, while JSON_INSERT can only insert. JSON_SET\ncan update or insert data.\n\nExamples\n--------\n\nSELECT JSON_REPLACE(\'{ "A": 1, "B": [2, 3]}\', \'$.B[1]\', 4);\n+-----------------------------------------------------+\n| JSON_REPLACE(\'{ "A": 1, "B": [2, 3]}\', \'$.B[1]\', 4) |\n+-----------------------------------------------------+\n| { "A": 1, "B": [2, 4]} |\n+-----------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_replace/','','https://mariadb.com/kb/en/json_replace/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (706,41,'JSON_SEARCH','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_SEARCH(json_doc, return_arg, search_str[, escape_char[, path] ...])\n\nDescription\n-----------\n\nReturns the path to the given string within a JSON document, or NULL if any of\njson_doc, search_str or a path argument is NULL; if the search string is not\nfound, or if no path exists within the document.\n\nA warning will occur if the JSON document is not valid, any of the path\narguments are not valid, if return_arg is neither one nor all, or if the\nescape character is not a constant. NULL will be returned.\n\nreturn_arg can be one of two values:\n\n* \'one: Terminates after finding the first match, so will return one path\nstring. If there is more than one match, it is undefined which is considered\nfirst.\n* all: Returns all matching path strings, without duplicates. Multiple strings\nare autowrapped as an array. The order is undefined.\n\nExamples\n--------\n\nSET @json = \'["A", [{"B": "1"}], {"C":"AB"}, {"D":"BC"}]\';\n\nSELECT JSON_SEARCH(@json, \'one\', \'AB\');\n+---------------------------------+\n| JSON_SEARCH(@json, \'one\', \'AB\') |\n+---------------------------------+\n| "$[2].C" |\n+---------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_search/','','https://mariadb.com/kb/en/json_search/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (707,41,'JSON_SET','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_SET(json_doc, path, val[, path, val] ...)\n\nDescription\n-----------\n\nUpdates or inserts data into a JSON document, returning the result, or NULL if\nany of the arguments are NULL or the optional path fails to find an object.\n\nAn error will occur if the JSON document is invalid, the path is invalid or if\nthe path contains a * or wildcard.\n\nJSON_SET can update or insert data, while JSON_REPLACE can only update, and\nJSON_INSERT only insert.\n\nExamples\n--------\n\nSELECT JSON_SET(Priv, \'$.locked\', \'true\') FROM mysql.global_priv\n\n\n\nURL: mariadb.com/kb/en/json_set/','','https://mariadb.com/kb/en/json_set/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (708,41,'JSON_TYPE','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_TYPE(json_val)\n\nDescription\n-----------\n\nReturns the type of a JSON value (as a string), or NULL if the argument is\nnull.\n\nAn error will occur if the argument is an invalid JSON value.\n\nThe following is a complete list of the possible return types:\n\n+-----------------------------------+-----------------+-----------------------+\n| Return type | Value | Example |\n+-----------------------------------+-----------------+-----------------------+\n| ARRAY | JSON array | [1, 2, {"key": |\n| | | "value"}] |\n+-----------------------------------+-----------------+-----------------------+\n| OBJECT | JSON object | {"key":"value"} |\n+-----------------------------------+-----------------+-----------------------+\n| BOOLEAN | JSON | true, false |\n| | true/false | |\n| | literals | |\n+-----------------------------------+-----------------+-----------------------+\n| DOUBLE | A number with | 1.2 |\n| | at least one | |\n| | floating point | |\n| | decimal. | |\n+-----------------------------------+-----------------+-----------------------+\n| INTEGER | A number | 1 |\n| | without a | |\n| | floating point | |\n| | decimal. | |\n+-----------------------------------+-----------------+-----------------------+\n| NULL | JSON null | null |\n| | literal (this | |\n| | is returned as | |\n| | a string, not | |\n| | to be confused | |\n| | with the SQL | |\n| | NULL value!) | |\n+-----------------------------------+-----------------+-----------------------+\n| STRING | JSON String | "a sample string" |\n+-----------------------------------+-----------------+-----------------------+\n\nExamples\n--------\n\nSELECT JSON_TYPE(\'{"A": 1, "B": 2, "C": 3}\');\n+---------------------------------------+\n| JSON_TYPE(\'{"A": 1, "B": 2, "C": 3}\') |\n+---------------------------------------+\n| OBJECT |\n+---------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_type/','','https://mariadb.com/kb/en/json_type/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (709,41,'JSON_UNQUOTE','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_UNQUOTE(val)\n\nDescription\n-----------\n\nUnquotes a JSON value, returning a string, or NULL if the argument is null.\n\nAn error will occur if the given value begins and ends with double quotes and\nis an invalid JSON string literal.\n\nIf the given value is not a JSON string, value is passed through unmodified.\n\nCertain character sequences have special meanings within a string. Usually, a\nbackslash is ignored, but the escape sequences in the table below are\nrecognised by MariaDB, unless the SQL Mode is set to NO_BACKSLASH_ESCAPES SQL.\n\n+-----------------------------------------------+-----------------------------+\n| Escape sequence | Character |\n+-----------------------------------------------+-----------------------------+\n| \" | Double quote (") |\n+-----------------------------------------------+-----------------------------+\n| \b | Backslash |\n+-----------------------------------------------+-----------------------------+\n| \f | Formfeed |\n+-----------------------------------------------+-----------------------------+\n| \n | Newline (linefeed) |\n+-----------------------------------------------+-----------------------------+\n| \r | Carriage return |\n+-----------------------------------------------+-----------------------------+\n| \t | Tab |\n+-----------------------------------------------+-----------------------------+\n| \\\\ | Backslash (\) |\n+-----------------------------------------------+-----------------------------+\n| \uXXXX | UTF-8 bytes for Unicode |\n| | value XXXX |\n+-----------------------------------------------+-----------------------------+\n\nExamples\n--------\n\nSELECT JSON_UNQUOTE(\'"Monty"\');\n+-------------------------+\n| JSON_UNQUOTE(\'"Monty"\') |\n+-------------------------+\n| Monty |\n+-------------------------+\n\nWith the default SQL Mode:\n\nSELECT JSON_UNQUOTE(\'Si\bng\ting\');\n+-----------------------------+\n| JSON_UNQUOTE(\'Si\bng\ting\') |\n+-----------------------------+\n| Sng ing |\n+-----------------------------+\n\nSetting NO_BACKSLASH_ESCAPES:\n\nSET @@sql_mode = \'NO_BACKSLASH_ESCAPES\';\n\nSELECT JSON_UNQUOTE(\'Si\bng\ting\');\n+-----------------------------+\n| JSON_UNQUOTE(\'Si\bng\ting\') |\n+-----------------------------+\n| Si\bng\ting |\n+-----------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_unquote/','','https://mariadb.com/kb/en/json_unquote/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (710,41,'JSON_VALID','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_VALID(value)\n\nDescription\n-----------\n\nIndicates whether the given value is a valid JSON document or not. Returns 1\nif valid, 0 if not, and NULL if the argument is NULL.\n\nFrom MariaDB 10.4.3, the JSON_VALID function is automatically used as a CHECK\nconstraint for the JSON data type alias in order to ensure that a valid json\ndocument is inserted.\n\nExamples\n--------\n\nSELECT JSON_VALID(\'{"id": 1, "name": "Monty"}\');\n+------------------------------------------+\n| JSON_VALID(\'{"id": 1, "name": "Monty"}\') |\n+------------------------------------------+\n| 1 |\n+------------------------------------------+\n\nSELECT JSON_VALID(\'{"id": 1, "name": "Monty", "oddfield"}\');\n+------------------------------------------------------+\n| JSON_VALID(\'{"id": 1, "name": "Monty", "oddfield"}\') |\n+------------------------------------------------------+\n| 0 |\n+------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/json_valid/','','https://mariadb.com/kb/en/json_valid/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (711,41,'JSON_VALUE','MariaDB starting with 10.2.3\n----------------------------\nJSON functions were added in MariaDB 10.2.3.\n\nSyntax\n------\n\nJSON_VALUE(json_doc, path)\n\nDescription\n-----------\n\nGiven a JSON document, returns the scalar specified by the path. Returns NULL\nif not given a valid JSON document, or if there is no match.\n\nExamples\n--------\n\nselect json_value(\'{"key1":123}\', \'$.key1\');\n+--------------------------------------+\n| json_value(\'{"key1":123}\', \'$.key1\') |\n+--------------------------------------+\n| 123 |\n+--------------------------------------+\n\nselect json_value(\'{"key1": [1,2,3], "key1":123}\', \'$.key1\');\n+-------------------------------------------------------+\n| json_value(\'{"key1": [1,2,3], "key1":123}\', \'$.key1\') |\n+-------------------------------------------------------+\n| 123 |\n+-------------------------------------------------------+\n\nIn the SET statement below, two escape characters are needed, as a single\nescape character would be applied by the SQL parser in the SET statement, and\nthe escaped character would not form part of the saved value.\n\nSET @json = \'{"key1":"60\\\\" Table", "key2":"1"}\';\n\nSELECT JSON_VALUE(@json,\'$.key1\') AS Name , json_value(@json,\'$.key2\') as ID;\n+-----------+------+\n| Name | ID |\n+-----------+------+\n| 60" Table | 1 |\n+-----------+------+\n\n\n\nURL: mariadb.com/kb/en/json_value/','','https://mariadb.com/kb/en/json_value/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (712,42,'CUME_DIST','MariaDB starting with 10.2\n--------------------------\nThe CUME_DIST() function was first introduced with window functions in MariaDB\n10.2.0.\n\nSyntax\n------\n\nCUME_DIST() OVER ( \n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nCUME_DIST() is a window function that returns the cumulative distribution of a\ngiven row. The following formula is used to calculate the value:\n\n(number of rows <= current row) / (total rows)\n\nExamples\n--------\n\ncreate table t1 (\n pk int primary key,\n a int,\n b int\n);\n\ninsert into t1 values\n( 1 , 0, 10),\n( 2 , 0, 10),\n( 3 , 1, 10),\n( 4 , 1, 10),\n( 8 , 2, 10),\n( 5 , 2, 20),\n( 6 , 2, 20),\n( 7 , 2, 20),\n( 9 , 4, 20),\n(10 , 4, 20);\n\nselect pk, a, b,\n rank() over (order by a) as rank,\n percent_rank() over (order by a) as pct_rank,\n cume_dist() over (order by a) as cume_dist\nfrom t1;\n+----+------+------+------+--------------+--------------+\n| pk | a | b | rank | pct_rank | cume_dist |\n+----+------+------+------+--------------+--------------+\n| 1 | 0 | 10 | 1 | 0.0000000000 | 0.2000000000 |\n| 2 | 0 | 10 | 1 | 0.0000000000 | 0.2000000000 |\n| 3 | 1 | 10 | 3 | 0.2222222222 | 0.4000000000 |\n| 4 | 1 | 10 | 3 | 0.2222222222 | 0.4000000000 |\n| 5 | 2 | 20 | 5 | 0.4444444444 | 0.8000000000 |\n| 6 | 2 | 20 | 5 | 0.4444444444 | 0.8000000000 |\n| 7 | 2 | 20 | 5 | 0.4444444444 | 0.8000000000 |\n| 8 | 2 | 10 | 5 | 0.4444444444 | 0.8000000000 |\n| 9 | 4 | 20 | 9 | 0.8888888889 | 1.0000000000 |\n| 10 | 4 | 20 | 9 | 0.8888888889 | 1.0000000000 |\n+----+------+------+------+--------------+--------------+\n\nselect pk, a, b,\n percent_rank() over (order by pk) as pct_rank,\n cume_dist() over (order by pk) as cume_dist\nfrom t1 order by pk;\n+----+------+------+--------------+--------------+\n| pk | a | b | pct_rank | cume_dist |\n+----+------+------+--------------+--------------+\n| 1 | 0 | 10 | 0.0000000000 | 0.1000000000 |\n| 2 | 0 | 10 | 0.1111111111 | 0.2000000000 |\n| 3 | 1 | 10 | 0.2222222222 | 0.3000000000 |\n| 4 | 1 | 10 | 0.3333333333 | 0.4000000000 |\n| 5 | 2 | 20 | 0.4444444444 | 0.5000000000 |\n| 6 | 2 | 20 | 0.5555555556 | 0.6000000000 |\n| 7 | 2 | 20 | 0.6666666667 | 0.7000000000 |\n| 8 | 2 | 10 | 0.7777777778 | 0.8000000000 |\n| 9 | 4 | 20 | 0.8888888889 | 0.9000000000 |\n| 10 | 4 | 20 | 1.0000000000 | 1.0000000000 |\n+----+------+------+--------------+--------------+\n\nselect pk, a, b,\n percent_rank() over (partition by a order by a) as pct_rank,\n cume_dist() over (partition by a order by a) as cume_dist\nfrom t1;\n+----+------+------+--------------+--------------+\n| pk | a | b | pct_rank | cume_dist |\n+----+------+------+--------------+--------------+\n| 1 | 0 | 10 | 0.0000000000 | 1.0000000000 |\n| 2 | 0 | 10 | 0.0000000000 | 1.0000000000 |\n| 3 | 1 | 10 | 0.0000000000 | 1.0000000000 |\n| 4 | 1 | 10 | 0.0000000000 | 1.0000000000 |\n| 5 | 2 | 20 | 0.0000000000 | 1.0000000000 |\n| 6 | 2 | 20 | 0.0000000000 | 1.0000000000 |\n| 7 | 2 | 20 | 0.0000000000 | 1.0000000000 |\n| 8 | 2 | 10 | 0.0000000000 | 1.0000000000 |\n| 9 | 4 | 20 | 0.0000000000 | 1.0000000000 |\n| 10 | 4 | 20 | 0.0000000000 | 1.0000000000 |\n+----+------+------+--------------+--------------+\n\n\n\nURL: mariadb.com/kb/en/cume_dist/','','https://mariadb.com/kb/en/cume_dist/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (713,42,'DENSE_RANK','MariaDB starting with 10.2\n--------------------------\nThe DENSE_RANK() function was first introduced with window functions in\nMariaDB 10.2.0.\n\nSyntax\n------\n\nDENSE_RANK() OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nDENSE_RANK() is a window function that displays the number of a given row,\nstarting at one and following the ORDER BY sequence of the window function,\nwith identical values receiving the same result. Unlike the RANK() function,\nthere are no skipped values if the preceding results are identical. It is also\nsimilar to the ROW_NUMBER() function except that in that function, identical\nvalues will receive a different row number for each result.\n\nExamples\n--------\n\nThe distinction between DENSE_RANK(), RANK() and ROW_NUMBER():\n\nCREATE TABLE student(course VARCHAR(10), mark int, name varchar(10));\n\nINSERT INTO student VALUES \n (\'Maths\', 60, \'Thulile\'),\n (\'Maths\', 60, \'Pritha\'),\n (\'Maths\', 70, \'Voitto\'),\n (\'Maths\', 55, \'Chun\'),\n (\'Biology\', 60, \'Bilal\'),\n (\'Biology\', 70, \'Roger\');\n\nSELECT \n RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS rank,\n DENSE_RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS dense_rank,\n ROW_NUMBER() OVER (PARTITION BY course ORDER BY mark DESC) AS row_num,\n course, mark, name\nFROM student ORDER BY course, mark DESC;\n+------+------------+---------+---------+------+---------+\n| rank | dense_rank | row_num | course | mark | name |\n+------+------------+---------+---------+------+---------+\n| 1 | 1 | 1 | Biology | 70 | Roger |\n| 2 | 2 | 2 | Biology | 60 | Bilal |\n| 1 | 1 | 1 | Maths | 70 | Voitto |\n| 2 | 2 | 2 | Maths | 60 | Thulile |\n| 2 | 2 | 3 | Maths | 60 | Pritha |\n| 4 | 3 | 4 | Maths | 55 | Chun |\n+------+------------+---------+---------+------+---------+\n\n\n\nURL: mariadb.com/kb/en/dense_rank/','','https://mariadb.com/kb/en/dense_rank/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (714,42,'FIRST_VALUE','MariaDB starting with 10.2.2\n----------------------------\nThe FIRST_VALUE() function was first introduced with other window functions in\nMariaDB 10.2.\n\nSyntax\n------\n\nFIRST_VALUE(expr) OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nFIRST_VALUE returns the first result from an ordered set, or NULL if no such\nresult exists.\n\nExamples\n--------\n\nCREATE TABLE t1 (\n pk int primary key,\n a int,\n b int,\n c char(10),\n d decimal(10, 3),\n e real\n);\n\nINSERT INTO t1 VALUES\n( 1, 0, 1, \'one\', 0.1, 0.001),\n( 2, 0, 2, \'two\', 0.2, 0.002),\n( 3, 0, 3, \'three\', 0.3, 0.003),\n( 4, 1, 2, \'three\', 0.4, 0.004),\n( 5, 1, 1, \'two\', 0.5, 0.005),\n( 6, 1, 1, \'one\', 0.6, 0.006),\n( 7, 2, NULL, \'n_one\', 0.5, 0.007),\n( 8, 2, 1, \'n_two\', NULL, 0.008),\n( 9, 2, 2, NULL, 0.7, 0.009),\n(10, 2, 0, \'n_four\', 0.8, 0.010),\n(11, 2, 10, NULL, 0.9, NULL);\n\nSELECT pk, FIRST_VALUE(pk) OVER (ORDER BY pk) AS first_asc,\n LAST_VALUE(pk) OVER (ORDER BY pk) AS last_asc,\n FIRST_VALUE(pk) OVER (ORDER BY pk DESC) AS first_desc,\n LAST_VALUE(pk) OVER (ORDER BY pk DESC) AS last_desc\nFROM t1\nORDER BY pk DESC;\n\n+----+-----------+----------+------------+-----------+\n| pk | first_asc | last_asc | first_desc | last_desc |\n+----+-----------+----------+------------+-----------+\n| 11 | 1 | 11 | 11 | 11 |\n| 10 | 1 | 10 | 11 | 10 |\n| 9 | 1 | 9 | 11 | 9 |\n| 8 | 1 | 8 | 11 | 8 |\n| 7 | 1 | 7 | 11 | 7 |\n| 6 | 1 | 6 | 11 | 6 |\n| 5 | 1 | 5 | 11 | 5 |\n| 4 | 1 | 4 | 11 | 4 |\n| 3 | 1 | 3 | 11 | 3 |\n| 2 | 1 | 2 | 11 | 2 |\n| 1 | 1 | 1 | 11 | 1 |\n+----+-----------+----------+------------+-----------+\n\nCREATE OR REPLACE TABLE t1 (i int);\nINSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);\n\nSELECT i,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and 1 FOLLOWING) AS\nf_1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW and 1 FOLLOWING) AS\nl_1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS\nf_1p1f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 PRECEDING AND 1 FOLLOWING) AS\nf_1p1f,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) AS\nf_2p1p,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 2 PRECEDING AND 1 PRECEDING) AS\nf_2p1p,\n FIRST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) AS\nf_1f2f,\n LAST_VALUE(i) OVER (ORDER BY i ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) AS\nf_1f2f\nFROM t1;\n\n+------+------+------+--------+--------+--------+--------+--------+--------+\n| i | f_1f | l_1f | f_1p1f | f_1p1f | f_2p1p | f_2p1p | f_1f2f | f_1f2f |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n| 1 | 1 | 2 | 1 | 2 | NULL | NULL | 2 | 3 |\n| 2 | 2 | 3 | 1 | 3 | 1 | 1 | 3 | 4 |\n| 3 | 3 | 4 | 2 | 4 | 1 | 2 | 4 | 5 |\n| 4 | 4 | 5 | 3 | 5 | 2 | 3 | 5 | 6 |\n| 5 | 5 | 6 | 4 | 6 | 3 | 4 | 6 | 7 |\n| 6 | 6 | 7 | 5 | 7 | 4 | 5 | 7 | 8 |\n| 7 | 7 | 8 | 6 | 8 | 5 | 6 | 8 | 9 |\n| 8 | 8 | 9 | 7 | 9 | 6 | 7 | 9 | 10 |\n| 9 | 9 | 10 | 8 | 10 | 7 | 8 | 10 | 10 |\n| 10 | 10 | 10 | 9 | 10 | 8 | 9 | NULL | NULL |\n+------+------+------+--------+--------+--------+--------+--------+--------+\n\n\n\nURL: mariadb.com/kb/en/first_value/','','https://mariadb.com/kb/en/first_value/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (715,42,'LAG','MariaDB starting with 10.2.2\n----------------------------\nThe LAG() function was first introduced with other window functions in MariaDB\n10.2.\n\nSyntax\n------\n\nLAG (expr[, offset]) OVER ( \n [ PARTITION BY partition_expression ]\n < ORDER BY order_list >\n)\n\nDescription\n-----------\n\nThe LAG function accesses data from a previous row according to the ORDER BY\nclause without the need for a self-join. The specific row is determined by the\noffset (default 1), which specifies the number of rows behind the current row\nto use. An offset of 0 is the current row.\n\nExamples\n--------\n\nCREATE TABLE t1 (pk int primary key, a int, b int, c char(10), d decimal(10,\n3), e real);\n\nINSERT INTO t1 VALUES\n ( 1, 0, 1, \'one\', 0.1, 0.001),\n ( 2, 0, 2, \'two\', 0.2, 0.002),\n ( 3, 0, 3, \'three\', 0.3, 0.003),\n ( 4, 1, 2, \'three\', 0.4, 0.004),\n ( 5, 1, 1, \'two\', 0.5, 0.005),\n ( 6, 1, 1, \'one\', 0.6, 0.006),\n ( 7, 2, NULL, \'n_one\', 0.5, 0.007),\n ( 8, 2, 1, \'n_two\', NULL, 0.008),\n ( 9, 2, 2, NULL, 0.7, 0.009),\n (10, 2, 0, \'n_four\', 0.8, 0.010),\n (11, 2, 10, NULL, 0.9, NULL);\n\nSELECT pk, LAG(pk) OVER (ORDER BY pk) AS l,\n LAG(pk,1) OVER (ORDER BY pk) AS l1,\n LAG(pk,2) OVER (ORDER BY pk) AS l2,\n LAG(pk,0) OVER (ORDER BY pk) AS l0,\n LAG(pk,-1) OVER (ORDER BY pk) AS lm1,\n LAG(pk,-2) OVER (ORDER BY pk) AS lm2\nFROM t1;\n+----+------+------+------+------+------+------+\n| pk | l | l1 | l2 | l0 | lm1 | lm2 |\n+----+------+------+------+------+------+------+\n| 1 | NULL | NULL | NULL | 1 | 2 | 3 |\n| 2 | 1 | 1 | NULL | 2 | 3 | 4 |\n| 3 | 2 | 2 | 1 | 3 | 4 | 5 |\n| 4 | 3 | 3 | 2 | 4 | 5 | 6 |\n| 5 | 4 | 4 | 3 | 5 | 6 | 7 |\n| 6 | 5 | 5 | 4 | 6 | 7 | 8 |\n| 7 | 6 | 6 | 5 | 7 | 8 | 9 |\n| 8 | 7 | 7 | 6 | 8 | 9 | 10 |\n| 9 | 8 | 8 | 7 | 9 | 10 | 11 |\n| 10 | 9 | 9 | 8 | 10 | 11 | NULL |\n| 11 | 10 | 10 | 9 | 11 | NULL | NULL |\n+----+------+------+------+------+------+------+\n\n\n\nURL: mariadb.com/kb/en/lag/','','https://mariadb.com/kb/en/lag/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (717,42,'MEDIAN','MariaDB starting with 10.3.3\n----------------------------\nThe MEDIAN() window function was first introduced with in MariaDB 10.3.3.\n\nSyntax\n------\n\nMEDIAN(median expression) OVER (\n [ PARTITION BY partition_expression ]\n)\n\nDescription\n-----------\n\nMEDIAN() is a window function that returns the median value of a range of\nvalues.\n\nIt is a specific case of PERCENTILE_CONT, with an argument of 0.5 and the\nORDER BY column the one in MEDIAN\'s argument.\n\nMEDIAN(<median-arg>) OVER ( [ PARTITION BY partition_expression] )\n\nIs equivalent to:\n\nPERCENTILE_CONT(0.5) WITHIN \n GROUP (ORDER BY <median-arg>) OVER ( [ PARTITION BY partition_expression ])\n\nExamples\n--------\n\nCREATE TABLE book_rating (name CHAR(30), star_rating TINYINT);\n\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 5);\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 3);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 1);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 2);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 5);\n\nSELECT name, median(star_rating) OVER (PARTITION BY name) FROM book_rating;\n+-----------------------+----------------------------------------------+\n| name | median(star_rating) OVER (PARTITION BY name) |\n+-----------------------+----------------------------------------------+\n| Lord of the Ladybirds | 4.0000000000 |\n| Lord of the Ladybirds | 4.0000000000 |\n| Lady of the Flies | 2.0000000000 |\n| Lady of the Flies | 2.0000000000 |\n| Lady of the Flies | 2.0000000000 |\n+-----------------------+----------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/median/','','https://mariadb.com/kb/en/median/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (718,42,'NTH_VALUE','MariaDB starting with 10.2.2\n----------------------------\nThe NTH_VALUE() function was first introduced with other window functions in\nMariaDB 10.2.\n\nSyntax\n------\n\nNTH_VALUE (expr[, num_row]) OVER ( \n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nThe NTH_VALUE function returns the value evaluated at row number num_row of\nthe window frame, starting from 1, or NULL if the row does not exist.\n\n\n\nURL: mariadb.com/kb/en/nth_value/','','https://mariadb.com/kb/en/nth_value/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (719,42,'NTILE','MariaDB starting with 10.2\n--------------------------\nThe NTILE() function was first introduced with window functions in MariaDB\n10.2.0.\n\nSyntax\n------\n\nNTILE (expr) OVER ( \n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nNTILE() is a window function that returns an integer indicating which group a\ngiven row falls into. The number of groups is specified in the argument\n(expr), starting at one. Ordered rows in the partition are divided into the\nspecified number of groups with as equal a size as possible.\n\nExamples\n--------\n\ncreate table t1 (\n pk int primary key,\n a int,\n b int\n );\n\ninsert into t1 values\n (11 , 0, 10),\n (12 , 0, 10),\n (13 , 1, 10),\n (14 , 1, 10),\n (18 , 2, 10),\n (15 , 2, 20),\n (16 , 2, 20),\n (17 , 2, 20),\n (19 , 4, 20),\n (20 , 4, 20);\n\nselect pk, a, b,\n ntile(1) over (order by pk)\n from t1;\n+----+------+------+-----------------------------+\n| pk | a | b | ntile(1) over (order by pk) |\n+----+------+------+-----------------------------+\n| 11 | 0 | 10 | 1 |\n| 12 | 0 | 10 | 1 |\n| 13 | 1 | 10 | 1 |\n| 14 | 1 | 10 | 1 |\n| 15 | 2 | 20 | 1 |\n| 16 | 2 | 20 | 1 |\n| 17 | 2 | 20 | 1 |\n| 18 | 2 | 10 | 1 |\n| 19 | 4 | 20 | 1 |\n| 20 | 4 | 20 | 1 |\n+----+------+------+-----------------------------+\n\nselect pk, a, b,\n ntile(4) over (order by pk)\n from t1;\n+----+------+------+-----------------------------+\n| pk | a | b | ntile(4) over (order by pk) |\n+----+------+------+-----------------------------+\n| 11 | 0 | 10 | 1 |\n| 12 | 0 | 10 | 1 |\n| 13 | 1 | 10 | 1 |\n| 14 | 1 | 10 | 2 |\n| 15 | 2 | 20 | 2 |\n| 16 | 2 | 20 | 2 |\n| 17 | 2 | 20 | 3 |\n| 18 | 2 | 10 | 3 |\n| 19 | 4 | 20 | 4 |\n| 20 | 4 | 20 | 4 |\n+----+------+------+-----------------------------+\n\n\n\nURL: mariadb.com/kb/en/ntile/','','https://mariadb.com/kb/en/ntile/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (720,42,'PERCENT_RANK','MariaDB starting with 10.2\n--------------------------\nThe PERCENT_RANK() function was first introduced with window functions in\nMariaDB 10.2.0.\n\nSyntax\n------\n\nPERCENT_RANK() OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nPERCENT_RANK() is a window function that returns the relative percent rank of\na given row. The following formula is used to calculate the percent rank:\n\n(rank - 1) / (number of rows in the window or partition - 1)\n\nExamples\n--------\n\ncreate table t1 (\n pk int primary key,\n a int,\n b int\n);\n\ninsert into t1 values\n( 1 , 0, 10),\n( 2 , 0, 10),\n( 3 , 1, 10),\n( 4 , 1, 10),\n( 8 , 2, 10),\n( 5 , 2, 20),\n( 6 , 2, 20),\n( 7 , 2, 20),\n( 9 , 4, 20),\n(10 , 4, 20);\n\nselect pk, a, b,\n rank() over (order by a) as rank,\n percent_rank() over (order by a) as pct_rank,\n cume_dist() over (order by a) as cume_dist\nfrom t1;\n+----+------+------+------+--------------+--------------+\n| pk | a | b | rank | pct_rank | cume_dist |\n+----+------+------+------+--------------+--------------+\n| 1 | 0 | 10 | 1 | 0.0000000000 | 0.2000000000 |\n| 2 | 0 | 10 | 1 | 0.0000000000 | 0.2000000000 |\n| 3 | 1 | 10 | 3 | 0.2222222222 | 0.4000000000 |\n| 4 | 1 | 10 | 3 | 0.2222222222 | 0.4000000000 |\n| 5 | 2 | 20 | 5 | 0.4444444444 | 0.8000000000 |\n| 6 | 2 | 20 | 5 | 0.4444444444 | 0.8000000000 |\n| 7 | 2 | 20 | 5 | 0.4444444444 | 0.8000000000 |\n| 8 | 2 | 10 | 5 | 0.4444444444 | 0.8000000000 |\n| 9 | 4 | 20 | 9 | 0.8888888889 | 1.0000000000 |\n| 10 | 4 | 20 | 9 | 0.8888888889 | 1.0000000000 |\n+----+------+------+------+--------------+--------------+\n\nselect pk, a, b,\n percent_rank() over (order by pk) as pct_rank,\n cume_dist() over (order by pk) as cume_dist\nfrom t1 order by pk;\n+----+------+------+--------------+--------------+\n| pk | a | b | pct_rank | cume_dist |\n+----+------+------+--------------+--------------+\n| 1 | 0 | 10 | 0.0000000000 | 0.1000000000 |\n| 2 | 0 | 10 | 0.1111111111 | 0.2000000000 |\n| 3 | 1 | 10 | 0.2222222222 | 0.3000000000 |\n| 4 | 1 | 10 | 0.3333333333 | 0.4000000000 |\n| 5 | 2 | 20 | 0.4444444444 | 0.5000000000 |\n| 6 | 2 | 20 | 0.5555555556 | 0.6000000000 |\n| 7 | 2 | 20 | 0.6666666667 | 0.7000000000 |\n| 8 | 2 | 10 | 0.7777777778 | 0.8000000000 |\n| 9 | 4 | 20 | 0.8888888889 | 0.9000000000 |\n| 10 | 4 | 20 | 1.0000000000 | 1.0000000000 |\n+----+------+------+--------------+--------------+\n\nselect pk, a, b,\n percent_rank() over (partition by a order by a) as pct_rank,\n cume_dist() over (partition by a order by a) as cume_dist\nfrom t1;\n+----+------+------+--------------+--------------+\n| pk | a | b | pct_rank | cume_dist |\n+----+------+------+--------------+--------------+\n| 1 | 0 | 10 | 0.0000000000 | 1.0000000000 |\n| 2 | 0 | 10 | 0.0000000000 | 1.0000000000 |\n| 3 | 1 | 10 | 0.0000000000 | 1.0000000000 |\n| 4 | 1 | 10 | 0.0000000000 | 1.0000000000 |\n| 5 | 2 | 20 | 0.0000000000 | 1.0000000000 |\n| 6 | 2 | 20 | 0.0000000000 | 1.0000000000 |\n| 7 | 2 | 20 | 0.0000000000 | 1.0000000000 |\n| 8 | 2 | 10 | 0.0000000000 | 1.0000000000 |\n| 9 | 4 | 20 | 0.0000000000 | 1.0000000000 |\n| 10 | 4 | 20 | 0.0000000000 | 1.0000000000 |\n+----+------+------+--------------+--------------+\n\n\n\nURL: mariadb.com/kb/en/percent_rank/','','https://mariadb.com/kb/en/percent_rank/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (721,42,'PERCENTILE_CONT','MariaDB starting with 10.3.3\n----------------------------\nThe PERCENTILE_CONT() window function was first introduced with in MariaDB\n10.3.3.\n\nSyntax\n------\n\nDescription\n-----------\n\nPERCENTILE_CONT() (standing for continuous percentile) is a window function\nwhich returns a value which corresponds to the given fraction in the sort\norder. If required, it will interpolate between adjacent input items.\n\nEssentially, the following process is followed to find the value to return:\n\n* Get the number of rows in the partition, denoted by N\n* RN = p*(N-1), where p denotes the argument to the PERCENTILE_CONT function\n* calculate the FRN(floor row number) and CRN(column row number for the group(\nFRN= floor(RN) and CRN = ceil(RN))\n* look up rows FRN and CRN\n* If (CRN = FRN = RN) then the result is (value of expression from row at RN)\n* Otherwise the result is\n* (CRN - RN) * (value of expression for row at FRN) +\n* (RN - FRN) * (value of expression for row at CRN)\n\nThe MEDIAN function is a specific case of PERCENTILE_CONT, equivalent to\nPERCENTILE_CONT(0.5).\n\nExamples\n--------\n\nCREATE TABLE book_rating (name CHAR(30), star_rating TINYINT);\n\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 5);\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 3);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 1);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 2);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 5);\n\nSELECT name, PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc\n FROM book_rating;\n+-----------------------+--------------+\n| name | pc |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 4.0000000000 |\n| Lord of the Ladybirds | 4.0000000000 |\n| Lady of the Flies | 2.0000000000 |\n| Lady of the Flies | 2.0000000000 |\n| Lady of the Flies | 2.0000000000 |\n+-----------------------+--------------+\n\nSELECT name, PERCENTILE_CONT(1) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc\n FROM book_rating;\n+-----------------------+--------------+\n| name | pc |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 5.0000000000 |\n| Lord of the Ladybirds | 5.0000000000 |\n| Lady of the Flies | 5.0000000000 |\n| Lady of the Flies | 5.0000000000 |\n| Lady of the Flies | 5.0000000000 |\n+-----------------------+--------------+\n\nSELECT name, PERCENTILE_CONT(0) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc\n FROM book_rating;\n+-----------------------+--------------+\n| name | pc |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 3.0000000000 |\n| Lord of the Ladybirds | 3.0000000000 |\n| Lady of the Flies | 1.0000000000 |\n| Lady of the Flies | 1.0000000000 |\n| Lady of the Flies | 1.0000000000 |\n+-----------------------+--------------+\n\nSELECT name, PERCENTILE_CONT(0.6) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc\n FROM book_rating;\n+-----------------------+--------------+\n| name | pc |\n+-----------------------+--------------+\n| Lord of the Ladybirds | 4.2000000000 |\n| Lord of the Ladybirds | 4.2000000000 |\n| Lady of the Flies | 2.6000000000 |\n| Lady of the Flies | 2.6000000000 |\n| Lady of the Flies | 2.6000000000 |\n+-----------------------+--------------+\n\n\n\nURL: mariadb.com/kb/en/percentile_cont/','','https://mariadb.com/kb/en/percentile_cont/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (722,42,'PERCENTILE_DISC','MariaDB starting with 10.3.3\n----------------------------\nThe PERCENTILE_DISC() window function was first introduced with in MariaDB\n10.3.3.\n\nSyntax\n------\n\nDescription\n-----------\n\nPERCENTILE_DISC() (standing for discrete percentile) is a window function\nwhich returns the first value in the set whose ordered position is the same or\nmore than the specified fraction.\n\nEssentially, the following process is followed to find the value to return:\n\n* Get the number of rows in the partition.\n* Walk through the partition, in order, until finding the the first row with\nCUME_DIST() >= function_argument.\n\nExamples\n--------\n\nCREATE TABLE book_rating (name CHAR(30), star_rating TINYINT);\n\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 5);\nINSERT INTO book_rating VALUES (\'Lord of the Ladybirds\', 3);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 1);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 2);\nINSERT INTO book_rating VALUES (\'Lady of the Flies\', 5);\n\nSELECT name, PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY star_rating)\n OVER (PARTITION BY name) AS pc FROM book_rating;\n+-----------------------+------+\n| name | pc |\n+-----------------------+------+\n| Lord of the Ladybirds | 3 |\n| Lord of the Ladybirds | 3 |\n| Lady of the Flies | 2 |\n| Lady of the Flies | 2 |\n| Lady of the Flies | 2 |\n+-----------------------+------+\n5 rows in set (0.000 sec)\n\nSELECT name, PERCENTILE_DISC(0) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc FROM book_rating;\n+-----------------------+------+\n| name | pc |\n+-----------------------+------+\n| Lord of the Ladybirds | 3 |\n| Lord of the Ladybirds | 3 |\n| Lady of the Flies | 1 |\n| Lady of the Flies | 1 |\n| Lady of the Flies | 1 |\n+-----------------------+------+\n5 rows in set (0.000 sec)\n\nSELECT name, PERCENTILE_DISC(1) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc FROM book_rating;\n+-----------------------+------+\n| name | pc |\n+-----------------------+------+\n| Lord of the Ladybirds | 5 |\n| Lord of the Ladybirds | 5 |\n| Lady of the Flies | 5 |\n| Lady of the Flies | 5 |\n| Lady of the Flies | 5 |\n+-----------------------+------+\n5 rows in set (0.000 sec)\n\nSELECT name, PERCENTILE_DISC(0.6) WITHIN GROUP (ORDER BY star_rating) \n OVER (PARTITION BY name) AS pc FROM book_rating;\n+-----------------------+------+\n| name | pc |\n+-----------------------+------+\n| Lord of the Ladybirds | 5 |\n| Lord of the Ladybirds | 5 |\n| Lady of the Flies | 2 |\n| Lady of the Flies | 2 |\n| Lady of the Flies | 2 |\n+-----------------------+------\n\n\n\nURL: mariadb.com/kb/en/percentile_disc/','','https://mariadb.com/kb/en/percentile_disc/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (723,42,'RANK','MariaDB starting with 10.2\n--------------------------\nThe RANK() function was first introduced with window functions in MariaDB\n10.2.0.\n\nSyntax\n------\n\nRANK() OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nRANK() is a window function that displays the number of a given row, starting\nat one and following the ORDER BY sequence of the window function, with\nidentical values receiving the same result. It is similar to the ROW_NUMBER()\nfunction except that in that function, identical values will receive a\ndifferent row number for each result.\n\nExamples\n--------\n\nThe distinction between DENSE_RANK(), RANK() and ROW_NUMBER():\n\nCREATE TABLE student(course VARCHAR(10), mark int, name varchar(10));\n\nINSERT INTO student VALUES \n (\'Maths\', 60, \'Thulile\'),\n (\'Maths\', 60, \'Pritha\'),\n (\'Maths\', 70, \'Voitto\'),\n (\'Maths\', 55, \'Chun\'),\n (\'Biology\', 60, \'Bilal\'),\n (\'Biology\', 70, \'Roger\');\n\nSELECT \n RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS rank,\n DENSE_RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS dense_rank,\n ROW_NUMBER() OVER (PARTITION BY course ORDER BY mark DESC) AS row_num,\n course, mark, name\nFROM student ORDER BY course, mark DESC;\n+------+------------+---------+---------+------+---------+\n| rank | dense_rank | row_num | course | mark | name |\n+------+------------+---------+---------+------+---------+\n| 1 | 1 | 1 | Biology | 70 | Roger |\n| 2 | 2 | 2 | Biology | 60 | Bilal |\n| 1 | 1 | 1 | Maths | 70 | Voitto |\n| 2 | 2 | 2 | Maths | 60 | Thulile |\n| 2 | 2 | 3 | Maths | 60 | Pritha |\n| 4 | 3 | 4 | Maths | 55 | Chun |\n+------+------------+---------+---------+------+---------+\n\n\n\nURL: mariadb.com/kb/en/rank/','','https://mariadb.com/kb/en/rank/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (724,42,'ROW_NUMBER','MariaDB starting with 10.2\n--------------------------\nROW_NUMBER() was first introduced with window functions in MariaDB 10.2.0.\n\nSyntax\n------\n\nROW_NUMBER() OVER (\n [ PARTITION BY partition_expression ]\n [ ORDER BY order_list ]\n)\n\nDescription\n-----------\n\nROW_NUMBER() is a window function that displays the number of a given row,\nstarting at one and following the ORDER BY sequence of the window function,\nwith identical values receiving different row numbers. It is similar to the\nRANK() and DENSE_RANK() functions except that in that function, identical\nvalues will receive the same rank for each result.\n\nExamples\n--------\n\nThe distinction between DENSE_RANK(), RANK() and ROW_NUMBER():\n\nCREATE TABLE student(course VARCHAR(10), mark int, name varchar(10));\n\nINSERT INTO student VALUES \n (\'Maths\', 60, \'Thulile\'),\n (\'Maths\', 60, \'Pritha\'),\n (\'Maths\', 70, \'Voitto\'),\n (\'Maths\', 55, \'Chun\'),\n (\'Biology\', 60, \'Bilal\'),\n (\'Biology\', 70, \'Roger\');\n\nSELECT \n RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS rank,\n DENSE_RANK() OVER (PARTITION BY course ORDER BY mark DESC) AS dense_rank,\n ROW_NUMBER() OVER (PARTITION BY course ORDER BY mark DESC) AS row_num,\n course, mark, name\nFROM student ORDER BY course, mark DESC;\n+------+------------+---------+---------+------+---------+\n| rank | dense_rank | row_num | course | mark | name |\n+------+------------+---------+---------+------+---------+\n| 1 | 1 | 1 | Biology | 70 | Roger |\n| 2 | 2 | 2 | Biology | 60 | Bilal |\n| 1 | 1 | 1 | Maths | 70 | Voitto |\n| 2 | 2 | 2 | Maths | 60 | Thulile |\n| 2 | 2 | 3 | Maths | 60 | Pritha |\n| 4 | 3 | 4 | Maths | 55 | Chun |\n+------+------------+---------+---------+------+---------+\n\n\n\nURL: mariadb.com/kb/en/row_number/','','https://mariadb.com/kb/en/row_number/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (725,43,'SPIDER_BG_DIRECT_SQL','Syntax\n------\n\nSPIDER_BG_DIRECT_SQL(\'sql\', \'tmp_table_list\', \'parameters\')\n\nDescription\n-----------\n\nExecutes the given SQL statement in the background on the remote server, as\ndefined in the parameters listing. If the query returns a result-set, it\nsttores the results in the given temporary table. When the given SQL statement\nexecutes successfully, this function returns the number of called UDF\'s. It\nreturns 0 when the given SQL statement fails.\n\nThis function is a UDF installed with the Spider storage engine.\n\nExamples\n--------\n\nSELECT SPIDER_BG_DIRECT_SQL(\'SELECT * FROM example_table\', \'\', \n \'srv "node1", port "8607"\') AS "Direct Query";\n+--------------+\n| Direct Query | \n+--------------+\n| 1 |\n+--------------+\n\nParameters\n----------\n\nerror_rw_mode\n-------------\n\n* Description: Returns empty results on network error.\n0 : Return error on getting network error.\n1: Return 0 records on getting network error.\n\n* Default Table Value: 0\n* DSN Parameter Name: erwm\n\n\n\nURL: mariadb.com/kb/en/spider_bg_direct_sql/','','https://mariadb.com/kb/en/spider_bg_direct_sql/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (726,43,'SPIDER_COPY_TABLES','Syntax\n------\n\nSPIDER_COPY_TABLES(spider_table_name, \n source_link_id, destination_link_id_list [,parameters])\n\nDescription\n-----------\n\nA UDF installed with the Spider Storage Engine, this function copies table\ndata from source_link_id to destination_link_id_list. The service does not\nneed to be stopped in order to copy.\n\nIf the Spider table is partitioned, the name must be of the format\ntable_name#P#partition_name. The partition name can be viewed in the\nmysql.spider_tables table, for example:\n\nSELECT table_name FROM mysql.spider_tables;\n+-------------+\n| table_name |\n+-------------+\n| spt_a#P#pt1 |\n| spt_a#P#pt2 |\n| spt_a#P#pt3 |\n+-------------+\n\nReturns 1 if the data was copied successfully, or 0 if copying the data failed.\n\n\n\nURL: mariadb.com/kb/en/spider_copy_tables/','','https://mariadb.com/kb/en/spider_copy_tables/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (727,43,'SPIDER_DIRECT_SQL','Syntax\n------\n\nSPIDER_DIRECT_SQL(\'sql\', \'tmp_table_list\', \'parameters\')\n\nDescription\n-----------\n\nA UDF installed with the Spider Storage Engine, this function is used to\nexecute the SQL string sql on the remote server, as defined in parameters. If\nany resultsets are returned, they are stored in the tmp_table_list.\n\nThe function returns 1 if the SQL executes successfully, or 0 if it fails.\n\nExamples\n--------\n\nSELECT SPIDER_DIRECT_SQL(\'SELECT * FROM s\', \'\', \'srv "node1", port "8607"\');\n+----------------------------------------------------------------------+\n| SPIDER_DIRECT_SQL(\'SELECT * FROM s\', \'\', \'srv "node1", port "8607"\') |\n+----------------------------------------------------------------------+\n| 1 |\n+----------------------------------------------------------------------+\n\n\n\nURL: mariadb.com/kb/en/spider_direct_sql/','','https://mariadb.com/kb/en/spider_direct_sql/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (728,43,'SPIDER_FLUSH_TABLE_MON_CACHE','Syntax\n------\n\nSPIDER_FLUSH_TABLE_MON_CACHE()\n\nDescription\n-----------\n\nA UDF installed with the Spider Storage Engine, this function is used for\nrefreshing monitoring server information. It returns a value of 1.\n\nExamples\n--------\n\nSELECT SPIDER_FLUSH_TABLE_MON_CACHE();\n+--------------------------------+\n| SPIDER_FLUSH_TABLE_MON_CACHE() |\n+--------------------------------+\n| 1 |\n+--------------------------------+\n\n\n\nURL: mariadb.com/kb/en/spider_flush_table_mon_cache/','','https://mariadb.com/kb/en/spider_flush_table_mon_cache/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (729,44,'COLUMN_ADD','Syntax\n------\n\nCOLUMN_ADD(dyncol_blob, column_nr, value [as type], [column_nr, value [as\ntype]]...);\nCOLUMN_ADD(dyncol_blob, column_name, value [as type], [column_name, value [as\ntype]]...);\n\nDescription\n-----------\n\nAdds or updates dynamic columns.\n\n* dyncol_blob must be either a valid dynamic columns blob (for example,\nCOLUMN_CREATE returns such blob), or an empty string.\n* column_name specifies the name of the column to be added. If dyncol_blob\nalready has a column with this name, it will be overwritten.\n* value specifies the new value for the column. Passing a NULL value will\ncause the column to be deleted.\n* as type is optional. See #datatypes section for a discussion about types.\n\nThe return value is a dynamic column blob after the modifications.\n\nExamples\n--------\n\nUPDATE t1 SET dyncol_blob=COLUMN_ADD(dyncol_blob, "column_name", "value")\nWHERE id=1;\n\nNote: COLUMN_ADD() is a regular function (just like CONCAT()), hence, in order\nto update the value in the table you have to use the UPDATE ... SET\ndynamic_col=COLUMN_ADD(dynamic_col, ....) pattern.\n\n\n\nURL: mariadb.com/kb/en/column_add/','','https://mariadb.com/kb/en/column_add/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (730,44,'COLUMN_CHECK','Syntax\n------\n\nCOLUMN_CHECK(dyncol_blob);\n\nDescription\n-----------\n\nCheck if dyncol_blob is a valid packed dynamic columns blob. Return value of 1\nmeans the blob is valid, return value of 0 means it is not.\n\nRationale: Normally, one works with valid dynamic column blobs. Functions like\nCOLUMN_CREATE, COLUMN_ADD, COLUMN_DELETE always return valid dynamic column\nblobs. However, if a dynamic column blob is accidentally truncated, or\ntranscoded from one character set to another, it will be corrupted. This\nfunction can be used to check if a value in a blob field is a valid dynamic\ncolumn blob.\n\n\n\nURL: mariadb.com/kb/en/column_check/','','https://mariadb.com/kb/en/column_check/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (731,44,'COLUMN_CREATE','Syntax\n------\n\nCOLUMN_CREATE(column_nr, value [as type], [column_nr, value [as type]]...);\nCOLUMN_CREATE(column_name, value [as type], [column_name, value [as type]]...);\n\nDescription\n-----------\n\nReturns a dynamic columns blob that stores the specified columns with values.\n\nThe return value is suitable for\n\n* storing in a table\n* further modification with other dynamic columns functions\n\nThe as type part allows one to specify the value type. In most cases, this is\nredundant because MariaDB will be able to deduce the type of the value.\nExplicit type specification may be needed when the type of the value is not\napparent. For example, a literal \'2012-12-01\' has a CHAR type by default, one\nwill need to specify \'2012-12-01\' AS DATE to have it stored as a date. See\nDynamic Columns:Datatypes for further details.\n\nExamples\n--------\n\nINSERT INTO tbl SET dyncol_blob=COLUMN_CREATE("column_name", "value");\n\n\n\nURL: mariadb.com/kb/en/column_create/','','https://mariadb.com/kb/en/column_create/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (732,44,'COLUMN_DELETE','Syntax\n------\n\nCOLUMN_DELETE(dyncol_blob, column_nr, column_nr...);\nCOLUMN_DELETE(dyncol_blob, column_name, column_name...);\n\nDescription\n-----------\n\nDeletes a dynamic column with the specified name. Multiple names can be given.\nThe return value is a dynamic column blob after the modification.\n\n\n\nURL: mariadb.com/kb/en/column_delete/','','https://mariadb.com/kb/en/column_delete/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (733,44,'COLUMN_EXISTS','Syntax\n------\n\nCOLUMN_EXISTS(dyncol_blob, column_nr);\nCOLUMN_EXISTS(dyncol_blob, column_name);\n\nDescription\n-----------\n\nChecks if a column with name column_name exists in dyncol_blob. If yes, return\n1, otherwise return 0. See dynamic columns for more information.\n\n\n\nURL: mariadb.com/kb/en/column_exists/','','https://mariadb.com/kb/en/column_exists/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (734,44,'COLUMN_GET','Syntax\n------\n\nCOLUMN_GET(dyncol_blob, column_nr as type);\nCOLUMN_GET(dyncol_blob, column_name as type);\n\nDescription\n-----------\n\nGets the value of a dynamic column by its name. If no column with the given\nname exists, NULL will be returned.\n\ncolumn_name as type requires that one specify the datatype of the dynamic\ncolumn they are reading.\n\nThis may seem counter-intuitive: why would one need to specify which datatype\nthey\'re retrieving? Can\'t the dynamic columns system figure the datatype from\nthe data being stored?\n\nThe answer is: SQL is a statically-typed language. The SQL interpreter needs\nto know the datatypes of all expressions before the query is run (for example,\nwhen one is using prepared statements and runs "select COLUMN_GET(...)", the\nprepared statement API requires the server to inform the client about the\ndatatype of the column being read before the query is executed and the server\ncan see what datatype the column actually has).\n\nLengths\n-------\n\nIf you\'re running queries like:\n\nSELECT COLUMN_GET(blob, \'colname\' as CHAR) ...\n\nwithout specifying a maximum length (i.e. using as CHAR, not as CHAR(n)),\nMariaDB will report the maximum length of the resultset column to be\n16,777,216. This may cause excessive memory usage in some client libraries,\nbecause they try to pre-allocate a buffer of maximum resultset width. To avoid\nthis problem, use CHAR(n) whenever you\'re using COLUMN_GET in the select list.\n\nSee Dynamic Columns:Datatypes for more information about datatypes.\n\n\n\nURL: mariadb.com/kb/en/column_get/','','https://mariadb.com/kb/en/column_get/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (735,44,'COLUMN_JSON','Syntax\n------\n\nCOLUMN_JSON(dyncol_blob)\n\nDescription\n-----------\n\nReturns a JSON representation of data in dyncol_blob. Can also be used to\ndisplay nested columns. See dynamic columns for more information.\n\nExample\n-------\n\nselect item_name, COLUMN_JSON(dynamic_cols) from assets;\n+-----------------+----------------------------------------+\n| item_name | COLUMN_JSON(dynamic_cols) |\n+-----------------+----------------------------------------+\n| MariaDB T-shirt | {"size":"XL","color":"blue"} |\n| Thinkpad Laptop | {"color":"black","warranty":"3 years"} |\n+-----------------+----------------------------------------+\n\nLimitation: COLUMN_JSON will decode nested dynamic columns at a nesting level\nof not more than 10 levels deep. Dynamic columns that are nested deeper than\n10 levels will be shown as BINARY string, without encoding.\n\n\n\nURL: mariadb.com/kb/en/column_json/','','https://mariadb.com/kb/en/column_json/');
+insert into help_topic (help_topic_id,help_category_id,name,description,example,url) values (736,44,'COLUMN_LIST','Syntax\n------\n\nCOLUMN_LIST(dyncol_blob);\n\nDescription\n-----------\n\nReturns a comma-separated list of column names. The names are quoted with\nbackticks.\n\nSee dynamic columns for more information.\n\n\n\nURL: mariadb.com/kb/en/column_list/','','https://mariadb.com/kb/en/column_list/');
insert into help_keyword values (1,'master_ssl_verify_cert');
insert into help_keyword values (2,'drop prepare');
insert into help_keyword values (3,'work');
diff --git a/scripts/wsrep_sst_backup.sh b/scripts/wsrep_sst_backup.sh
index 4f98ad41dd5..6f8c658135a 100644
--- a/scripts/wsrep_sst_backup.sh
+++ b/scripts/wsrep_sst_backup.sh
@@ -71,7 +71,7 @@ then
# (b) Cluster state ID & wsrep_gtid_domain_id to be written to the file, OR
# (c) ERROR file, in case flush tables operation failed.
- while [ ! -r "$FLUSHED" ] && \
+ while [ ! -r "$FLUSHED" ] || \
! grep -q -F ':' -- "$FLUSHED"
do
# Check whether ERROR file exists.
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh
index 2fc8c9019e6..d98a336d3a8 100644
--- a/scripts/wsrep_sst_common.sh
+++ b/scripts/wsrep_sst_common.sh
@@ -104,6 +104,7 @@ WSREP_SST_OPT_HOST_UNESCAPED=""
INNODB_DATA_HOME_DIR=$(trim_dir "${INNODB_DATA_HOME_DIR:-}")
INNODB_LOG_GROUP_HOME=$(trim_dir "${INNODB_LOG_GROUP_HOME:-}")
INNODB_UNDO_DIR=$(trim_dir "${INNODB_UNDO_DIR:-}")
+INNODB_BUFFER_POOL=""
INNODB_FORCE_RECOVERY=""
INNOEXTRA=""
@@ -212,6 +213,10 @@ case "$1" in
readonly INNODB_UNDO_DIR=$(trim_dir "$2")
shift
;;
+ '--innodb-buffer-pool-filename')
+ readonly INNODB_BUFFER_POOL=$(trim_string "$2")
+ shift
+ ;;
'--defaults-file')
readonly WSREP_SST_OPT_DEFAULT="$1=$2"
readonly WSREP_SST_OPT_DEFAULTS="$1='$2'"
@@ -471,6 +476,12 @@ case "$1" in
fi
skip_mysqld_arg=1
;;
+ '--innodb-buffer-pool-filename')
+ if [ -z "$INNODB_BUFFER_POOL" ]; then
+ MYSQLD_OPT_INNODB_BUFFER_POOL=$(trim_string "$value")
+ fi
+ skip_mysqld_arg=1
+ ;;
'--innodb-force-recovery')
if [ -n "$value" -a "$value" != "0" ]; then
INNODB_FORCE_RECOVERY=$(trim_string "$value")
@@ -552,6 +563,10 @@ if [ -n "${MYSQLD_OPT_INNODB_UNDO_DIR:-}" -a \
-z "$INNODB_UNDO_DIR" ]; then
readonly INNODB_UNDO_DIR="$MYSQLD_OPT_INNODB_UNDO_DIR"
fi
+if [ -n "${MYSQLD_OPT_INNODB_BUFFER_POOL:-}" -a \
+ -z "$INNODB_BUFFER_POOL" ]; then
+ readonly INNODB_BUFFER_POOL="$MYSQLD_OPT_INNODB_BUFFER_POOL"
+fi
if [ -n "${MYSQLD_OPT_LOG_BIN:-}" -a \
-z "$WSREP_SST_OPT_BINLOG" ]; then
readonly WSREP_SST_OPT_BINLOG="$MYSQLD_OPT_LOG_BIN"
@@ -602,6 +617,9 @@ fi
if [ -n "$INNODB_UNDO_DIR" ]; then
INNOEXTRA="$INNOEXTRA --innodb-undo-directory='$INNODB_UNDO_DIR'"
fi
+if [ -n "$INNODB_BUFFER_POOL" ]; then
+ INNOEXTRA="$INNOEXTRA --innodb-buffer-pool-filename='$INNODB_BUFFER_POOL'"
+fi
if [ -n "$WSREP_SST_OPT_BINLOG" ]; then
INNOEXTRA="$INNOEXTRA --log-bin='$WSREP_SST_OPT_BINLOG'"
if [ -n "$WSREP_SST_OPT_BINLOG_INDEX" ]; then
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh
index 5521dd51098..63ef8be8690 100644
--- a/scripts/wsrep_sst_mariabackup.sh
+++ b/scripts/wsrep_sst_mariabackup.sh
@@ -664,6 +664,9 @@ cleanup_at_exit()
local estatus=$?
if [ $estatus -ne 0 ]; then
wsrep_log_error "Cleanup after exit with status: $estatus"
+ elif [ -z "${coords:-}" -a "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
+ estatus=32
+ wsrep_log_error "Failed to get current position"
fi
[ "$(pwd)" != "$OLD_PWD" ] && cd "$OLD_PWD"
@@ -934,6 +937,11 @@ if [ $ssyslog -eq 1 ]; then
logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@"
}
+ wsrep_log_warning()
+ {
+ logger -p daemon.warning -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@"
+ }
+
wsrep_log_info()
{
logger -p daemon.info -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE "$@"
@@ -1015,7 +1023,7 @@ setup_commands()
recovery=" --innodb-force-recovery=$INNODB_FORCE_RECOVERY"
fi
INNOAPPLY="$BACKUP_BIN --prepare$disver$recovery${iapts:+ }$iapts$INNOEXTRA --target-dir='$DATA' --datadir='$DATA'$mysqld_args $INNOAPPLY"
- INNOMOVE="$BACKUP_BIN$WSREP_SST_OPT_CONF --move-back$disver${impts:+ }$impts$INNOEXTRA --force-non-empty-directories --target-dir='$DATA' --datadir='${TDATA:-$DATA}' $INNOMOVE"
+ INNOMOVE="$BACKUP_BIN$WSREP_SST_OPT_CONF --move-back$disver${impts:+ }$impts$INNOEXTRA --galera-info --force-non-empty-directories --target-dir='$DATA' --datadir='${TDATA:-$DATA}' $INNOMOVE"
INNOBACKUP="$BACKUP_BIN$WSREP_SST_OPT_CONF --backup$disver${iopts:+ }$iopts$tmpopts$INNOEXTRA --galera-info --stream=$sfmt --target-dir='$itmpdir' --datadir='$DATA'$mysqld_args $INNOBACKUP"
}
@@ -1153,11 +1161,6 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
iopts="--parallel=$backup_threads${iopts:+ }$iopts"
fi
- max_binlogs=$(parse_cnf "$encgroups" 'sst-max-binlogs')
- if [ -n "$max_binlogs" ]; then
- iopts="--sst-max-binlogs=$max_binlogs${iopts:+ }$iopts"
- fi
-
setup_commands
set +e
diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh
index 81fc61eb1e7..11b444468c8 100644
--- a/scripts/wsrep_sst_rsync.sh
+++ b/scripts/wsrep_sst_rsync.sh
@@ -38,6 +38,9 @@ cleanup_joiner()
local estatus=$?
if [ $estatus -ne 0 ]; then
wsrep_log_error "Cleanup after exit with status: $estatus"
+ elif [ -z "${coords:-}" ]; then
+ estatus=32
+ wsrep_log_error "Failed to get current position"
fi
local failure=0
@@ -408,7 +411,7 @@ EOF
# (b) Cluster state ID & wsrep_gtid_domain_id to be written to the file, OR
# (c) ERROR file, in case flush tables operation failed.
- while [ ! -r "$FLUSHED" ] && \
+ while [ ! -r "$FLUSHED" ] || \
! grep -q -F ':' -- "$FLUSHED"
do
# Check whether ERROR file exists.
@@ -433,8 +436,8 @@ EOF
# Let's check the existence of the file with the index:
if [ -f "$WSREP_SST_OPT_BINLOG_INDEX" ]; then
# Let's read the binlog index:
- max_binlogs=$(parse_cnf "$encgroups" 'sst-max-binlogs')
- if [ -n "$max_binlogs" ]; then
+ max_binlogs=$(parse_cnf "$encgroups" 'sst-max-binlogs' 1)
+ if [ $max_binlogs -ge 0 ]; then
binlog_files=""
if [ $max_binlogs -gt 0 ]; then
binlog_files=$(tail -n $max_binlogs \
diff --git a/sql/field.cc b/sql/field.cc
index c5b855363ed..98aeb6d892c 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -964,7 +964,8 @@ Type_handler::aggregate_for_result_traditional(const Type_handler *a,
}
-bool Field::check_assignability_from(const Type_handler *from) const
+bool Field::check_assignability_from(const Type_handler *from,
+ bool ignore) const
{
/*
Using type_handler_for_item_field() here to get the data type handler
@@ -982,9 +983,26 @@ bool Field::check_assignability_from(const Type_handler *from) const
type_handler_for_item_field());
if (th.aggregate_for_result(from->type_handler_for_item_field()))
{
- my_error(ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION, MYF(0),
- type_handler()->name().ptr(), from->name().ptr(), "SET");
- return true;
+ bool error= !ignore && get_thd()->is_strict_mode();
+ /*
+ Display fully qualified column name for table columns.
+ Display non-qualified names for other things,
+ e.g. SP variables, SP return values, SP and CURSOR parameters.
+ */
+ if (table->s->db.str && table->s->table_name.str)
+ my_printf_error(ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION,
+ "Cannot cast '%s' as '%s' in assignment of %`s.%`s.%`s",
+ MYF(error ? 0 : ME_WARNING),
+ from->name().ptr(), type_handler()->name().ptr(),
+ table->s->db.str, table->s->table_name.str,
+ field_name.str);
+ else
+ my_printf_error(ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION,
+ "Cannot cast '%s' as '%s' in assignment of %`s",
+ MYF(error ? 0 : ME_WARNING),
+ from->name().ptr(), type_handler()->name().ptr(),
+ field_name.str);
+ return error;
}
return false;
}
@@ -10719,7 +10737,7 @@ bool Column_definition::check(THD *thd)
TIMESTAMP columns get implicit DEFAULT value when
explicit_defaults_for_timestamp is not set.
*/
- if ((opt_explicit_defaults_for_timestamp ||
+ if (((thd->variables.option_bits & OPTION_EXPLICIT_DEF_TIMESTAMP) ||
!is_timestamp_type()) && !vers_sys_field())
{
flags|= NO_DEFAULT_VALUE_FLAG;
@@ -10854,6 +10872,7 @@ Column_definition::Column_definition(THD *thd, Field *old_field,
comment= old_field->comment;
vcol_info= old_field->vcol_info;
option_list= old_field->option_list;
+ explicitly_nullable= !(old_field->flags & NOT_NULL_FLAG);
compression_method_ptr= 0;
versioning= VERSIONING_NOT_SET;
invisible= old_field->invisible;
diff --git a/sql/field.h b/sql/field.h
index 5d5be5204cd..77dc7da04e3 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -905,10 +905,10 @@ public:
bool is_unsigned() const { return flags & UNSIGNED_FLAG; }
- bool check_assignability_from(const Type_handler *from) const;
- bool check_assignability_from(const Field *from) const
+ bool check_assignability_from(const Type_handler *from, bool ignore) const;
+ bool check_assignability_from(const Field *from, bool ignore) const
{
- return check_assignability_from(from->type_handler());
+ return check_assignability_from(from->type_handler(), ignore);
}
/**
@@ -5281,7 +5281,7 @@ public:
uint flags, pack_length;
List<String> interval_list;
engine_option_value *option_list;
-
+ bool explicitly_nullable;
/*
This is additinal data provided for any computed(virtual) field.
@@ -5303,7 +5303,7 @@ public:
comment(null_clex_str),
on_update(NULL), invisible(VISIBLE), char_length(0),
flags(0), pack_length(0),
- option_list(NULL),
+ option_list(NULL), explicitly_nullable(false),
vcol_info(0), default_value(0), check_constraint(0),
versioning(VERSIONING_NOT_SET), period(NULL)
{
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 0c7d4d79d90..cf91649505b 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -2143,7 +2143,10 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
}
DBUG_ASSERT(m_new_file == 0);
m_new_file= new_file_array;
- if (unlikely((error= copy_partitions(copied, deleted))))
+ (*m_new_file)->extra(HA_EXTRA_BEGIN_ALTER_COPY);
+ error= copy_partitions(copied, deleted);
+ (*m_new_file)->extra(HA_EXTRA_END_ALTER_COPY);
+ if (unlikely(error))
{
/*
Close and unlock the new temporary partitions.
diff --git a/sql/handler.cc b/sql/handler.cc
index 2f2c7064e6a..5743fc2a455 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -4934,17 +4934,32 @@ int handler::ha_check(THD *thd, HA_CHECK_OPT *check_opt)
DBUG_ASSERT(table_share->tmp_table != NO_TMP_TABLE ||
m_lock_type != F_UNLCK);
- if ((table->s->mysql_version >= MYSQL_VERSION_ID) &&
+ const ulong v= table->s->mysql_version;
+
+ if ((v >= MYSQL_VERSION_ID) &&
(check_opt->sql_flags & TT_FOR_UPGRADE))
return 0;
- if (table->s->mysql_version < MYSQL_VERSION_ID)
+ if (v < MYSQL_VERSION_ID)
{
if (unlikely((error= check_old_types())))
return error;
error= ha_check_for_upgrade(check_opt);
if (unlikely(error && (error != HA_ADMIN_NEEDS_CHECK)))
return error;
+ if (table->s->table_category == TABLE_CATEGORY_USER &&
+ (v < 100142 ||
+ (v >= 100200 && v < 100228) ||
+ (v >= 100300 && v < 100319) ||
+ (v >= 100400 && v < 100409)))
+ {
+ for (const KEY *key= table->key_info,
+ *end= table->key_info + table->s->keys; key < end; key++)
+ {
+ if (key->flags & HA_BINARY_PACK_KEY && key->flags & HA_VAR_LENGTH_KEY)
+ return HA_ADMIN_NEEDS_UPGRADE;
+ }
+ }
if (unlikely(!error && (check_opt->sql_flags & TT_FOR_UPGRADE)))
return 0;
}
@@ -7537,6 +7552,17 @@ int handler::ha_write_row(const uchar *buf)
if ((error= ha_check_overlaps(NULL, buf)))
DBUG_RETURN(error);
+ /*
+ NOTE: this != table->file is true in 3 cases:
+
+ 1. under copy_partitions() (REORGANIZE PARTITION): that does not
+ require long unique check as it does not introduce new rows or new index.
+ 2. under partition's ha_write_row() (INSERT): check_duplicate_long_entries()
+ was already done by ha_partition::ha_write_row(), no need to check it
+ again for each single partition.
+ 3. under ha_mroonga::wrapper_write_row()
+ */
+
if (table->s->long_unique_table && this == table->file)
{
DBUG_ASSERT(inited == NONE || lookup_handler != this);
@@ -7590,6 +7616,13 @@ int handler::ha_update_row(const uchar *old_data, const uchar *new_data)
uint saved_status= table->status;
error= ha_check_overlaps(old_data, new_data);
+ /*
+ NOTE: this != table->file is true under partition's ha_update_row():
+ check_duplicate_long_entries_update() was already done by
+ ha_partition::ha_update_row(), no need to check it again for each single
+ partition. Same applies to ha_mroonga wrapper.
+ */
+
if (!error && table->s->long_unique_table && this == table->file)
error= check_duplicate_long_entries_update(new_data);
table->status= saved_status;
diff --git a/sql/item.cc b/sql/item.cc
index f59b2fe2fb7..8bba7b65f2e 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -4520,13 +4520,13 @@ bool Item_param::is_evaluable_expression() const
}
-bool Item_param::check_assignability_to(const Field *to) const
+bool Item_param::check_assignability_to(const Field *to, bool ignore) const
{
switch (state) {
case SHORT_DATA_VALUE:
case LONG_DATA_VALUE:
case NULL_VALUE:
- return to->check_assignability_from(type_handler());
+ return to->check_assignability_from(type_handler(), ignore);
case NO_VALUE:
case IGNORE_VALUE:
case DEFAULT_VALUE:
diff --git a/sql/item.h b/sql/item.h
index 75b2ed7f882..4d85a654dd4 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1838,14 +1838,14 @@ public:
*/
virtual bool is_evaluable_expression() const { return true; }
- virtual bool check_assignability_to(const Field *to) const
+ virtual bool check_assignability_to(const Field *to, bool ignore) const
{
/*
"this" must be neither DEFAULT/IGNORE,
nor Item_param bound to DEFAULT/IGNORE.
*/
DBUG_ASSERT(is_evaluable_expression());
- return to->check_assignability_from(type_handler());
+ return to->check_assignability_from(type_handler(), ignore);
}
/**
@@ -4088,7 +4088,7 @@ class Item_param :public Item_basic_value,
const String *value_query_val_str(THD *thd, String* str) const;
Item *value_clone_item(THD *thd);
bool is_evaluable_expression() const override;
- bool check_assignability_to(const Field *field) const override;
+ bool check_assignability_to(const Field *field, bool ignore) const override;
bool can_return_value() const;
public:
@@ -6769,7 +6769,7 @@ public:
{
str->append(STRING_WITH_LEN("default"));
}
- bool check_assignability_to(const Field *to) const override
+ bool check_assignability_to(const Field *to, bool ignore) const override
{
return false;
}
@@ -6806,7 +6806,7 @@ public:
{
str->append(STRING_WITH_LEN("ignore"));
}
- bool check_assignability_to(const Field *to) const override
+ bool check_assignability_to(const Field *to, bool ignore) const override
{
return false;
}
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index a53bb2e53b6..a65cbbf37d9 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -318,7 +318,18 @@ static bool convert_const_to_int(THD *thd, Item_field *field_item,
field_item->field_type() != MYSQL_TYPE_YEAR)
return 1;
- if ((*item)->can_eval_in_optimize())
+ /*
+ Replace (*item) with its value if the item can be computed.
+
+ Do not replace items that contain aggregate functions:
+ There can be such items that are constants, e.g. COLLATION(AVG(123)),
+ but this function is called at Name Resolution phase.
+ Removing aggregate functions may confuse query plan generation code, e.g.
+ the optimizer might conclude that the query doesn't need to do grouping
+ at all.
+ */
+ if ((*item)->can_eval_in_optimize() &&
+ !(*item)->with_sum_func())
{
TABLE *table= field->table;
MY_BITMAP *old_maps[2] = { NULL, NULL };
@@ -780,7 +791,9 @@ int Arg_comparator::compare_e_string()
{
String *res1,*res2;
res1= (*a)->val_str(&value1);
+ DBUG_ASSERT((res1 == NULL) == (*a)->null_value);
res2= (*b)->val_str(&value2);
+ DBUG_ASSERT((res2 == NULL) == (*b)->null_value);
if (!res1 || !res2)
return MY_TEST(res1 == res2);
return MY_TEST(sortcmp(res1, res2, compare_collation()) == 0);
diff --git a/sql/item_func.cc b/sql/item_func.cc
index e53b89a9291..a887b1ed022 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -6201,6 +6201,8 @@ bool Item_func_match::init_search(THD *thd, bool no_order)
ft_handler= table->file->ft_init_ext(match_flags, key, ft_tmp);
+ if (!ft_handler)
+ DBUG_RETURN(1);
if (join_key)
table->file->ft_handler=ft_handler;
diff --git a/sql/item_func.h b/sql/item_func.h
index a4122f78e87..549ac3b60d2 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -2117,8 +2117,7 @@ public:
void cleanup() override { first_eval= TRUE; Item_real_func::cleanup(); }
bool check_vcol_func_processor(void *arg) override
{
- return mark_unsupported_function(func_name(), "()", arg,
- VCOL_NON_DETERMINISTIC);
+ return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
}
Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_rand>(thd, this); }
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index 7938015d1fa..0091582e05d 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -151,6 +151,15 @@ int json_path_parts_compare(
int res, res2;
const json_path_step_t *temp_b= b;
+ DBUG_EXECUTE_IF("json_check_min_stack_requirement",
+ {
+ long arbitrary_var;
+ long stack_used_up= (available_stack_size(current_thd->thread_stack, &arbitrary_var));
+ ALLOCATE_MEM_ON_STACK(my_thread_stack_size-stack_used_up-STACK_MIN_SIZE);
+ });
+ if (check_stack_overrun(current_thd, STACK_MIN_SIZE , NULL))
+ return 1;
+
while (a <= a_end)
{
if (b > b_end)
@@ -1199,13 +1208,15 @@ my_decimal *Item_func_json_extract::val_decimal(my_decimal *to)
case JSON_VALUE_OBJECT:
case JSON_VALUE_ARRAY:
case JSON_VALUE_FALSE:
- case JSON_VALUE_NULL:
case JSON_VALUE_UNINITIALIZED:
- break;
+ // TODO: fix: NULL should be NULL
+ case JSON_VALUE_NULL:
+ int2my_decimal(E_DEC_FATAL_ERROR, 0, false/*unsigned_flag*/, to);
+ return to;
};
}
- int2my_decimal(E_DEC_FATAL_ERROR, 0, false/*unsigned_flag*/, to);
- return to;
+ DBUG_ASSERT(null_value);
+ return 0;
}
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 6f6de1ec282..09887dbc736 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -2201,6 +2201,7 @@ Format_description_log_event(uint8 binlog_ver, const char* server_ver)
break;
}
calc_server_version_split();
+ deduct_options_written_to_bin_log();
checksum_alg= BINLOG_CHECKSUM_ALG_UNDEF;
reset_crypto();
}
@@ -2259,6 +2260,7 @@ Format_description_log_event(const uchar *buf, uint event_len,
{
checksum_alg= BINLOG_CHECKSUM_ALG_UNDEF;
}
+ deduct_options_written_to_bin_log();
reset_crypto();
DBUG_VOID_RETURN;
@@ -2335,6 +2337,27 @@ void Format_description_log_event::calc_server_version_split()
}
+void Format_description_log_event::deduct_options_written_to_bin_log()
+{
+ options_written_to_bin_log= OPTION_AUTO_IS_NULL | OPTION_NOT_AUTOCOMMIT |
+ OPTION_NO_FOREIGN_KEY_CHECKS | OPTION_RELAXED_UNIQUE_CHECKS;
+ if (!server_version_split.version_is_valid() ||
+ server_version_split.kind == master_version_split::KIND_MYSQL ||
+ server_version_split < Version(10,5,2))
+ return;
+ options_written_to_bin_log|= OPTION_IF_EXISTS;
+ if (server_version_split[0] == 10)
+ {
+ const static char v[10]={99,99,99,99,99,17,9,5,4,2};
+ if (server_version_split[1] < 10 &&
+ server_version_split[2] < v[server_version_split[1]])
+ return;
+ }
+ options_written_to_bin_log|= OPTION_EXPLICIT_DEF_TIMESTAMP;
+
+ DBUG_ASSERT(options_written_to_bin_log == OPTIONS_WRITTEN_TO_BIN_LOG);
+}
+
/**
@return TRUE is the event's version is earlier than one that introduced
the replication event checksum. FALSE otherwise.
diff --git a/sql/log_event.h b/sql/log_event.h
index 517c5870445..6a2f57f60e6 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -521,33 +521,16 @@ class String;
be written to the binlog. OPTIONS_WRITTEN_TO_BIN_LOG could be
written into the Format_description_log_event, so that if later we
don't want to replicate a variable we did replicate, or the
- contrary, it's doable. But it should not be too hard to decide once
- for all of what we replicate and what we don't, among the fixed 32
- bits of thd->options.
-
- I (Guilhem) have read through every option's usage, and it looks
- like OPTION_AUTO_IS_NULL and OPTION_NO_FOREIGN_KEYS are the only
- ones which alter how the query modifies the table. It's good to
- replicate OPTION_RELAXED_UNIQUE_CHECKS too because otherwise, the
- slave may insert data slower than the master, in InnoDB.
- OPTION_BIG_SELECTS is not needed (the slave thread runs with
- max_join_size=HA_POS_ERROR) and OPTION_BIG_TABLES is not needed
- either, as the manual says (because a too big in-memory temp table
- is automatically written to disk).
+ contrary, it's doable. But it should not be too hard to deduct
+ the value of OPTIONS_WRITTEN_TO_BIN_LOG from the master's version.
+
+ This is done in deduct_options_written_to_bin_log().
+ You *must* update it, when changing the definition below.
*/
-#define OPTIONS_WRITTEN_TO_BIN_LOG \
- (OPTION_AUTO_IS_NULL | OPTION_NO_FOREIGN_KEY_CHECKS | \
+#define OPTIONS_WRITTEN_TO_BIN_LOG (OPTION_EXPLICIT_DEF_TIMESTAMP |\
+ OPTION_AUTO_IS_NULL | OPTION_NO_FOREIGN_KEY_CHECKS | \
OPTION_RELAXED_UNIQUE_CHECKS | OPTION_NOT_AUTOCOMMIT | OPTION_IF_EXISTS)
-/* Shouldn't be defined before */
-#define EXPECTED_OPTIONS \
- ((1ULL << 14) | (1ULL << 26) | (1ULL << 27) | (1ULL << 19) | (1ULL << 28))
-
-#if OPTIONS_WRITTEN_TO_BIN_LOG != EXPECTED_OPTIONS
-#error OPTIONS_WRITTEN_TO_BIN_LOG must NOT change their values!
-#endif
-#undef EXPECTED_OPTIONS /* You shouldn't use this one */
-
#define CHECKSUM_CRC32_SIGNATURE_LEN 4
/**
defined statically while there is just one alg implemented
@@ -1886,10 +1869,7 @@ protected:
<td>The flags in @c thd->options, binary AND-ed with @c
OPTIONS_WRITTEN_TO_BIN_LOG. The @c thd->options bitfield contains
options for "SELECT". @c OPTIONS_WRITTEN identifies those options
- that need to be written to the binlog (not all do). Specifically,
- @c OPTIONS_WRITTEN_TO_BIN_LOG equals (@c OPTION_AUTO_IS_NULL | @c
- OPTION_NO_FOREIGN_KEY_CHECKS | @c OPTION_RELAXED_UNIQUE_CHECKS |
- @c OPTION_NOT_AUTOCOMMIT), or 0x0c084000 in hex.
+ that need to be written to the binlog (not all do).
These flags correspond to the SQL variables SQL_AUTO_IS_NULL,
FOREIGN_KEY_CHECKS, UNIQUE_CHECKS, and AUTOCOMMIT, documented in
@@ -2896,6 +2876,7 @@ public:
};
master_version_split server_version_split;
const uint8 *event_type_permutation;
+ uint32 options_written_to_bin_log;
Format_description_log_event(uint8 binlog_ver, const char* server_ver=0);
Format_description_log_event(const uchar *buf, uint event_len,
@@ -2943,6 +2924,7 @@ public:
}
void calc_server_version_split();
+ void deduct_options_written_to_bin_log();
static bool is_version_before_checksum(const master_version_split *version_split);
protected:
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
diff --git a/sql/log_event_client.cc b/sql/log_event_client.cc
index e460fc17848..6d308ac6cd6 100644
--- a/sql/log_event_client.cc
+++ b/sql/log_event_client.cc
@@ -1887,6 +1887,7 @@ bool Query_log_event::print_query_header(IO_CACHE* file,
if (unlikely(tmp)) /* some bits have changed */
{
bool need_comma= 0;
+ ulonglong mask= glob_description_event->options_written_to_bin_log;
if (my_b_write_string(file, "SET ") ||
print_set_option(file, tmp, OPTION_NO_FOREIGN_KEY_CHECKS, ~flags2,
"@@session.foreign_key_checks", &need_comma)||
@@ -1896,11 +1897,13 @@ bool Query_log_event::print_query_header(IO_CACHE* file,
"@@session.unique_checks", &need_comma) ||
print_set_option(file, tmp, OPTION_NOT_AUTOCOMMIT, ~flags2,
"@@session.autocommit", &need_comma) ||
- print_set_option(file, tmp, OPTION_NO_CHECK_CONSTRAINT_CHECKS,
- ~flags2,
+ print_set_option(file, tmp, OPTION_NO_CHECK_CONSTRAINT_CHECKS, ~flags2,
"@@session.check_constraint_checks", &need_comma) ||
- print_set_option(file, tmp, OPTION_IF_EXISTS, flags2,
- "@@session.sql_if_exists", &need_comma)||
+ print_set_option(file, tmp, mask & OPTION_IF_EXISTS, flags2,
+ "@@session.sql_if_exists", &need_comma) ||
+ print_set_option(file, tmp, mask & OPTION_EXPLICIT_DEF_TIMESTAMP, flags2,
+ "@@session.explicit_defaults_for_timestamp",
+ &need_comma) ||
my_b_printf(file,"%s\n", print_event_info->delimiter))
goto err;
print_event_info->flags2= flags2;
diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc
index 69ce44fe211..b7f28406259 100644
--- a/sql/log_event_server.cc
+++ b/sql/log_event_server.cc
@@ -1970,7 +1970,9 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi,
OPTIONS_WRITTEN_TO_BIN_LOG must take their value from
flags2.
*/
- thd->variables.option_bits= flags2|(thd->variables.option_bits & ~OPTIONS_WRITTEN_TO_BIN_LOG);
+ ulonglong mask= rli->relay_log.description_event_for_exec->options_written_to_bin_log;
+ thd->variables.option_bits= (flags2 & mask) |
+ (thd->variables.option_bits & ~mask);
}
/*
else, we are in a 3.23/4.0 binlog; we previously received a
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index e85f7112de1..35e95ea63d7 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -390,7 +390,6 @@ my_bool opt_show_slave_auth_info;
my_bool opt_log_slave_updates= 0;
my_bool opt_replicate_annotate_row_events= 0;
my_bool opt_mysql56_temporal_format=0, strict_password_validation= 1;
-my_bool opt_explicit_defaults_for_timestamp= 0;
char *opt_slave_skip_errors;
char *opt_slave_transaction_retry_errors;
diff --git a/sql/mysqld.h b/sql/mysqld.h
index 8d3d9f867da..b9549054d77 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -969,7 +969,6 @@ extern my_bool opt_stack_trace, disable_log_notes;
extern my_bool opt_expect_abort;
extern my_bool opt_slave_sql_verify_checksum;
extern my_bool opt_mysql56_temporal_format, strict_password_validation;
-extern my_bool opt_explicit_defaults_for_timestamp;
extern ulong binlog_checksum_options;
extern bool max_user_connections_checking;
extern ulong opt_binlog_dbug_fsync_sleep;
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 391a04c2a1a..6825918cb89 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1901,7 +1901,9 @@ inline void SEL_ARG::make_root()
left=right= &null_element;
color=BLACK;
next=prev=0;
- use_count=0; elements=1;
+ use_count=0;
+ elements=1;
+ weight= 1 + (next_key_part? next_key_part->weight : 0);
}
SEL_ARG::SEL_ARG(Field *f, const uchar *min_value_arg,
@@ -9862,12 +9864,14 @@ and_all_keys(RANGE_OPT_PARAM *param, SEL_ARG *key1, SEL_ARG *key2,
return key2;
key1->right= key1->left= &null_element;
key1->next= key1->prev= 0;
+ key1->weight= 1 + (key1->next_key_part? key1->next_key_part->weight: 0);
}
for (next=key1->first(); next ; next=next->next)
{
if (next->next_key_part)
{
+ uint old_weight= next->next_key_part->weight;
SEL_ARG *tmp= key_and(param, next->next_key_part, key2, clone_flag);
if (tmp && tmp->type == SEL_ARG::IMPOSSIBLE)
{
@@ -9875,21 +9879,22 @@ and_all_keys(RANGE_OPT_PARAM *param, SEL_ARG *key1, SEL_ARG *key2,
continue;
}
next->next_key_part=tmp;
+ key1->weight+= (tmp? tmp->weight: 0) - old_weight;
if (use_count)
next->increment_use_count(use_count);
if (param->alloced_sel_args > SEL_ARG::MAX_SEL_ARGS)
break;
}
else
+ {
next->next_key_part=key2;
+ key1->weight += key2->weight;
+ }
}
if (!key1)
return &null_element; // Impossible ranges
key1->use_count++;
- /* Re-compute the result tree's weight. */
- key1->update_weight_locally();
-
key1->max_part_no= MY_MAX(key2->max_part_no, key2->part+1);
return key1;
}
@@ -10053,29 +10058,6 @@ get_range(SEL_ARG **e1,SEL_ARG **e2,SEL_ARG *root1)
return 0;
}
-/*
- @brief
- Update the tree weight.
-
- @detail
- Utility function to be called on a SEL_ARG tree root after doing local
- modifications concerning changes at this key part.
- Assumes that the weight of the graphs connected via next_key_part is
- up to dayte.
-*/
-void SEL_ARG::update_weight_locally()
-{
- uint new_weight= 0;
- const SEL_ARG *sl;
- for (sl= first(); sl ; sl= sl->next)
- {
- new_weight++;
- if (sl->next_key_part)
- new_weight += sl->next_key_part->weight;
- }
- weight= new_weight;
-}
-
#ifndef DBUG_OFF
/*
@@ -10835,9 +10817,6 @@ end:
}
key1->use_count++;
- /* Re-compute the result tree's weight. */
- key1->update_weight_locally();
-
key1->max_part_no= max_part_no;
return key1;
}
@@ -16258,6 +16237,7 @@ const char *dbug_print_sel_arg(SEL_ARG *sel_arg)
out.append(STRING_WITH_LEN("+inf"));
else
{
+ buf.length(0);
print_sel_arg_key(sel_arg->field, sel_arg->max_value, &buf);
out.append(buf);
}
diff --git a/sql/opt_range.h b/sql/opt_range.h
index f3ccd4d8311..1f4d3f1cd1f 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -346,7 +346,6 @@ public:
uint weight;
enum { MAX_WEIGHT = 32000 };
- void update_weight_locally();
#ifndef DBUG_OFF
uint verify_weight();
#endif
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index e20dcec3b9f..6a64ce14d4a 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -8257,9 +8257,8 @@ ER_INVALID_YEAR_COLUMN_LENGTH
spa "El tipo de columna YEAR(%lu) está obsoleto. Creando columna YEAR(4) en su lugar"
ER_NOT_VALID_PASSWORD
- chi "您的密码不满足当前的政策要求"
- eng "Your password does not satisfy the current policy requirements"
- spa "Su contraseña no satisface los requerimientos de la política en curso"
+ eng "Your password does not satisfy the current policy requirements (%s)"
+ ukr "Ваш пароль не відповідає поточним правилам (%s)"
ER_MUST_CHANGE_PASSWORD
bgn "Трябва първо да си смените паролата със SET PASSWORD за да можете да изпълните тази команда"
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index fe3a59d3562..745163a5014 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -425,7 +425,7 @@ Item *THD::sp_fix_func_item_for_assignment(const Field *to, Item **it_addr)
{
DBUG_ENTER("THD::sp_fix_func_item_for_assignment");
Item *res= sp_fix_func_item(it_addr);
- if (res && (!res->check_assignability_to(to)))
+ if (res && (!res->check_assignability_to(to, false)))
DBUG_RETURN(res);
DBUG_RETURN(NULL);
}
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 7d97b1c1b0f..601cae2e945 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -2175,7 +2175,12 @@ static my_bool do_validate(THD *, plugin_ref plugin, void *arg)
struct validation_data *data= (struct validation_data *)arg;
struct st_mariadb_password_validation *handler=
(st_mariadb_password_validation *)plugin_decl(plugin)->info;
- return handler->validate_password(data->user, data->password, data->host);
+ if (handler->validate_password(data->user, data->password, data->host))
+ {
+ my_error(ER_NOT_VALID_PASSWORD, MYF(0), plugin_ref_to_int(plugin)->name.str);
+ return true;
+ }
+ return false;
}
@@ -2191,7 +2196,6 @@ static bool validate_password(THD *thd, const LEX_CSTRING &user,
if (plugin_foreach(NULL, do_validate,
MariaDB_PASSWORD_VALIDATION_PLUGIN, &data))
{
- my_error(ER_NOT_VALID_PASSWORD, MYF(0));
return true;
}
}
@@ -10758,24 +10762,21 @@ static int handle_grant_data(THD *thd, Grant_tables& tables, bool drop,
}
/* Handle roles_mapping table. */
- if (tables.roles_mapping_table().table_exists())
+ if (tables.roles_mapping_table().table_exists() &&
+ (found= handle_grant_table(thd, tables.roles_mapping_table(),
+ ROLES_MAPPING_TABLE, drop, user_from, user_to)) < 0)
{
- if ((found= handle_grant_table(thd, tables.roles_mapping_table(),
- ROLES_MAPPING_TABLE, drop,
- user_from, user_to)) < 0)
- {
- /* Handle of table failed, don't touch the in-memory array. */
- result= -1;
- }
- else
- {
- /* Handle acl_roles_mappings array */
- if ((handle_grant_struct(ROLES_MAPPINGS_HASH, drop, user_from, user_to) || found)
- && ! result)
- result= 1; /* At least one record/element found */
- if (search_only)
- goto end;
- }
+ /* Handle of table failed, don't touch the in-memory array. */
+ result= -1;
+ }
+ else
+ {
+ /* Handle acl_roles_mappings array */
+ if ((handle_grant_struct(ROLES_MAPPINGS_HASH, drop, user_from, user_to) || found)
+ && ! result)
+ result= 1; /* At least one record/element found */
+ if (search_only)
+ goto end;
}
/* Handle user table. */
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 65a3a76e98b..d4384f49112 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -1318,7 +1318,9 @@ multi_delete::initialize_tables(JOIN *join)
table->file->ref_length,
MEM_STRIP_BUF_SIZE);
}
- init_ftfuncs(thd, thd->lex->current_select, 1);
+ if (init_ftfuncs(thd, thd->lex->current_select, 1))
+ DBUG_RETURN(true);
+
DBUG_RETURN(thd->is_fatal_error);
}
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 283dd463fa8..56c52cc4ed0 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -768,7 +768,7 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list,
value_count= values->elements;
if ((res= mysql_prepare_insert(thd, table_list, fields, values,
- update_fields, update_values, duplic,
+ update_fields, update_values, duplic, ignore,
&unused_conds, FALSE)))
{
retval= thd->is_error();
@@ -839,7 +839,8 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list,
behaviour for non-transactional tables.
*/
if (values->elements &&
- table_list->table->check_assignability_opt_fields(fields, *values))
+ table_list->table->check_assignability_opt_fields(fields, *values,
+ ignore))
goto abort;
while ((values= its++))
@@ -1639,7 +1640,8 @@ static void prepare_for_positional_update(TABLE *table, TABLE_LIST *tables)
int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
List<Item> &fields, List_item *values,
List<Item> &update_fields, List<Item> &update_values,
- enum_duplicates duplic, COND **where,
+ enum_duplicates duplic, bool ignore,
+ COND **where,
bool select_insert)
{
SELECT_LEX *select_lex= thd->lex->first_select_lex();
@@ -1714,7 +1716,8 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
ON DUPLICATE KEY UPDATE col=expr [, col=expr];
*/
TABLE::check_assignability_explicit_fields(update_fields,
- update_values);
+ update_values,
+ ignore);
select_lex->no_wrap_view_item= FALSE;
}
@@ -3815,7 +3818,7 @@ int mysql_insert_select_prepare(THD *thd, select_result *sel_res)
if ((res= mysql_prepare_insert(thd, lex->query_tables, lex->field_list, 0,
lex->update_list, lex->value_list,
- lex->duplicates,
+ lex->duplicates, lex->ignore,
&select_lex->where, TRUE)))
DBUG_RETURN(res);
@@ -3916,7 +3919,8 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
INSERT INTO t1 (col1, col2) VALUES (expr1, expr2);
INSERT INTO t1 SET col1=expr1, col2=expr2;
*/
- res= table_list->table->check_assignability_opt_fields(*fields, values);
+ res= table_list->table->check_assignability_opt_fields(*fields, values,
+ lex->ignore);
}
if (!res && fields->elements)
@@ -3979,7 +3983,8 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
ON DUPLICATE KEY UPDATE col=expr [, col=expr]
*/
TABLE::check_assignability_explicit_fields(*info.update_fields,
- *info.update_values);
+ *info.update_values,
+ lex->ignore);
if (!res)
{
/*
@@ -4499,7 +4504,7 @@ TABLE *select_create::create_table_from_items(THD *thd, List<Item> *items,
tmp_table.maybe_null= 0;
tmp_table.in_use= thd;
- if (!opt_explicit_defaults_for_timestamp)
+ if (!(thd->variables.option_bits & OPTION_EXPLICIT_DEF_TIMESTAMP))
promote_first_timestamp_column(&alter_info->create_list);
if (create_info->fix_create_fields(thd, alter_info, *create_table))
diff --git a/sql/sql_insert.h b/sql/sql_insert.h
index 80666a81c50..8b034c25877 100644
--- a/sql/sql_insert.h
+++ b/sql/sql_insert.h
@@ -27,6 +27,7 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
List<Item> &fields, List_item *values,
List<Item> &update_fields,
List<Item> &update_values, enum_duplicates duplic,
+ bool ignore,
COND **where, bool select_insert);
bool mysql_insert(THD *thd,TABLE_LIST *table,List<Item> &fields,
List<List_item> &values, List<Item> &update_fields,
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 2c1c00c63f7..37a0dad9d48 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -3158,6 +3158,7 @@ void st_select_lex_node::fast_exclude()
for (; slave; slave= slave->next)
slave->fast_exclude();
+ prev= NULL; // to ensure correct behavior of st_select_lex_unit::is_excluded()
}
@@ -3232,9 +3233,7 @@ void st_select_lex_node::exclude_from_tree()
*/
void st_select_lex_node::exclude()
{
- /* exclude from global list */
- fast_exclude();
- /* exclude from other structures */
+ /* exclude the node from the tree */
exclude_from_tree();
/*
We do not need following statements, because prev pointer of first
@@ -3242,6 +3241,8 @@ void st_select_lex_node::exclude()
if (master->slave == this)
master->slave= next;
*/
+ /* exclude all nodes under this excluded node */
+ fast_exclude();
}
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index a2d856e55f0..87f0bec7c87 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1040,9 +1040,9 @@ int bootstrap(MYSQL_FILE *file)
break;
case READ_BOOTSTRAP_QUERY_SIZE:
- my_printf_error(ER_UNKNOWN_ERROR, "Boostrap file error. Query size "
+ my_printf_error(ER_UNKNOWN_ERROR, "Bootstrap file error. Query size "
"exceeded %d bytes near '%s'.", MYF(0),
- MAX_BOOTSTRAP_LINE_SIZE, err_ptr);
+ MAX_BOOTSTRAP_QUERY_SIZE, err_ptr);
break;
default:
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 66781caac3e..901aee0b0c1 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -2532,7 +2532,7 @@ static bool plugin_dl_foreach_internal(THD *thd, st_plugin_dl *plugin_dl,
tmp.plugin_dl= plugin_dl;
mysql_mutex_lock(&LOCK_plugin);
- if ((plugin= plugin_find_internal(&tmp.name, MYSQL_ANY_PLUGIN)) &&
+ if ((plugin= plugin_find_internal(&tmp.name, plug->type)) &&
plugin->plugin == plug)
{
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index cca9036bdac..fbb36f7171f 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1288,7 +1288,8 @@ static bool mysql_test_insert_common(Prepared_statement *stmt,
List<List_item> &values_list,
List<Item> &update_fields,
List<Item> &update_values,
- enum_duplicates duplic)
+ enum_duplicates duplic,
+ bool ignore)
{
THD *thd= stmt->thd;
List_iterator_fast<List_item> its(values_list);
@@ -1324,7 +1325,8 @@ static bool mysql_test_insert_common(Prepared_statement *stmt,
}
if (mysql_prepare_insert(thd, table_list, fields, values, update_fields,
- update_values, duplic, &unused_conds, FALSE))
+ update_values, duplic, ignore,
+ &unused_conds, FALSE))
goto error;
value_count= values->elements;
@@ -1379,7 +1381,7 @@ static bool mysql_test_insert(Prepared_statement *stmt,
List<List_item> &values_list,
List<Item> &update_fields,
List<Item> &update_values,
- enum_duplicates duplic)
+ enum_duplicates duplic, bool ignore)
{
THD *thd= stmt->thd;
@@ -1395,7 +1397,7 @@ static bool mysql_test_insert(Prepared_statement *stmt,
}
return mysql_test_insert_common(stmt, table_list, fields, values_list,
- update_fields, update_values, duplic);
+ update_fields, update_values, duplic, ignore);
}
@@ -2473,14 +2475,14 @@ static bool check_prepared_statement(Prepared_statement *stmt)
res= mysql_test_insert(stmt, tables, lex->field_list,
lex->many_values,
lex->update_list, lex->value_list,
- lex->duplicates);
+ lex->duplicates, lex->ignore);
break;
case SQLCOM_LOAD:
res= mysql_test_insert_common(stmt, tables, lex->field_list,
lex->many_values,
lex->update_list, lex->value_list,
- lex->duplicates);
+ lex->duplicates, lex->ignore);
break;
case SQLCOM_UPDATE:
diff --git a/sql/sql_priv.h b/sql/sql_priv.h
index decb60187df..9afbd4c4927 100644
--- a/sql/sql_priv.h
+++ b/sql/sql_priv.h
@@ -136,8 +136,7 @@
#define OPTION_QUICK (1ULL << 22) // SELECT (for DELETE)
#define OPTION_BINLOG_THIS_TRX (1ULL << 23) // THD
-/* The following is used to detect a conflict with DISTINCT */
-#define SELECT_ALL (1ULL << 24) // SELECT, user, parser
+#define OPTION_EXPLICIT_DEF_TIMESTAMP (1ULL << 24) // THD, user
#define OPTION_GTID_BEGIN (1ULL << 25) // GTID BEGIN found in log
/** The following can be set when importing tables in a 'wrong order'
@@ -183,10 +182,11 @@
#define OPTION_NO_QUERY_CACHE (1ULL << 39) // SELECT, user
#define OPTION_PROCEDURE_CLAUSE (1ULL << 40) // Internal usage
#define SELECT_NO_UNLOCK (1ULL << 41) // SELECT, intern
-#define SELECT_NO_UNLOCK (1ULL << 41) // SELECT, intern
#define OPTION_BIN_TMP_LOG_OFF (1ULL << 42) // disable binlog, intern
/* Disable commit of binlog. Used to combine many DDL's and DML's as one */
#define OPTION_BIN_COMMIT_OFF (1ULL << 43)
+/* The following is used to detect a conflict with DISTINCT */
+#define SELECT_ALL (1ULL << 44) // SELECT, user, parser
#define OPTION_LEX_FOUND_COMMENT (1ULL << 0) // intern, parser
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index e21beace4f5..3b0061fcf8e 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -2023,6 +2023,9 @@ JOIN::optimize_inner()
DEBUG_SYNC(thd, "before_join_optimize");
THD_STAGE_INFO(thd, stage_optimizing);
+#ifndef DBUG_OFF
+ dbug_join_tab_array_size= 0;
+#endif
// rownum used somewhere in query, no limits and it is derived
if (unlikely(thd->lex->with_rownum &&
@@ -3316,6 +3319,9 @@ setup_subq_exit:
{
if (!(join_tab= (JOIN_TAB*) thd->alloc(sizeof(JOIN_TAB))))
DBUG_RETURN(1);
+#ifndef DBUG_OFF
+ dbug_join_tab_array_size= 1;
+#endif
need_tmp= 1;
}
if (make_aggr_tables_info())
@@ -3629,6 +3635,7 @@ bool JOIN::make_aggr_tables_info()
{
aggr_tables++;
curr_tab= join_tab + exec_join_tab_cnt();
+ DBUG_ASSERT(curr_tab - join_tab < dbug_join_tab_array_size);
bzero((void*)curr_tab, sizeof(JOIN_TAB));
curr_tab->ref.key= -1;
if (only_const_tables())
@@ -3757,6 +3764,7 @@ bool JOIN::make_aggr_tables_info()
curr_tab++;
aggr_tables++;
+ DBUG_ASSERT(curr_tab - join_tab < dbug_join_tab_array_size);
bzero((void*)curr_tab, sizeof(JOIN_TAB));
curr_tab->ref.key= -1;
@@ -10909,6 +10917,21 @@ bool JOIN::get_best_combination()
fix_semijoin_strategies_for_picked_join_order(this);
top_join_tab_count= get_number_of_tables_at_top_level(this);
+#ifndef DBUG_OFF
+ dbug_join_tab_array_size= top_join_tab_count + aggr_tables;
+#endif
+ /*
+ NOTE: The above computation of aggr_tables can produce wrong result because some
+ of the variables it uses may change their values after we leave this function.
+ Known examples:
+ - Dangerous: using_outer_summary_function=false at this point. Added
+ DBUG_ASSERT below to demonstrate. Can this cause us to allocate less
+ space than we would need?
+ - Not dangerous: select_distinct can be true here but be assigned false
+ afterwards.
+ */
+ aggr_tables= 2;
+ DBUG_ASSERT(!tmp_table_param.using_outer_summary_function);
if (!(join_tab= (JOIN_TAB*) thd->alloc(sizeof(JOIN_TAB)*
(top_join_tab_count + aggr_tables))))
DBUG_RETURN(TRUE);
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 1b6f5a62ed5..f84dc7a75b2 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -1317,6 +1317,7 @@ public:
#ifndef DBUG_OFF
void dbug_verify_sj_inner_tables(uint n_positions) const;
+ int dbug_join_tab_array_size;
#endif
/* We also maintain a stack of join optimization states in * join->positions[] */
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 991b65ef4b2..90693f407fb 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -398,7 +398,7 @@ bool String::copy_aligned(const char *str, size_t arg_length, size_t offset,
DBUG_ASSERT(offset && offset != cs->mbminlen);
size_t aligned_length= arg_length + offset;
- if (alloc(aligned_length))
+ if (alloc(aligned_length+1))
return TRUE;
/*
diff --git a/sql/sql_string.h b/sql/sql_string.h
index 795f80c3e08..a8c29eba22c 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -695,7 +695,7 @@ public:
Note that if arg_length == Alloced_length then we don't allocate.
This ensures we don't do any extra allocations in protocol and String:int,
- but the string will not be atomically null terminated if c_ptr() is not
+ but the string will not be automatically null terminated if c_ptr() is not
called.
*/
if (arg_length <= Alloced_length && Alloced_length)
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index aa998b02384..999f8306785 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -2307,13 +2307,17 @@ bool Column_definition::prepare_stage2(handler *file,
void promote_first_timestamp_column(List<Create_field> *column_definitions)
{
+ bool first= true;
for (Create_field &column_definition : *column_definitions)
{
if (column_definition.is_timestamp_type() || // TIMESTAMP
column_definition.unireg_check == Field::TIMESTAMP_OLD_FIELD) // Legacy
{
+ if (!column_definition.explicitly_nullable)
+ column_definition.flags|= NOT_NULL_FLAG;
DBUG_PRINT("info", ("field-ptr:%p", column_definition.field));
- if ((column_definition.flags & NOT_NULL_FLAG) != 0 && // NOT NULL,
+ if (first &&
+ (column_definition.flags & NOT_NULL_FLAG) != 0 && // NOT NULL,
column_definition.default_value == NULL && // no constant default,
column_definition.unireg_check == Field::NONE && // no function default
column_definition.vcol_info == NULL &&
@@ -2327,7 +2331,7 @@ void promote_first_timestamp_column(List<Create_field> *column_definitions)
));
column_definition.unireg_check= Field::TIMESTAMP_DNUN_FIELD;
}
- return;
+ first= false;
}
}
}
@@ -3652,7 +3656,7 @@ without_overlaps_err:
!sql_field->has_default_function() &&
(sql_field->flags & NOT_NULL_FLAG) &&
(!sql_field->is_timestamp_type() ||
- opt_explicit_defaults_for_timestamp)&&
+ (thd->variables.option_bits & OPTION_EXPLICIT_DEF_TIMESTAMP))&&
!sql_field->vers_sys_field())
{
sql_field->flags|= NO_DEFAULT_VALUE_FLAG;
@@ -3663,7 +3667,7 @@ without_overlaps_err:
!sql_field->default_value && !sql_field->vcol_info &&
!sql_field->vers_sys_field() &&
sql_field->is_timestamp_type() &&
- !opt_explicit_defaults_for_timestamp &&
+ !(thd->variables.option_bits & OPTION_EXPLICIT_DEF_TIMESTAMP) &&
(sql_field->flags & NOT_NULL_FLAG) &&
(type == Field::NONE || type == Field::TIMESTAMP_UN_FIELD))
{
@@ -4800,7 +4804,7 @@ bool mysql_create_table(THD *thd, TABLE_LIST *create_table,
else
create_table_mode= C_ASSISTED_DISCOVERY;
- if (!opt_explicit_defaults_for_timestamp)
+ if (!(thd->variables.option_bits & OPTION_EXPLICIT_DEF_TIMESTAMP))
promote_first_timestamp_column(&alter_info->create_list);
/* We can abort create table for any table type */
@@ -10359,7 +10363,7 @@ do_continue:;
create_info->fix_period_fields(thd, alter_info))
DBUG_RETURN(true);
- if (!opt_explicit_defaults_for_timestamp)
+ if (!(thd->variables.option_bits & OPTION_EXPLICIT_DEF_TIMESTAMP))
promote_first_timestamp_column(&alter_info->create_list);
#ifdef WITH_PARTITION_STORAGE_ENGINE
@@ -11462,7 +11466,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
if (!(*ptr)->vcol_info)
{
bitmap_set_bit(from->read_set, def->field->field_index);
- if ((*ptr)->check_assignability_from(def->field))
+ if ((*ptr)->check_assignability_from(def->field, ignore))
goto err;
(copy_end++)->set(*ptr,def->field,0);
}
diff --git a/sql/sql_type.cc b/sql/sql_type.cc
index 98b71246472..1c433043db7 100644
--- a/sql/sql_type.cc
+++ b/sql/sql_type.cc
@@ -4261,18 +4261,6 @@ void Type_handler_temporal_with_date::Item_update_null_value(Item *item) const
(void) item->get_date(thd, &ltime, Datetime::Options(thd));
}
-bool
-Type_handler_timestamp_common::
-Column_definition_set_attributes(THD *thd,
- Column_definition *def,
- const Lex_field_type_st &attr,
- column_definition_type_t type) const
-{
- Type_handler::Column_definition_set_attributes(thd, def, attr, type);
- if (!opt_explicit_defaults_for_timestamp)
- def->flags|= NOT_NULL_FLAG;
- return false;
-}
void Type_handler_string_result::Item_update_null_value(Item *item) const
{
diff --git a/sql/sql_type.h b/sql/sql_type.h
index 7ff4bc64679..e5f54535ece 100644
--- a/sql/sql_type.h
+++ b/sql/sql_type.h
@@ -6655,11 +6655,6 @@ public:
bool Item_func_min_max_get_date(THD *thd, Item_func_min_max*,
MYSQL_TIME *, date_mode_t fuzzydate)
const override;
- bool Column_definition_set_attributes(THD *thd,
- Column_definition *def,
- const Lex_field_type_st &attr,
- column_definition_type_t type)
- const override;
};
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index a8862113cf7..033f98fd719 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -523,7 +523,8 @@ int mysql_update(THD *thd,
DBUG_RETURN(1); /* purecov: inspected */
}
- if (table_list->table->check_assignability_explicit_fields(fields, values))
+ if (table_list->table->check_assignability_explicit_fields(fields, values,
+ ignore))
DBUG_RETURN(true);
if (check_unique_table(thd, table_list))
@@ -2093,7 +2094,8 @@ int multi_update::prepare(List<Item> &not_used_values,
int error= setup_fields(thd, Ref_ptr_array(),
*values, MARK_COLUMNS_READ, 0, NULL, 0) ||
- TABLE::check_assignability_explicit_fields(*fields, *values);
+ TABLE::check_assignability_explicit_fields(*fields, *values,
+ ignore);
ti.rewind();
while ((table_ref= ti++))
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 994a520aac8..348978c3a33 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -5833,7 +5833,6 @@ field_def:
| opt_generated_always AS virtual_column_func
{
Lex->last_field->vcol_info= $3;
- Lex->last_field->flags&= ~NOT_NULL_FLAG; // undo automatic NOT NULL for timestamps
}
vcol_opt_specifier vcol_opt_attribute
{
@@ -6315,8 +6314,17 @@ attribute_list:
;
attribute:
- NULL_SYM { Lex->last_field->flags&= ~ NOT_NULL_FLAG; $$.init(); }
- | DEFAULT column_default_expr { Lex->last_field->default_value= $2; $$.init(); }
+ NULL_SYM
+ {
+ Lex->last_field->flags&= ~NOT_NULL_FLAG;
+ Lex->last_field->explicitly_nullable= true;
+ $$.init();
+ }
+ | DEFAULT column_default_expr
+ {
+ Lex->last_field->default_value= $2;
+ $$.init();
+ }
| ON UPDATE_SYM NOW_SYM opt_default_time_precision
{
Item *item= new (thd->mem_root) Item_func_now_local(thd, $4);
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 7a86dae5606..5c5854afad5 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -719,15 +719,13 @@ Sys_binlog_direct(
CMD_LINE(OPT_ARG), DEFAULT(FALSE),
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(binlog_direct_check));
-
-static Sys_var_mybool Sys_explicit_defaults_for_timestamp(
+static Sys_var_bit Sys_explicit_defaults_for_timestamp(
"explicit_defaults_for_timestamp",
"This option causes CREATE TABLE to create all TIMESTAMP columns "
"as NULL with DEFAULT NULL attribute, Without this option, "
"TIMESTAMP columns are NOT NULL and have implicit DEFAULT clauses.",
- READ_ONLY GLOBAL_VAR(opt_explicit_defaults_for_timestamp),
- CMD_LINE(OPT_ARG), DEFAULT(FALSE));
-
+ SESSION_VAR(option_bits), CMD_LINE(OPT_ARG),
+ OPTION_EXPLICIT_DEF_TIMESTAMP, DEFAULT(FALSE), NO_MUTEX_GUARD, IN_BINLOG);
static Sys_var_ulonglong Sys_bulk_insert_buff_size(
"bulk_insert_buffer_size", "Size of tree cache used in bulk "
diff --git a/sql/table.cc b/sql/table.cc
index 2b41eaae129..d5a541b5cc7 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -9267,7 +9267,8 @@ bool TABLE::validate_default_values_of_unset_fields(THD *thd) const
INSERT INTO t1 (a,b) VALUES (1,2);
*/
bool TABLE::check_assignability_explicit_fields(List<Item> fields,
- List<Item> values)
+ List<Item> values,
+ bool ignore)
{
DBUG_ENTER("TABLE::check_assignability_explicit_fields");
DBUG_ASSERT(fields.elements == values.elements);
@@ -9287,7 +9288,7 @@ bool TABLE::check_assignability_explicit_fields(List<Item> fields,
*/
continue;
}
- if (value->check_assignability_to(item_field->field))
+ if (value->check_assignability_to(item_field->field, ignore))
DBUG_RETURN(true);
}
DBUG_RETURN(false);
@@ -9299,7 +9300,8 @@ bool TABLE::check_assignability_explicit_fields(List<Item> fields,
all visible fields of the table, e.g.
INSERT INTO t1 VALUES (1,2);
*/
-bool TABLE::check_assignability_all_visible_fields(List<Item> &values) const
+bool TABLE::check_assignability_all_visible_fields(List<Item> &values,
+ bool ignore) const
{
DBUG_ENTER("TABLE::check_assignability_all_visible_fields");
DBUG_ASSERT(s->visible_fields == values.elements);
@@ -9308,7 +9310,7 @@ bool TABLE::check_assignability_all_visible_fields(List<Item> &values) const
for (uint i= 0; i < s->fields; i++)
{
if (!field[i]->invisible &&
- (vi++)->check_assignability_to(field[i]))
+ (vi++)->check_assignability_to(field[i], ignore))
DBUG_RETURN(true);
}
DBUG_RETURN(false);
diff --git a/sql/table.h b/sql/table.h
index d4394bcd566..6ef3d4c7209 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1701,9 +1701,11 @@ public:
// Check if the value list is assignable to the explicit field list
static bool check_assignability_explicit_fields(List<Item> fields,
- List<Item> values);
+ List<Item> values,
+ bool ignore);
// Check if the value list is assignable to all visible fields
- bool check_assignability_all_visible_fields(List<Item> &values) const;
+ bool check_assignability_all_visible_fields(List<Item> &values,
+ bool ignore) const;
/*
Check if the value list is assignable to:
- The explicit field list if fields.elements > 0, e.g.
@@ -1712,12 +1714,13 @@ public:
INSERT INTO t1 VALUES (1,2);
*/
bool check_assignability_opt_fields(List<Item> fields,
- List<Item> values) const
+ List<Item> values,
+ bool ignore) const
{
DBUG_ASSERT(values.elements);
return fields.elements ?
- check_assignability_explicit_fields(fields, values) :
- check_assignability_all_visible_fields(values);
+ check_assignability_explicit_fields(fields, values, ignore) :
+ check_assignability_all_visible_fields(values, ignore);
}
bool insert_all_rows_into_tmp_table(THD *thd,
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 5dc3826f0d6..4b5f1d1f6d6 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -1798,7 +1798,7 @@ end:
delete thd;
if (org_thd)
org_thd->store_globals(); /* purecov: inspected */
-
+
default_tz= default_tz_name ? global_system_variables.time_zone
: my_tz_SYSTEM;
@@ -1873,7 +1873,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
#ifdef ABBR_ARE_USED
char chars[MY_MAX(TZ_MAX_CHARS + 1, (2 * (MY_TZNAME_MAX + 1)))];
#endif
- /*
+ /*
Used as a temporary tz_info until we decide that we actually want to
allocate and keep the tz info and tz name in tz_storage.
*/
@@ -2030,7 +2030,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables)
mysql.time_zone_transition table. Here we additionally need records
in ascending order by index scan also satisfies us.
*/
- table= tz_tables->table;
+ table= tz_tables->table;
table->field[0]->store((longlong) tzid, TRUE);
if (table->file->ha_index_init(0, 1))
goto end;
@@ -2365,7 +2365,7 @@ my_tz_find(THD *thd, const String *name)
/**
Convert leap seconds into non-leap
- This function will convert the leap seconds added by the OS to
+ This function will convert the leap seconds added by the OS to
non-leap seconds, e.g. 23:59:59, 23:59:60 -> 23:59:59, 00:00:01 ...
This check is not checking for years on purpose : although it's not a
complete check this way it doesn't require looking (and having installed)
@@ -2729,11 +2729,20 @@ static const char *trunc_tables_const=
"TRUNCATE TABLE time_zone_name;\n"
"TRUNCATE TABLE time_zone_transition;\n"
"TRUNCATE TABLE time_zone_transition_type;\n";
+
+/*
+ These queries need to return FALSE/0 when the 'wsrep*' variables do not
+ exist at all.
+ Moving the WHERE clause into the sum(...) seems like the obvious solution
+ here, but it does not work in bootstrap mode (see MDEV-28782 and
+ 0e4cf497ca11a7298e2bd896cb594bd52085a1d4).
+ Thus we use coalesce(..., 0) instead,
+*/
static const char *wsrep_is_on=
- "select sum(SESSION_VALUE='ON')"
+ "select coalesce(sum(SESSION_VALUE='ON'), 0)"
" from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on'";
static const char *wsrep_cannot_replicate_tz=
- "select sum(GLOBAL_VALUE NOT LIKE @replicate_opt)"
+ "select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0)"
" from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode'";
int
@@ -2774,7 +2783,7 @@ main(int argc, char **argv)
" ORDER BY OPTION DESC;\n");
printf("set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (%s);\n", wsrep_cannot_replicate_tz);
if (opt_skip_write_binlog)
- /* If turn off session wsrep if we cannot replicate using galera.
+ /* We turn off session wsrep if we cannot replicate using galera.
Disable sql_log_bin as the name implies. */
printf("execute immediate if(@wsrep_is_on, 'SET @save_wsrep_on=@@WSREP_ON, WSREP_ON=OFF', 'do 0');\n"
"SET @save_sql_log_bin=@@SQL_LOG_BIN;\n"
diff --git a/storage/columnstore/columnstore b/storage/columnstore/columnstore
-Subproject 1929e73ecb65b57533669f3e70d7555715c6505
+Subproject ac0741e82d71ea8faf6865c4c6604f02449cfa2
diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt
index f36cdcb3b00..bad7d916043 100644
--- a/storage/connect/CMakeLists.txt
+++ b/storage/connect/CMakeLists.txt
@@ -361,26 +361,26 @@ IF(CONNECT_WITH_REST)
# MESSAGE(STATUS "=====> REST support is ON")
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp tabrest.h)
add_definitions(-DREST_SUPPORT)
-# FIND_PACKAGE(cpprestsdk QUIET)
-# IF (cpprestsdk_FOUND)
+# FIND_PACKAGE(cpprestsdk QUIET)
+# IF (cpprestsdk_FOUND)
# IF(UNIX)
-## INCLUDE_DIRECTORIES(${CPPRESTSDK_INCLUDE_DIR})
-## If needed edit next line to set the path to libcpprest.so
-# SET(REST_LIBRARY -lcpprest)
-# MESSAGE (STATUS ${REST_LIBRARY})
+## INCLUDE_DIRECTORIES(${CPPRESTSDK_INCLUDE_DIR})
+## If needed edit next line to set the path to libcpprest.so
+# SET(REST_LIBRARY -lcpprest)
+# MESSAGE (STATUS ${REST_LIBRARY})
# ELSE(NOT UNIX)
-## Next line sets debug compile mode matching cpprest_2_10d.dll
-## when it was binary installed (can be change later in Visual Studio)
-## Comment it out if not needed depending on your cpprestsdk installation.
+## Next line sets debug compile mode matching cpprest_2_10d.dll
+## when it was binary installed (can be change later in Visual Studio)
+## Comment it out if not needed depending on your cpprestsdk installation.
# SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
# ENDIF(UNIX)
-## IF(REST_LIBRARY) why this? how about Windows
-# SET(CONNECT_SOURCES ${CONNECT_SOURCES} restget.cpp)
-# add_definitions(-DREST_SOURCE)
-## ENDIF()
-##ELSE(NOT cpprestsdk_FOUND)
-## MESSAGE(STATUS "=====> cpprestsdk package not found")
-# ENDIF (cpprestsdk_FOUND)
+## IF(REST_LIBRARY) why this? how about Windows
+# SET(CONNECT_SOURCES ${CONNECT_SOURCES} restget.cpp)
+# add_definitions(-DREST_SOURCE)
+## ENDIF()
+## ELSE(NOT cpprestsdk_FOUND)
+# MESSAGE(STATUS "=====> cpprestsdk package not found")
+# ENDIF (cpprestsdk_FOUND)
ENDIF(CONNECT_WITH_REST)
ADD_FEATURE_INFO(CONNECT_REST CONNECT_WITH_REST "Support for REST API in the CONNECT storage engine")
@@ -423,28 +423,22 @@ IF(MSVC AND (CMAKE_CXX_FLAGS MATCHES "/MP"))
ENDIF()
ENDIF()
-IF(WIN32)
+IF(MSVC)
IF (libmongoc-1.0_FOUND)
SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS
"/DELAYLOAD:libbson-1.0.dll /DELAYLOAD:libmongoc-1.0.dll")
- ENDIF(libmongoc-1.0_FOUND)
-
-# Install some extra files that belong to connect engine
-
- INSTALL(FILES "$<TARGET_FILE_DIR:connect>/ha_connect.lib"
- DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
-ENDIF(WIN32)
-
-IF(MSVC)
- # Temporarily disable "conversion from size_t .."
+ ENDIF()
+ # Temporarily disable "conversion from size_t .." warnings
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4267")
ENDIF()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996")
string(REPLACE "/permissive-" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ INSTALL(FILES "$<TARGET_FILE_DIR:connect>/ha_connect.lib"
+ DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
ENDIF()
+
IF(CONNECT_WITH_JDBC AND JAVA_FOUND AND JNI_FOUND)
# TODO: Find how to compile and install the java wrapper classes
# Find required libraries and include directories
diff --git a/storage/connect/connect.h b/storage/connect/connect.h
index d1fc2ea592f..af1b9ba726e 100644
--- a/storage/connect/connect.h
+++ b/storage/connect/connect.h
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
/**************** Cnt H Declares Source Code File (.H) *****************/
/* Name: CONNECT.H Version 2.4 */
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 775b50f1f4f..802015341b8 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
/**
@file ha_connect.cc
@@ -266,7 +266,7 @@ bool Force_Bson(void);
size_t GetWorkSize(void);
void SetWorkSize(size_t);
extern "C" const char *msglang(void);
-
+static char *strz(PGLOBAL g, LEX_CSTRING &ls);
static void PopUser(PCONNECT xp);
static PCONNECT GetUser(THD *thd, PCONNECT xp);
static PGLOBAL GetPlug(THD *thd, PCONNECT& lxp);
@@ -1301,10 +1301,10 @@ PCSZ GetStringTableOption(PGLOBAL g, PTOS options, PCSZ opname, PCSZ sdef)
opval= options->filter;
else if (!stricmp(opname, "Data_charset"))
opval= options->data_charset;
- else if (!stricmp(opname, "Http") || !stricmp(opname, "URL"))
- opval= options->http;
- else if (!stricmp(opname, "Uri"))
- opval= options->uri;
+ else if (!stricmp(opname, "Http") || !stricmp(opname, "URL"))
+ opval= options->http;
+ else if (!stricmp(opname, "Uri"))
+ opval= options->uri;
if (!opval && options->oplist)
opval= GetListOption(g, opname, options->oplist);
@@ -5663,7 +5663,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
String sql(buf, sizeof(buf), system_charset_info);
sql.copy(STRING_WITH_LEN("CREATE TABLE whatever ("), system_charset_info);
- user= host= pwd= tbl= src= col= ocl= pic= fcl= skc= rnk= zfn= NULL;
+ user= host= pwd= tbl= src= col= ocl= pic= fcl= skc= rnk= zfn= NULL;
dsn= url= NULL;
// Get the useful create options
@@ -5715,7 +5715,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
#if defined(ZIP_SUPPORT)
zfn= GetListOption(g, "Zipfile", topt->oplist, NULL);
#endif // ZIP_SUPPORT
- } else {
+ } else {
host= "localhost";
user= ((ttp == TAB_ODBC || ttp == TAB_JDBC) ? NULL : "root");
} // endif option_list
@@ -5852,17 +5852,17 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
PJDBCDEF jdef= new(g) JDBCDEF();
jdef->SetName(create_info->alias.str);
- sjp = (PJPARM)PlugSubAlloc(g, NULL, sizeof(JDBCPARM));
- sjp->Driver = driver;
- // sjp->Properties = prop;
- sjp->Fsize = 0;
- sjp->Scrollable = false;
-
- if ((rc = jdef->ParseURL(g, url, false)) == RC_OK) {
- sjp->Url = url;
- sjp->User = (char*)user;
- sjp->Pwd = (char*)pwd;
- ok = true;
+ sjp= (PJPARM)PlugSubAlloc(g, NULL, sizeof(JDBCPARM));
+ sjp->Driver= driver;
+ // sjp->Properties= prop;
+ sjp->Fsize= 0;
+ sjp->Scrollable= false;
+
+ if ((rc= jdef->ParseURL(g, url, false)) == RC_OK) {
+ sjp->Url= url;
+ sjp->User= (char*)user;
+ sjp->Pwd= (char*)pwd;
+ ok= true;
} else if (rc == RC_NF) {
if (jdef->GetTabname())
tab= (char*)jdef->GetTabname();
@@ -5977,11 +5977,11 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
break;
#endif // JAVA_SUPPORT
#if defined(REST_SUPPORT)
- case TAB_REST:
- if (!topt->http)
- strcpy(g->Message, "Missing REST HTTP option");
- else
- ok = true;
+ case TAB_REST:
+ if (!topt->http)
+ sprintf(g->Message, "Missing %s HTTP address", topt->type);
+ else
+ ok= true;
break;
#endif // REST_SUPPORT
@@ -6145,11 +6145,11 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
break;
#endif // LIBXML2_SUPPORT || DOMDOC_SUPPORT
#if defined(REST_SUPPORT)
- case TAB_REST:
- qrp = RESTColumns(g, topt, tab, (char *)db, fnc == FNC_COL);
- break;
+ case TAB_REST:
+ qrp= RESTColumns(g, topt, tab, (char *)db, fnc == FNC_COL);
+ break;
#endif // REST_SUPPORT
- case TAB_OEM:
+ case TAB_OEM:
qrp= OEMColumns(g, topt, tab, (char*)db, fnc == FNC_COL);
break;
default:
@@ -6466,7 +6466,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
TABTYPE type;
TABLE *st= table; // Probably unuseful
THD *thd= ha_thd();
- LEX_CSTRING cnc = table_arg->s->connect_string;
+ LEX_CSTRING cnc= table_arg->s->connect_string;
myf utf8_flag= thd->get_utf8_flag();
#if defined(WITH_PARTITION_STORAGE_ENGINE)
partition_info *part_info= table_arg->part_info;
diff --git a/storage/connect/ha_connect.h b/storage/connect/ha_connect.h
index d1aca22b01f..090f8343e1e 100644
--- a/storage/connect/ha_connect.h
+++ b/storage/connect/ha_connect.h
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
/** @file ha_connect.h
Author Olivier Bertrand
diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp
index 4da780e4104..f6325c89c5a 100644
--- a/storage/connect/jsonudf.cpp
+++ b/storage/connect/jsonudf.cpp
@@ -1816,7 +1816,7 @@ static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i)
} // endif *s
if (n < 1)
- return (PCSZ) "Key";
+ return (PCSZ) "Key";
if (!b) {
if ((p = (PSZ)PlgDBSubAlloc(g, NULL, n + 1))) {
@@ -1830,7 +1830,7 @@ static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i)
} // endif s
- return (char*) s;
+ return s;
} // endif count
return (PCSZ) "Key";
diff --git a/storage/connect/mysql-test/connect/r/jdbc_postgresql.result b/storage/connect/mysql-test/connect/r/jdbc_postgresql.result
index 07cc3c465ea..bec1dc8725b 100644
--- a/storage/connect/mysql-test/connect/r/jdbc_postgresql.result
+++ b/storage/connect/mysql-test/connect/r/jdbc_postgresql.result
@@ -1,4 +1,4 @@
-SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/JavaWrappers.jar;C:/Jconnectors/postgresql-42.2.1.jar';
+SET GLOBAL connect_class_path='C:/MariaDB-10.0/MariaDB/storage/connect/mysql-test/connect/std_data/JavaWrappers.jar;C:/Jconnectors/postgresql-42.2.1.jar';
CREATE TABLE t2 (
command varchar(128) not null,
number int(5) not null flag=1,
diff --git a/storage/connect/tabwmi.cpp b/storage/connect/tabwmi.cpp
index 113f006b5a1..f90ff98ca35 100644
--- a/storage/connect/tabwmi.cpp
+++ b/storage/connect/tabwmi.cpp
@@ -771,7 +771,7 @@ void WMICOL::ReadColumn(PGLOBAL g)
break;
case VT_I4:
case VT_UI4:
- Value->SetValue(Prop.lVal);
+ Value->SetValue((long long)Prop.lVal);
break;
case VT_I2:
case VT_UI2:
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index 429a973c05d..13c3b5a18cb 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -760,6 +760,9 @@ btr_page_get_father_block(
rec_t* rec
= page_rec_get_next(page_get_infimum_rec(buf_block_get_frame(
block)));
+ if (UNIV_UNLIKELY(!rec)) {
+ return nullptr;
+ }
btr_cur_position(index, rec, block, cursor);
return(btr_page_get_father_node_ptr(offsets, heap, cursor, mtr));
}
@@ -777,6 +780,9 @@ bool btr_page_get_father(dict_index_t* index, buf_block_t* block, mtr_t* mtr,
rec_t* rec
= page_rec_get_next(page_get_infimum_rec(buf_block_get_frame(
block)));
+ if (UNIV_UNLIKELY(!rec)) {
+ return false;
+ }
btr_cur_position(index, rec, block, cursor);
heap = mem_heap_create(100);
@@ -1240,8 +1246,6 @@ btr_write_autoinc(dict_index_t* index, ib_uint64_t autoinc, bool reset)
static dberr_t btr_page_reorganize_low(page_cur_t *cursor, dict_index_t *index,
mtr_t *mtr)
{
- const mtr_log_t log_mode= mtr->set_log_mode(MTR_LOG_NO_REDO);
-
buf_block_t *const block= cursor->block;
ut_ad(mtr->memo_contains_flagged(block, MTR_MEMO_PAGE_X_FIX));
@@ -1252,15 +1256,20 @@ static dberr_t btr_page_reorganize_low(page_cur_t *cursor, dict_index_t *index,
ut_ad(index->is_dummy || block->page.id().page_no() != index->page ||
!page_has_siblings(block->page.frame));
+ /* Save the cursor position. */
+ const ulint pos= page_rec_get_n_recs_before(cursor->rec);
+
+ if (UNIV_UNLIKELY(pos == ULINT_UNDEFINED))
+ return DB_CORRUPTION;
+
+ btr_search_drop_page_hash_index(block);
+
buf_block_t *old= buf_block_alloc();
/* Copy the old page to temporary space */
memcpy_aligned<UNIV_PAGE_SIZE_MIN>(old->page.frame, block->page.frame,
srv_page_size);
- btr_search_drop_page_hash_index(block);
-
- /* Save the cursor position. */
- const ulint pos= page_rec_get_n_recs_before(cursor->rec);
+ const mtr_log_t log_mode= mtr->set_log_mode(MTR_LOG_NO_REDO);
page_create(block, mtr, index->table->not_redundant());
if (index->is_spatial())
@@ -1272,10 +1281,13 @@ static dberr_t btr_page_reorganize_low(page_cur_t *cursor, dict_index_t *index,
/* Copy the records from the temporary space to the recreated page;
do not copy the lock bits yet */
- if (dberr_t err=
- page_copy_rec_list_end_no_locks(block, old,
- page_get_infimum_rec(old->page.frame),
- index, mtr))
+ dberr_t err=
+ page_copy_rec_list_end_no_locks(block, old,
+ page_get_infimum_rec(old->page.frame),
+ index, mtr);
+ mtr->set_log_mode(log_mode);
+
+ if (UNIV_UNLIKELY(err != DB_SUCCESS))
return err;
/* Copy the PAGE_MAX_TRX_ID or PAGE_ROOT_AUTO_INC. */
@@ -1315,12 +1327,10 @@ static dberr_t btr_page_reorganize_low(page_cur_t *cursor, dict_index_t *index,
}
/* Restore the cursor position. */
- if (pos)
- cursor->rec = page_rec_get_nth(block->page.frame, pos);
- else
+ if (!pos)
ut_ad(cursor->rec == page_get_infimum_rec(block->page.frame));
-
- mtr->set_log_mode(log_mode);
+ else if (!(cursor->rec= page_rec_get_nth(block->page.frame, pos)))
+ return DB_CORRUPTION;
if (block->page.id().page_no() != index->page ||
fil_page_get_type(old->page.frame) != FIL_PAGE_TYPE_INSTANT)
@@ -1543,13 +1553,16 @@ btr_page_reorganize(
return btr_page_reorganize_low(cursor, index, mtr);
ulint pos= page_rec_get_n_recs_before(cursor->rec);
+ if (UNIV_UNLIKELY(pos == ULINT_UNDEFINED))
+ return DB_CORRUPTION;
+
dberr_t err= page_zip_reorganize(cursor->block, index, page_zip_level, mtr,
true);
if (err == DB_FAIL);
- else if (pos)
- cursor->rec= page_rec_get_nth(cursor->block->page.frame, pos);
- else
+ else if (!pos)
ut_ad(cursor->rec == page_get_infimum_rec(cursor->block->page.frame));
+ else if (!(cursor->rec= page_rec_get_nth(cursor->block->page.frame, pos)))
+ err= DB_CORRUPTION;
return err;
}
@@ -1745,7 +1758,6 @@ btr_root_raise_and_insert(
dberr_t* err) /*!< out: error code */
{
dict_index_t* index;
- ulint new_page_no;
rec_t* rec;
dtuple_t* node_ptr;
ulint level;
@@ -1907,8 +1919,9 @@ btr_root_raise_and_insert(
*heap = mem_heap_create(1000);
}
+ const uint32_t new_page_no = new_block->page.id().page_no();
rec = page_rec_get_next(page_get_infimum_rec(new_block->page.frame));
- new_page_no = new_block->page.id().page_no();
+ ut_ad(rec); /* We just created the page. */
/* Build the node pointer (= node key and page address) for the
child */
@@ -1961,9 +1974,20 @@ btr_root_raise_and_insert(
ibuf_reset_free_bits(new_block);
}
- if (tuple != NULL) {
+ if (tuple) {
+ ut_ad(dtuple_check_typed(tuple));
/* Reposition the cursor to the child node */
- page_cur_search(new_block, index, tuple, page_cursor);
+ ulint low_match = 0, up_match = 0;
+
+ if (page_cur_search_with_match(new_block, index, tuple,
+ PAGE_CUR_LE,
+ &up_match, &low_match,
+ page_cursor, nullptr)) {
+ if (err) {
+ *err = DB_CORRUPTION;
+ }
+ return nullptr;
+ }
} else {
/* Set cursor to first record on child node */
page_cur_set_before_first(new_block, page_cursor);
@@ -2042,7 +2066,7 @@ btr_page_get_split_rec_to_right(const btr_cur_t* cursor, rec_t** split_rec)
insert_point = page_rec_get_next(insert_point);
- if (page_rec_is_supremum(insert_point)) {
+ if (!insert_point || page_rec_is_supremum(insert_point)) {
insert_point = NULL;
} else {
insert_point = page_rec_get_next(insert_point);
@@ -2230,20 +2254,20 @@ btr_page_insert_fits(
end_rec) will end up on the other half page from tuple when it is
inserted. */
- if (split_rec == NULL) {
- rec = page_rec_get_next(page_get_infimum_rec(page));
+ if (!(end_rec = split_rec)) {
end_rec = page_rec_get_next(btr_cur_get_rec(cursor));
-
} else if (cmp_dtuple_rec(tuple, split_rec, cursor->index,
- *offsets) >= 0) {
-
- rec = page_rec_get_next(page_get_infimum_rec(page));
- end_rec = split_rec;
- } else {
+ *offsets) < 0) {
rec = split_rec;
end_rec = page_get_supremum_rec(page);
+ goto got_rec;
}
+ if (!(rec = page_rec_get_next(page_get_infimum_rec(page)))) {
+ return false;
+ }
+
+got_rec:
if (total_data + page_dir_calc_reserved_space(total_n_recs)
<= free_space) {
@@ -2275,7 +2299,9 @@ btr_page_insert_fits(
return(true);
}
- rec = page_rec_get_next_const(rec);
+ if (!(rec = page_rec_get_next_const(rec))) {
+ break;
+ }
}
return(false);
@@ -2512,8 +2538,10 @@ btr_page_tuple_smaller(
/* Read the first user record in the page. */
block = btr_cur_get_block(cursor);
page_cur_set_before_first(block, &pcur);
- page_cur_move_to_next(&pcur);
- first_rec = page_cur_get_rec(&pcur);
+ if (UNIV_UNLIKELY(!(first_rec = page_cur_move_to_next(&pcur)))) {
+ ut_ad("corrupted page" == 0);
+ return false;
+ }
*offsets = rec_get_offsets(first_rec, cursor->index, *offsets,
page_is_leaf(block->page.frame)
@@ -2555,6 +2583,7 @@ btr_insert_into_right_sibling(
MTR_MEMO_X_LOCK | MTR_MEMO_SX_LOCK));
ut_ad(mtr->memo_contains_flagged(block, MTR_MEMO_PAGE_X_FIX));
ut_ad(heap);
+ ut_ad(dtuple_check_typed(tuple));
if (next_page_no == FIL_NULL || !page_rec_is_supremum(
page_rec_get_next(btr_cur_get_rec(cursor)))) {
@@ -2582,9 +2611,13 @@ btr_insert_into_right_sibling(
return nullptr;
}
- page_cur_search(
- next_block, cursor->index, tuple, PAGE_CUR_LE,
- &next_page_cursor);
+ ulint up_match = 0, low_match = 0;
+
+ if (page_cur_search_with_match(next_block, cursor->index, tuple,
+ PAGE_CUR_LE, &up_match, &low_match,
+ &next_page_cursor, nullptr)) {
+ return nullptr;
+ }
max_size = page_get_max_insert_size_after_reorganize(next_page, 1);
@@ -2789,6 +2822,7 @@ btr_page_split_and_insert(
ulint n_uniq;
ut_ad(*err == DB_SUCCESS);
+ ut_ad(dtuple_check_typed(tuple));
if (cursor->index->is_spatial()) {
/* Split rtree page and update parent */
@@ -2856,9 +2890,16 @@ func_start:
page_get_infimum_rec(page));
} else {
split_rec = NULL;
+ goto got_split_rec;
+ }
+
+ if (UNIV_UNLIKELY(!split_rec)) {
+ *err = DB_CORRUPTION;
+ return nullptr;
}
}
+got_split_rec:
/* 2. Allocate a new page to the index */
const uint16_t page_level = btr_page_get_level(page);
new_block = btr_page_alloc(cursor->index, hint_page_no, direction,
@@ -2908,9 +2949,17 @@ func_start:
goto insert_empty;
}
} else if (insert_left) {
- ut_a(n_iterations > 0);
+ if (UNIV_UNLIKELY(!n_iterations)) {
+corrupted:
+ *err = DB_CORRUPTION;
+ return nullptr;
+ }
first_rec = page_rec_get_next(page_get_infimum_rec(page));
+insert_move_limit:
move_limit = page_rec_get_next(btr_cur_get_rec(cursor));
+ if (UNIV_UNLIKELY(!first_rec || !move_limit)) {
+ goto corrupted;
+ }
} else {
insert_empty:
ut_ad(!split_rec);
@@ -2921,7 +2970,7 @@ insert_empty:
first_rec = rec_convert_dtuple_to_rec(buf, cursor->index,
tuple, n_ext);
- move_limit = page_rec_get_next(btr_cur_get_rec(cursor));
+ goto insert_move_limit;
}
/* 4. Do first the modifications in the tree structure */
@@ -3088,7 +3137,14 @@ insert_empty:
/* 7. Reposition the cursor for insert and try insertion */
page_cursor = btr_cur_get_page_cur(cursor);
- page_cur_search(insert_block, cursor->index, tuple, page_cursor);
+ ulint up_match = 0, low_match = 0;
+
+ if (page_cur_search_with_match(insert_block, cursor->index, tuple,
+ PAGE_CUR_LE, &up_match, &low_match,
+ page_cursor, nullptr)) {
+ *err = DB_CORRUPTION;
+ return nullptr;
+ }
rec = page_cur_tuple_insert(page_cursor, tuple, cursor->index,
offsets, heap, n_ext, mtr);
@@ -3442,8 +3498,8 @@ btr_compress(
mtr_t* mtr) /*!< in/out: mini-transaction */
{
dict_index_t* index;
- buf_block_t* merge_block;
- page_t* merge_page = NULL;
+ buf_block_t* merge_block = nullptr;
+ page_t* merge_page = nullptr;
page_zip_des_t* merge_page_zip;
ibool is_left;
buf_block_t* block;
@@ -3501,7 +3557,10 @@ btr_compress(
if (adjust) {
nth_rec = page_rec_get_n_recs_before(btr_cur_get_rec(cursor));
- ut_ad(nth_rec > 0);
+ if (UNIV_UNLIKELY(!nth_rec || nth_rec == ULINT_UNDEFINED)) {
+ err = DB_CORRUPTION;
+ goto err_exit;
+ }
}
if (left_page_no == FIL_NULL && right_page_no == FIL_NULL) {
@@ -3650,7 +3709,12 @@ cannot_merge:
}
if (adjust) {
- nth_rec += page_rec_get_n_recs_before(orig_pred);
+ ulint n = page_rec_get_n_recs_before(orig_pred);
+ if (UNIV_UNLIKELY(!n || n == ULINT_UNDEFINED)) {
+ err = DB_CORRUPTION;
+ goto err_exit;
+ }
+ nth_rec += n;
}
} else {
rec_t* orig_succ;
@@ -3868,16 +3932,20 @@ cannot_merge:
ut_ad(leftmost_child
|| btr_check_node_ptr(index, merge_block, mtr));
func_exit:
- MONITOR_INC(MONITOR_INDEX_MERGE_SUCCESSFUL);
-
if (adjust) {
ut_ad(nth_rec > 0);
- btr_cur_position(
- index,
- page_rec_get_nth(merge_block->page.frame,
- nth_rec),
- merge_block, cursor);
- }
+ if (rec_t* nth
+ = page_rec_get_nth(merge_block->page.frame,
+ nth_rec)) {
+ btr_cur_position(index, nth,
+ merge_block, cursor);
+ } else {
+ err = DB_CORRUPTION;
+ goto err_exit;
+ }
+ }
+
+ MONITOR_INC(MONITOR_INDEX_MERGE_SUCCESSFUL);
} else {
err_exit:
/* We play it safe and reset the free bits. */
@@ -3914,6 +3982,9 @@ btr_discard_only_page_on_level(
const trx_id_t max_trx_id = page_get_max_trx_id(block->page.frame);
const rec_t* r = page_rec_get_next(
page_get_infimum_rec(block->page.frame));
+ /* In the caller we checked that a valid key exists in the page,
+ because we were able to look up a parent page. */
+ ut_ad(r);
ut_ad(rec_is_metadata(r, *index) == index->is_instant());
while (block->page.id().page_no() != dict_index_get_page(index)) {
@@ -4085,14 +4156,17 @@ btr_discard_page(
ut_d(parent_is_different = page_rec_is_supremum(
page_rec_get_next(btr_cur_get_rec(&parent_cursor))));
- if (!page_is_leaf(merge_block->page.frame)) {
- rec_t* node_ptr = page_rec_get_next(
- page_get_infimum_rec(merge_block->page.frame));
+ if (page_is_leaf(merge_block->page.frame)) {
+ } else if (rec_t* node_ptr =
+ page_rec_get_next(page_get_infimum_rec(
+ merge_block->page.frame))) {
ut_ad(page_rec_is_user_rec(node_ptr));
/* We have to mark the leftmost node pointer as the
predefined minimum record. */
btr_set_min_rec_mark<true>(node_ptr, *merge_block,
mtr);
+ } else {
+ return DB_CORRUPTION;
}
} else {
btr_discard_only_page_on_level(index, block, mtr);
@@ -4553,16 +4627,15 @@ next_field:
/************************************************************//**
Checks the size and number of fields in records based on the definition of
the index.
-@return TRUE if ok */
+@return true if ok */
static
-ibool
+bool
btr_index_page_validate(
/*====================*/
buf_block_t* block, /*!< in: index page */
dict_index_t* index) /*!< in: index */
{
page_cur_t cur;
- ibool ret = TRUE;
#ifndef DBUG_OFF
ulint nth = 1;
#endif /* !DBUG_OFF */
@@ -4579,17 +4652,13 @@ btr_index_page_validate(
page_cur_get_page(&cur), 0))
== 1););
- page_cur_move_to_next(&cur);
-
- for (;;) {
+ while (page_cur_move_to_next(&cur)) {
if (page_cur_is_after_last(&cur)) {
-
- break;
+ return true;
}
if (!btr_index_rec_validate(cur.rec, index, TRUE)) {
-
- return(FALSE);
+ break;
}
/* Verify that page_rec_get_nth_const() is correctly
@@ -4601,11 +4670,9 @@ btr_index_page_validate(
cur.rec)));
ut_a(nth++ == page_rec_get_n_recs_before(
cur.rec)););
-
- page_cur_move_to_next(&cur);
}
- return(ret);
+ return false;
}
/************************************************************//**
@@ -4723,14 +4790,16 @@ btr_validate_level(
ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
if (page_is_leaf(page)) {
+corrupted:
err = DB_CORRUPTION;
goto invalid_page;
}
page_cur_set_before_first(block, &cursor);
- page_cur_move_to_next(&cursor);
+ if (!(node_ptr = page_cur_move_to_next(&cursor))) {
+ goto corrupted;
+ }
- node_ptr = page_cur_get_rec(&cursor);
offsets = rec_get_offsets(node_ptr, index, offsets, 0,
ULINT_UNDEFINED, &heap);
@@ -4854,12 +4923,16 @@ func_exit:
}
if (!(rec = page_rec_get_prev(page_get_supremum_rec(page)))) {
+broken_links:
btr_validate_report1(index, level, block);
fputs("InnoDB: broken record links\n", stderr);
goto invalid_page;
}
- right_rec = page_rec_get_next(page_get_infimum_rec(
- right_page));
+ if (!(right_rec =
+ page_rec_get_next(page_get_infimum_rec(right_page)))) {
+ goto broken_links;
+ }
+
offsets = rec_get_offsets(rec, index, offsets,
page_is_leaf(page)
? index->n_core_fields : 0,
@@ -4890,19 +4963,26 @@ func_exit:
fputs("InnoDB: record ", stderr);
rec = page_rec_get_next(
page_get_infimum_rec(right_page));
- rec_print(stderr, rec, index);
+ if (rec) {
+ rec_print(stderr, rec, index);
+ }
putc('\n', stderr);
- err = DB_CORRUPTION;
+ err = DB_CORRUPTION;
}
}
- if (level > 0 && left_page_no == FIL_NULL
- && !(REC_INFO_MIN_REC_FLAG & rec_get_info_bits(
- page_rec_get_next(page_get_infimum_rec(page)),
- page_is_comp(page)))) {
- btr_validate_report1(index, level, block);
- ib::error() << "Missing REC_INFO_MIN_REC_FLAG";
+ if (!level || left_page_no != FIL_NULL) {
+ } else if (const rec_t* first =
+ page_rec_get_next_const(page_get_infimum_rec(page))) {
+ if (!(REC_INFO_MIN_REC_FLAG
+ & rec_get_info_bits(first, page_is_comp(page)))) {
+ btr_validate_report1(index, level, block);
+ ib::error() << "Missing REC_INFO_MIN_REC_FLAG";
+ err = DB_CORRUPTION;
+ }
+ } else {
err = DB_CORRUPTION;
+ goto node_ptr_fails;
}
/* Similarly skip the father node check for spatial index for now,
@@ -4913,11 +4993,14 @@ func_exit:
We will add special validation mechanism for R-tree later (WL #7520) */
if (index->is_btree() && block->page.id().page_no() != index->page) {
/* Check father node pointers */
- rec_t* node_ptr;
+ rec_t* node_ptr
+ = page_rec_get_next(page_get_infimum_rec(page));
+ if (!node_ptr) {
+ err = DB_CORRUPTION;
+ goto node_ptr_fails;
+ }
- btr_cur_position(
- index, page_rec_get_next(page_get_infimum_rec(page)),
- block, &node_cur);
+ btr_cur_position(index, node_ptr, block, &node_cur);
offsets = btr_page_get_father_node_ptr_for_validate(
offsets, heap, &node_cur, &mtr);
@@ -4966,17 +5049,15 @@ func_exit:
goto node_ptr_fails;
}
- if (!page_is_leaf(page)) {
+ if (page_is_leaf(page)) {
+ } else if (const rec_t* first_rec =
+ page_rec_get_next(page_get_infimum_rec(page))) {
node_ptr_tuple = dict_index_build_node_ptr(
- index,
- page_rec_get_next(page_get_infimum_rec(page)),
+ index, first_rec,
0, heap, btr_page_get_level(page));
if (cmp_dtuple_rec(node_ptr_tuple, node_ptr, index,
offsets)) {
- const rec_t* first_rec = page_rec_get_next(
- page_get_infimum_rec(page));
-
btr_validate_report1(index, level, block);
ib::error() << "Node ptrs differ on levels > 0";
@@ -4986,14 +5067,17 @@ func_exit:
fputs("InnoDB: first rec ", stderr);
rec_print(stderr, first_rec, index);
putc('\n', stderr);
- err = DB_CORRUPTION;
+ err = DB_CORRUPTION;
goto node_ptr_fails;
}
+ } else {
+ err = DB_CORRUPTION;
+ goto node_ptr_fails;
}
if (left_page_no == FIL_NULL) {
if (page_has_prev(father_page)
- || node_ptr != page_rec_get_next(
+ || node_ptr != page_rec_get_next(
page_get_infimum_rec(father_page))) {
err = DB_CORRUPTION;
goto node_ptr_fails;
@@ -5007,11 +5091,8 @@ func_exit:
err = DB_CORRUPTION;
goto node_ptr_fails;
}
- } else {
- const rec_t* right_node_ptr;
-
- right_node_ptr = page_rec_get_next(node_ptr);
-
+ } else if (const rec_t* right_node_ptr
+ = page_rec_get_next(node_ptr)) {
if (!lockout && rightmost_child) {
/* To obey latch order of tree blocks,
@@ -5042,11 +5123,12 @@ func_exit:
}
btr_cur_position(
- index, page_rec_get_next(
- page_get_infimum_rec(
- buf_block_get_frame(
- right_block))),
+ index,
+ page_get_infimum_rec(right_block->page.frame),
right_block, &right_node_cur);
+ if (!page_cur_move_to_next(&right_node_cur.page_cur)) {
+ goto node_pointer_corrupted;
+ }
offsets = btr_page_get_father_node_ptr_for_validate(
offsets, heap, &right_node_cur, &mtr);
@@ -5056,6 +5138,7 @@ func_exit:
if (btr_cur_get_rec(&right_node_cur)
!= right_node_ptr) {
+node_pointer_corrupted:
err = DB_CORRUPTION;
fputs("InnoDB: node pointer to"
" the right page is wrong\n",
@@ -5093,6 +5176,8 @@ func_exit:
block);
}
}
+ } else {
+ err = DB_CORRUPTION;
}
}
diff --git a/storage/innobase/btr/btr0bulk.cc b/storage/innobase/btr/btr0bulk.cc
index c56df29cbbc..c64bda46cbb 100644
--- a/storage/innobase/btr/btr0bulk.cc
+++ b/storage/innobase/btr/btr0bulk.cc
@@ -1199,6 +1199,9 @@ err_exit:
first_rec = page_rec_get_next(
page_get_infimum_rec(last_block->page.frame));
+ /* Because this index tree is being created by this thread,
+ we assume that it cannot be corrupted. */
+ ut_ad(first_rec);
ut_ad(page_rec_is_user_rec(first_rec));
/* Copy last page to root page. */
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index d9c77add505..b4cee3acb53 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -403,15 +403,13 @@ unreadable:
ut_ad(page_cur_is_before_first(&cur.page_cur));
ut_ad(page_is_leaf(cur.page_cur.block->page.frame));
- page_cur_move_to_next(&cur.page_cur);
-
- const rec_t* rec = cur.page_cur.rec;
+ const rec_t* rec = page_cur_move_to_next(&cur.page_cur);
const ulint comp = dict_table_is_comp(index->table);
- const ulint info_bits = rec_get_info_bits(rec, comp);
+ const ulint info_bits = rec ? rec_get_info_bits(rec, comp) : 0;
if (page_rec_is_supremum(rec)
|| !(info_bits & REC_INFO_MIN_REC_FLAG)) {
- if (!index->is_instant()) {
+ if (rec && !index->is_instant()) {
/* The FIL_PAGE_TYPE_INSTANT and PAGE_INSTANT may be
assigned even if instant ADD COLUMN was not
committed. Changes to these page header fields are not
@@ -884,6 +882,21 @@ btr_cur_latch_for_root_leaf(
return(RW_NO_LATCH); /* avoid compiler warnings */
}
+/** @return whether the distance between two records is at most the
+specified value */
+static bool
+page_rec_distance_is_at_most(const rec_t *left, const rec_t *right, ulint val)
+{
+ do
+ {
+ if (left == right)
+ return true;
+ left= page_rec_get_next_const(left);
+ }
+ while (left && val--);
+ return false;
+}
+
/** Detects whether the modifying record might need a modifying tree structure.
@param[in] index index
@param[in] page page
@@ -1910,23 +1923,30 @@ retry_page_get:
DICT_INDEX_SPATIAL_NODEPTR_SIZE + 1;
}
#ifdef BTR_CUR_HASH_ADAPT
- } else if (height == 0 && index->is_btree() && btr_search_enabled
- && !(tuple->info_bits & REC_INFO_MIN_REC_FLAG)) {
+ } else if (height == 0 && btr_search_enabled
+ && !(tuple->info_bits & REC_INFO_MIN_REC_FLAG)
+ && index->is_btree()) {
/* The adaptive hash index is only used when searching
for leaf pages (height==0), but not in r-trees.
We only need the byte prefix comparison for the purpose
of updating the adaptive hash index. */
- page_cur_search_with_match_bytes(
+ if (page_cur_search_with_match_bytes(
block, index, tuple, page_mode, &up_match, &up_bytes,
- &low_match, &low_bytes, page_cursor);
+ &low_match, &low_bytes, page_cursor)) {
+ err = DB_CORRUPTION;
+ goto func_exit;
+ }
#endif /* BTR_CUR_HASH_ADAPT */
} else {
/* Search for complete index fields. */
up_bytes = low_bytes = 0;
- page_cur_search_with_match(
+ if (page_cur_search_with_match(
block, index, tuple, page_mode, &up_match,
&low_match, page_cursor,
- need_path ? cursor->rtr_info : NULL);
+ need_path ? cursor->rtr_info : nullptr)) {
+ err = DB_CORRUPTION;
+ goto func_exit;
+ }
}
/* If this is the desired level, leave the loop */
@@ -2094,6 +2114,11 @@ need_opposite_intention:
ut_ad(upper_rw_latch == RW_X_LATCH);
+ if (UNIV_UNLIKELY(!first_rec)) {
+ corrupted:
+ err = DB_CORRUPTION;
+ goto func_exit;
+ }
if (node_ptr == first_rec
|| page_rec_is_last(node_ptr, page)) {
detected_same_key_root = true;
@@ -2128,8 +2153,7 @@ need_opposite_intention:
detected_same_key_root = true;
}
} else {
- err = DB_CORRUPTION;
- goto func_exit;
+ goto corrupted;
}
}
}
@@ -2238,11 +2262,14 @@ need_opposite_intention:
? cursor->rtr_info : NULL;
for (ulint i = 0; i < n_blocks; i++) {
- page_cur_search_with_match(
+ if (page_cur_search_with_match(
tree_blocks[i], index, tuple,
page_mode, &up_match,
&low_match, page_cursor,
- rtr_info);
+ rtr_info)) {
+ err = DB_CORRUPTION;
+ goto func_exit;
+ }
}
goto search_loop;
@@ -2675,13 +2702,11 @@ btr_cur_open_at_index_side(
ut_ad(height > 0);
- if (from_left) {
- page_cur_move_to_next(page_cursor);
- } else {
- if (!page_cur_move_to_prev(page_cursor)) {
- err = DB_CORRUPTION;
- goto exit_loop;
- }
+ if (from_left
+ ? !page_cur_move_to_next(page_cursor)
+ : !page_cur_move_to_prev(page_cursor)) {
+ err = DB_CORRUPTION;
+ goto exit_loop;
}
height--;
@@ -3114,7 +3139,7 @@ btr_cur_insert_if_possible(
/*************************************************************//**
For an insert, checks the locks and does the undo logging if desired.
-@return DB_SUCCESS, DB_WAIT_LOCK, DB_FAIL, or error number */
+@return DB_SUCCESS, DB_LOCK_WAIT, DB_FAIL, or error number */
UNIV_INLINE MY_ATTRIBUTE((warn_unused_result, nonnull(2,3,5,6)))
dberr_t
btr_cur_ins_lock_and_undo(
@@ -3265,7 +3290,7 @@ It is assumed that mtr holds an x-latch on the page. The operation does
not succeed if there is too little space on the page. If there is just
one record on the page, the insert will always succeed; this is to
prevent trying to split a page with just one record.
-@return DB_SUCCESS, DB_WAIT_LOCK, DB_FAIL, or error number */
+@return DB_SUCCESS, DB_LOCK_WAIT, DB_FAIL, or error number */
dberr_t
btr_cur_optimistic_insert(
/*======================*/
@@ -3733,7 +3758,7 @@ func_exit:
/*************************************************************//**
For an update, checks the locks and does the undo logging.
-@return DB_SUCCESS, DB_WAIT_LOCK, or error number */
+@return DB_SUCCESS, DB_LOCK_WAIT, or error number */
UNIV_INLINE MY_ATTRIBUTE((warn_unused_result))
dberr_t
btr_cur_upd_lock_and_undo(
@@ -4679,8 +4704,7 @@ any_extern:
rec = btr_cur_insert_if_possible(cursor, new_entry, offsets, heap,
0/*n_ext*/, mtr);
if (UNIV_UNLIKELY(!rec)) {
- err = DB_CORRUPTION;
- goto func_exit;
+ goto corrupted;
}
if (UNIV_UNLIKELY(update->is_metadata())) {
@@ -4698,8 +4722,11 @@ any_extern:
block->page.id());
}
- page_cur_move_to_next(page_cursor);
ut_ad(err == DB_SUCCESS);
+ if (!page_cur_move_to_next(page_cursor)) {
+corrupted:
+ err = DB_CORRUPTION;
+ }
func_exit:
if (!(flags & BTR_KEEP_IBUF_BITMAP)
@@ -5451,6 +5478,10 @@ btr_cur_optimistic_delete(
dict_index_t* index = cursor->index;
const rec_t* first_rec = page_rec_get_next_const(
page_get_infimum_rec(block->page.frame));
+ if (UNIV_UNLIKELY(!first_rec)) {
+ err = DB_CORRUPTION;
+ goto func_exit;
+ }
ut_ad(!index->is_instant()
|| rec_is_metadata(first_rec, *index));
const bool is_metadata = rec_is_metadata(rec, *index);
@@ -5680,6 +5711,10 @@ btr_cur_pessimistic_delete(
const rec_t* first_rec = page_rec_get_next_const(
page_get_infimum_rec(page));
+ if (UNIV_UNLIKELY(!first_rec)) {
+ *err = DB_CORRUPTION;
+ goto err_exit;
+ }
ut_ad(!index->is_instant()
|| rec_is_metadata(first_rec, *index));
if (is_metadata || !index->is_instant()
@@ -5726,7 +5761,11 @@ discard_page:
goto return_after_reservations;
}
- next_rec = page_rec_get_next(rec);
+ if (UNIV_UNLIKELY(!(next_rec = page_rec_get_next(rec)))) {
+ ut_ad(!ret);
+ *err = DB_CORRUPTION;
+ goto err_exit;
+ }
if (!page_has_prev(page)) {
/* If we delete the leftmost node pointer on a
@@ -5993,9 +6032,10 @@ public:
if (dtuple_get_n_fields(&m_tuple) > 0)
{
m_up_bytes= m_low_bytes= 0;
- page_cur_search_with_match(m_block, index(), &m_tuple, m_page_mode,
- &m_up_match, &m_low_match, &m_page_cur,
- nullptr);
+ if (page_cur_search_with_match(m_block, index(), &m_tuple, m_page_mode,
+ &m_up_match, &m_low_match, &m_page_cur,
+ nullptr))
+ return false;
m_nth_rec= page_rec_get_n_recs_before(page_cur_get_rec(&m_page_cur));
}
else if (left)
@@ -6003,7 +6043,8 @@ public:
page_cur_set_before_first(m_block, &m_page_cur);
if (level)
{
- page_cur_move_to_next(&m_page_cur);
+ if (!page_cur_move_to_next(&m_page_cur))
+ return false;
m_nth_rec= 1;
}
else
diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc
index 5a278fbd9a2..0c1959bb554 100644
--- a/storage/innobase/btr/btr0defragment.cc
+++ b/storage/innobase/btr/btr0defragment.cc
@@ -259,9 +259,10 @@ btr_defragment_calc_n_recs_for_size(
const ulint n_core = page_is_leaf(page) ? index->n_core_fields : 0;
page_cur_set_before_first(block, &cur);
- page_cur_move_to_next(&cur);
- while (page_cur_get_rec(&cur) != page_get_supremum_rec(page)) {
- rec_t* cur_rec = page_cur_get_rec(&cur);
+ while (rec_t* cur_rec = page_cur_move_to_next(&cur)) {
+ if (page_rec_is_supremum(cur_rec)) {
+ break;
+ }
offsets = rec_get_offsets(cur_rec, index, offsets, n_core,
ULINT_UNDEFINED, &heap);
ulint rec_size = rec_offs_size(offsets);
@@ -271,7 +272,6 @@ btr_defragment_calc_n_recs_for_size(
break;
}
n_recs ++;
- page_cur_move_to_next(&cur);
}
*n_recs_size = size;
if (UNIV_LIKELY_NULL(heap)) {
@@ -356,8 +356,9 @@ btr_defragment_merge_pages(
target_n_recs = n_recs_to_move;
dberr_t err;
while (n_recs_to_move > 0) {
- rec = page_rec_get_nth(from_page,
- n_recs_to_move + 1);
+ if (!(rec = page_rec_get_nth(from_page, n_recs_to_move + 1))) {
+ return nullptr;
+ }
orig_pred = page_copy_rec_list_start(
to_block, from_block, rec, index, mtr, &err);
if (orig_pred)
@@ -439,14 +440,17 @@ btr_defragment_merge_pages(
}
rec = page_rec_get_next(
page_get_infimum_rec(from_page));
+ if (!rec) {
+ return nullptr;
+ }
node_ptr = dict_index_build_node_ptr(
index, rec, page_get_page_no(from_page),
heap, level);
if (btr_insert_on_non_leaf_level(0, index, level+1,
- node_ptr, mtr)
- != DB_SUCCESS) {
+ node_ptr, mtr)
+ != DB_SUCCESS) {
return nullptr;
- }
+ }
}
to_block = from_block;
}
diff --git a/storage/innobase/btr/btr0pcur.cc b/storage/innobase/btr/btr0pcur.cc
index 5d9e4ecbeb2..a043b990f4c 100644
--- a/storage/innobase/btr/btr0pcur.cc
+++ b/storage/innobase/btr/btr0pcur.cc
@@ -176,10 +176,16 @@ before_first:
} else if (page_rec_is_infimum_low(offs)) {
rec = page_rec_get_next(rec);
+ if (UNIV_UNLIKELY(!rec)) {
+ ut_ad("corrupted page" == 0);
+ goto before_first;
+ }
+
if (rec_is_metadata(rec, *index)) {
ut_ad(!page_has_prev(block->page.frame));
rec = page_rec_get_next(rec);
- if (page_rec_is_supremum(rec)) {
+ ut_ad(rec);
+ if (!rec || page_rec_is_supremum(rec)) {
goto before_first;
}
}
diff --git a/storage/innobase/btr/btr0sea.cc b/storage/innobase/btr/btr0sea.cc
index 9a51f49aaae..0df4b67022b 100644
--- a/storage/innobase/btr/btr0sea.cc
+++ b/storage/innobase/btr/btr0sea.cc
@@ -788,8 +788,20 @@ btr_search_check_guess(
rec = btr_cur_get_rec(cursor);
- ut_ad(page_rec_is_user_rec(rec));
- ut_ad(page_rec_is_leaf(rec));
+ if (UNIV_UNLIKELY(!page_rec_is_user_rec(rec)
+ || !page_rec_is_leaf(rec))) {
+ ut_ad("corrupted index" == 0);
+ return false;
+ } else if (cursor->index->table->not_redundant()) {
+ switch (rec_get_status(rec)) {
+ case REC_STATUS_INSTANT:
+ case REC_STATUS_ORDINARY:
+ break;
+ default:
+ ut_ad("corrupted index" == 0);
+ return false;
+ }
+ }
match = 0;
@@ -848,6 +860,17 @@ btr_search_check_guess(
goto exit_func;
}
+ if (cursor->index->table->not_redundant()) {
+ switch (rec_get_status(prev_rec)) {
+ case REC_STATUS_INSTANT:
+ case REC_STATUS_ORDINARY:
+ break;
+ default:
+ ut_ad("corrupted index" == 0);
+ goto exit_func;
+ }
+ }
+
offsets = rec_get_offsets(prev_rec, cursor->index, offsets,
cursor->index->n_core_fields,
n_unique, &heap);
@@ -863,15 +886,31 @@ btr_search_check_guess(
const rec_t* next_rec = page_rec_get_next(rec);
+ if (UNIV_UNLIKELY(!next_rec)) {
+ ut_ad("corrupted index" == 0);
+ goto exit_func;
+ }
+
if (page_rec_is_supremum(next_rec)) {
if (!page_has_next(page_align(next_rec))) {
cursor->up_match = 0;
- success = TRUE;
+ success = true;
}
goto exit_func;
}
+ if (cursor->index->table->not_redundant()) {
+ switch (rec_get_status(next_rec)) {
+ case REC_STATUS_INSTANT:
+ case REC_STATUS_ORDINARY:
+ break;
+ default:
+ ut_ad("corrupted index" == 0);
+ goto exit_func;
+ }
+ }
+
offsets = rec_get_offsets(next_rec, cursor->index, offsets,
cursor->index->n_core_fields,
n_unique, &heap);
@@ -1246,14 +1285,7 @@ void btr_search_drop_page_hash_index(buf_block_t* block)
{
ulint n_fields;
ulint n_bytes;
- const page_t* page;
const rec_t* rec;
- ulint fold;
- ulint prev_fold;
- ulint n_cached;
- ulint n_recs;
- ulint* folds;
- ulint i;
mem_heap_t* heap;
rec_offs* offsets;
@@ -1324,33 +1356,50 @@ retry:
ut_a(n_fields > 0 || n_bytes > 0);
- page = block->page.frame;
- n_recs = page_get_n_recs(page);
+ const page_t* const page = block->page.frame;
+ ulint n_recs = page_get_n_recs(page);
+ if (!n_recs) {
+ ut_ad("corrupted adaptive hash index" == 0);
+ return;
+ }
/* Calculate and cache fold values into an array for fast deletion
from the hash index */
- folds = (ulint*) ut_malloc_nokey(n_recs * sizeof(ulint));
-
- n_cached = 0;
-
rec = page_get_infimum_rec(page);
rec = page_rec_get_next_low(rec, page_is_comp(page));
- if (rec_is_metadata(rec, *index)) {
+
+ ulint* folds;
+ ulint n_cached = 0;
+ ulint prev_fold = 0;
+
+ if (rec && rec_is_metadata(rec, *index)) {
rec = page_rec_get_next_low(rec, page_is_comp(page));
+ if (!--n_recs) {
+ /* The page only contains the hidden metadata record
+ for instant ALTER TABLE that the adaptive hash index
+ never points to. */
+ folds = nullptr;
+ goto all_deleted;
+ }
}
- prev_fold = 0;
-
- heap = NULL;
- offsets = NULL;
+ folds = (ulint*) ut_malloc_nokey(n_recs * sizeof(ulint));
+ heap = nullptr;
+ offsets = nullptr;
- while (!page_rec_is_supremum(rec)) {
+ while (rec) {
+ if (n_cached >= n_recs) {
+ ut_ad(page_rec_is_supremum(rec));
+ break;
+ }
+ ut_ad(page_rec_is_user_rec(rec));
offsets = rec_get_offsets(
rec, index, offsets, index->n_core_fields,
btr_search_get_n_fields(n_fields, n_bytes),
&heap);
- fold = rec_fold(rec, offsets, n_fields, n_bytes, index_id);
+ const ulint fold = rec_fold(rec, offsets, n_fields, n_bytes,
+ index_id);
if (fold == prev_fold && prev_fold != 0) {
@@ -1359,11 +1408,13 @@ retry:
/* Remove all hash nodes pointing to this page from the
hash chain */
+ folds[n_cached++] = fold;
- folds[n_cached] = fold;
- n_cached++;
next_rec:
rec = page_rec_get_next_low(rec, page_rec_is_comp(rec));
+ if (!rec || page_rec_is_supremum(rec)) {
+ break;
+ }
prev_fold = fold;
}
@@ -1371,6 +1422,7 @@ next_rec:
mem_heap_free(heap);
}
+all_deleted:
if (!is_freed) {
part->latch.wr_lock(SRW_LOCK_CALL);
@@ -1395,7 +1447,7 @@ next_rec:
goto retry;
}
- for (i = 0; i < n_cached; i++) {
+ for (ulint i = 0; i < n_cached; i++) {
ha_remove_all_nodes_to_page(&part->table, part->heap,
folds[i], page);
}
@@ -1409,7 +1461,7 @@ next_rec:
}
}
- block->index = NULL;
+ block->index = nullptr;
MONITOR_INC(MONITOR_ADAPTIVE_HASH_PAGE_REMOVED);
MONITOR_INC_VALUE(MONITOR_ADAPTIVE_HASH_ROW_REMOVED, n_cached);
@@ -1473,7 +1525,6 @@ btr_search_build_page_hash_index(
bool left_side)
{
const rec_t* rec;
- const rec_t* next_rec;
ulint fold;
ulint next_fold;
ulint n_cached;
@@ -1539,10 +1590,11 @@ btr_search_build_page_hash_index(
}
rec = page_rec_get_next_const(page_get_infimum_rec(page));
+ if (!rec) return;
if (rec_is_metadata(rec, *index)) {
rec = page_rec_get_next_const(rec);
- if (!--n_recs) return;
+ if (!rec || !--n_recs) return;
}
/* Calculate and cache fold values and corresponding records into
@@ -1572,9 +1624,7 @@ btr_search_build_page_hash_index(
n_cached++;
}
- for (;;) {
- next_rec = page_rec_get_next_const(rec);
-
+ while (const rec_t* next_rec = page_rec_get_next_const(rec)) {
if (page_rec_is_supremum(next_rec)) {
if (!left_side) {
@@ -1907,12 +1957,15 @@ void btr_search_update_hash_node_on_insert(btr_cur_t *cursor,
&& (cursor->n_fields == block->curr_n_fields)
&& (cursor->n_bytes == block->curr_n_bytes)
&& !block->curr_left_side) {
-
- if (ha_search_and_update_if_found(
- &btr_search_sys.get_part(*cursor->index)->table,
- cursor->fold, rec, block,
- page_rec_get_next(rec))) {
- MONITOR_INC(MONITOR_ADAPTIVE_HASH_ROW_UPDATED);
+ if (const rec_t *new_rec = page_rec_get_next_const(rec)) {
+ if (ha_search_and_update_if_found(
+ &btr_search_sys.get_part(*cursor->index)
+ ->table,
+ cursor->fold, rec, block, new_rec)) {
+ MONITOR_INC(MONITOR_ADAPTIVE_HASH_ROW_UPDATED);
+ }
+ } else {
+ ut_ad("corrupted page" == 0);
}
func_exit:
@@ -1977,6 +2030,7 @@ void btr_search_update_hash_on_insert(btr_cur_t *cursor,
if (index != cursor->index) {
ut_ad(index->id == cursor->index->id);
+drop:
btr_search_drop_page_hash_index(block);
return;
}
@@ -1989,7 +2043,9 @@ void btr_search_update_hash_on_insert(btr_cur_t *cursor,
const bool left_side = block->curr_left_side;
ins_rec = page_rec_get_next_const(rec);
+ if (UNIV_UNLIKELY(!ins_rec)) goto drop;
next_rec = page_rec_get_next_const(ins_rec);
+ if (UNIV_UNLIKELY(!next_rec)) goto drop;
offsets = rec_get_offsets(ins_rec, index, offsets,
index->n_core_fields,
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index aaf85570616..871d1ba682b 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -758,6 +758,7 @@ in the event that you want all of the memory to be dumped
to a core file.
Returns number of errors found in madvise calls. */
+MY_ATTRIBUTE((used))
int
buf_madvise_do_dump()
{
diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc
index 4eacc2c311c..4a2ac88d97c 100644
--- a/storage/innobase/buf/buf0rea.cc
+++ b/storage/innobase/buf/buf0rea.cc
@@ -41,6 +41,7 @@ Created 11/5/1995 Heikki Tuuri
#include "os0file.h"
#include "srv0start.h"
#include "srv0srv.h"
+#include "log.h"
/** If there are buf_pool.curr_size per the number below pending reads, then
read-ahead is not done: this is to prevent flooding the buffer pool with
@@ -710,8 +711,10 @@ void buf_read_recv_pages(uint32_t space_id, st_::span<uint32_t> page_nos)
true);
if (err != DB_SUCCESS) {
- ib::error() << "Recovery failed to read "
- << cur_page_id;
+ sql_print_error("InnoDB: Recovery failed to read page "
+ UINT32PF " from %s",
+ cur_page_id.page_no(),
+ space->chain.start->name);
}
}
diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc
index ed0096445b4..46ca661b156 100644
--- a/storage/innobase/dict/dict0stats.cc
+++ b/storage/innobase/dict/dict0stats.cc
@@ -1239,7 +1239,7 @@ btr_estimate_number_of_different_key_vals(dict_index_t* index,
const ulint n_core = page_is_leaf(page)
? index->n_core_fields : 0;
- if (!page_rec_is_supremum(rec)) {
+ if (rec && !page_rec_is_supremum(rec)) {
not_empty_flag = 1;
offsets_rec = rec_get_offsets(rec, index, offsets_rec,
n_core,
@@ -1254,7 +1254,7 @@ btr_estimate_number_of_different_key_vals(dict_index_t* index,
while (!page_rec_is_supremum(rec)) {
ulint matched_fields;
rec_t* next_rec = page_rec_get_next(rec);
- if (page_rec_is_supremum(next_rec)) {
+ if (!next_rec || page_rec_is_supremum(next_rec)) {
total_external_size +=
btr_rec_get_externally_stored_len(
rec, offsets_rec);
@@ -1630,12 +1630,11 @@ dict_stats_analyze_index_level(
if (btr_pcur_open_at_index_side(
true, index, BTR_SEARCH_TREE_ALREADY_S_LATCHED,
- &pcur, true, level, mtr) != DB_SUCCESS) {
+ &pcur, true, level, mtr) != DB_SUCCESS
+ || !btr_pcur_move_to_next_on_page(&pcur)) {
goto func_exit;
}
- btr_pcur_move_to_next_on_page(&pcur);
-
page = btr_pcur_get_page(&pcur);
/* The page must not be empty, except when
@@ -1877,6 +1876,36 @@ func_exit:
mem_heap_free(heap);
}
+
+/************************************************************//**
+Gets the pointer to the next non delete-marked record on the page.
+If all subsequent records are delete-marked, then this function
+will return the supremum record.
+@return pointer to next non delete-marked record or pointer to supremum */
+static
+const rec_t*
+page_rec_get_next_non_del_marked(
+/*=============================*/
+ const rec_t* rec) /*!< in: pointer to record */
+{
+ const page_t *const page= page_align(rec);
+
+ if (page_is_comp(page))
+ {
+ for (rec= page_rec_get_next_low(rec, TRUE);
+ rec && rec_get_deleted_flag(rec, TRUE);
+ rec= page_rec_get_next_low(rec, TRUE));
+ return rec ? rec : page + PAGE_NEW_SUPREMUM;
+ }
+ else
+ {
+ for (rec= page_rec_get_next_low(rec, FALSE);
+ rec && rec_get_deleted_flag(rec, FALSE);
+ rec= page_rec_get_next_low(rec, FALSE));
+ return rec ? rec : page + PAGE_OLD_SUPREMUM;
+ }
+}
+
/** Scan a page, reading records from left to right and counting the number
of distinct records (looking only at the first n_prefix
columns) and the number of external pages pointed by records from this page.
@@ -1934,7 +1963,7 @@ dict_stats_scan_page(
rec = get_next(page_get_infimum_rec(page));
- if (page_rec_is_supremum(rec)) {
+ if (!rec || page_rec_is_supremum(rec)) {
/* the page is empty or contains only delete-marked records */
*n_diff = 0;
*out_rec = NULL;
@@ -1953,7 +1982,7 @@ dict_stats_scan_page(
*n_diff = 1;
- while (!page_rec_is_supremum(next_rec)) {
+ while (next_rec && !page_rec_is_supremum(next_rec)) {
ulint matched_fields;
@@ -2242,12 +2271,11 @@ dict_stats_analyze_index_for_n_prefix(
if (btr_pcur_open_at_index_side(true, index,
BTR_SEARCH_TREE_ALREADY_S_LATCHED,
&pcur, true, n_diff_data->level, mtr)
- != DB_SUCCESS) {
+ != DB_SUCCESS
+ || !btr_pcur_move_to_next_on_page(&pcur)) {
return;
}
- btr_pcur_move_to_next_on_page(&pcur);
-
page = btr_pcur_get_page(&pcur);
const rec_t* first_rec = btr_pcur_get_rec(&pcur);
diff --git a/storage/innobase/fts/fts0que.cc b/storage/innobase/fts/fts0que.cc
index 2b9fbcfb569..4407224a24d 100644
--- a/storage/innobase/fts/fts0que.cc
+++ b/storage/innobase/fts/fts0que.cc
@@ -1203,6 +1203,14 @@ fts_query_difference(
return(query->error);
}
+/* Free the query intersection
+@param query query instance */
+static void fts_query_free_intersection(fts_query_t* query)
+{
+ fts_query_free_doc_ids(query, query->intersection);
+ query->intersection = NULL;
+}
+
/*****************************************************************//**
Intersect the token doc ids with the current set.
@return DB_SUCCESS if all go well */
@@ -1301,6 +1309,7 @@ fts_query_intersect(
/* error is passed by 'query->error' */
if (query->error != DB_SUCCESS) {
ut_ad(query->error == DB_FTS_EXCEED_RESULT_CACHE_LIMIT);
+ fts_query_free_intersection(query);
return(query->error);
}
@@ -1329,6 +1338,8 @@ fts_query_intersect(
ut_a(!query->multi_exist || (query->multi_exist
&& rbt_size(query->doc_ids) <= n_doc_ids));
+ } else if (query->intersection) {
+ fts_query_free_intersection(query);
}
}
@@ -1547,6 +1558,10 @@ fts_merge_doc_ids(
query, ranking->doc_id, ranking->rank);
if (query->error != DB_SUCCESS) {
+ if (query->intersection) {
+ ut_a(query->oper == FTS_EXIST);
+ fts_query_free_intersection(query);
+ }
DBUG_RETURN(query->error);
}
diff --git a/storage/innobase/gis/gis0rtree.cc b/storage/innobase/gis/gis0rtree.cc
index 3dd7fade872..59ad44ec093 100644
--- a/storage/innobase/gis/gis0rtree.cc
+++ b/storage/innobase/gis/gis0rtree.cc
@@ -405,21 +405,24 @@ update_mbr:
}
/* Insert the new rec. */
- page_cur_search_with_match(block, index, node_ptr,
- PAGE_CUR_LE , &up_match, &low_match,
- btr_cur_get_page_cur(cursor), NULL);
+ if (page_cur_search_with_match(block, index, node_ptr,
+ PAGE_CUR_LE,
+ &up_match, &low_match,
+ btr_cur_get_page_cur(cursor),
+ NULL)) {
+ goto err_exit;
+ }
err = btr_cur_optimistic_insert(flags, cursor, &insert_offsets,
&heap, node_ptr, &insert_rec,
&dummy_big_rec, 0, NULL, mtr);
- if (!ins_suc && err == DB_SUCCESS) {
- ins_suc = true;
- }
-
/* If optimistic insert fail, try reorganize the page
and insert again. */
- if (err != DB_SUCCESS && ins_suc) {
+ if (err == DB_SUCCESS) {
+ ins_suc = true;
+ } else if (ins_suc) {
+ ut_ad(err == DB_FAIL);
err = btr_page_reorganize(btr_cur_get_page_cur(cursor),
index, mtr);
if (err == DB_SUCCESS) {
@@ -431,6 +434,7 @@ update_mbr:
/* Will do pessimistic insert */
if (err != DB_SUCCESS) {
+ ut_ad(err == DB_FAIL);
ins_suc = false;
}
}
@@ -462,10 +466,14 @@ update_mbr:
cur2_pno = btr_node_ptr_get_child_page_no(cur2_rec, offsets2);
if ((del_page_no != cur2_pno)
|| (cur2_rec == insert_rec)) {
- cur2_rec = page_rec_get_next(
- page_get_infimum_rec(page));
+ cur2_rec = page_get_infimum_rec(page);
+
+ while ((cur2_rec
+ = page_rec_get_next(cur2_rec))) {
+ if (page_rec_is_supremum(cur2_rec)) {
+ break;
+ }
- while (!page_rec_is_supremum(cur2_rec)) {
offsets2 = rec_get_offsets(cur2_rec, index,
NULL,
n_core,
@@ -480,10 +488,7 @@ update_mbr:
break;
}
}
- cur2_rec = page_rec_get_next(cur2_rec);
}
-
- ut_ad(!page_rec_is_supremum(cur2_rec));
}
rec_info = rec_get_info_bits(cur2_rec,
@@ -529,7 +534,7 @@ update_mbr:
|| (REC_INFO_MIN_REC_FLAG & rec_get_info_bits(
page_rec_get_next(page_get_infimum_rec(page)),
page_is_comp(page))));
-
+err_exit:
mem_heap_free(heap);
}
@@ -556,11 +561,10 @@ rtr_adjust_upper_level(
rec_offs* offsets;
mem_heap_t* heap;
ulint level;
- dtuple_t* node_ptr_upper;
+ dtuple_t* node_ptr_upper = nullptr;
page_cur_t* page_cursor;
lock_prdt_t prdt;
lock_prdt_t new_prdt;
- dberr_t err;
big_rec_t* dummy_big_rec;
rec_t* rec;
@@ -597,29 +601,32 @@ rtr_adjust_upper_level(
}
}
- /* Insert the node for the new page. */
- node_ptr_upper = rtr_index_build_node_ptr(
- index, new_mbr,
- page_rec_get_next(page_get_infimum_rec(new_block->page.frame)),
- new_page_no, heap);
-
- ulint up_match = 0;
- ulint low_match = 0;
-
- buf_block_t* father_block = btr_cur_get_block(&cursor);
-
- page_cur_search_with_match(
- father_block, index, node_ptr_upper,
- PAGE_CUR_LE , &up_match, &low_match,
- btr_cur_get_page_cur(&cursor), NULL);
+ dberr_t err;
- err = btr_cur_optimistic_insert(
- flags
- | BTR_NO_LOCKING_FLAG
- | BTR_KEEP_SYS_FLAG
- | BTR_NO_UNDO_LOG_FLAG,
- &cursor, &offsets, &heap,
- node_ptr_upper, &rec, &dummy_big_rec, 0, NULL, mtr);
+ if (const rec_t* first = page_rec_get_next_const(
+ page_get_infimum_rec(new_block->page.frame))) {
+ /* Insert the node for the new page. */
+ node_ptr_upper = rtr_index_build_node_ptr(
+ index, new_mbr, first, new_page_no, heap);
+ ulint up_match = 0, low_match = 0;
+ err = page_cur_search_with_match(btr_cur_get_block(&cursor),
+ index, node_ptr_upper,
+ PAGE_CUR_LE,
+ &up_match, &low_match,
+ btr_cur_get_page_cur(&cursor),
+ NULL)
+ ? DB_CORRUPTION
+ : btr_cur_optimistic_insert(flags
+ | BTR_NO_LOCKING_FLAG
+ | BTR_KEEP_SYS_FLAG
+ | BTR_NO_UNDO_LOG_FLAG,
+ &cursor, &offsets, &heap,
+ node_ptr_upper, &rec,
+ &dummy_big_rec, 0, NULL,
+ mtr);
+ } else {
+ err = DB_CORRUPTION;
+ }
if (err == DB_FAIL) {
cursor.rtr_info = sea_cur->rtr_info;
@@ -638,23 +645,27 @@ rtr_adjust_upper_level(
node_ptr_upper, &rec,
&dummy_big_rec, 0, NULL, mtr);
cursor.rtr_info = NULL;
- ut_a(err == DB_SUCCESS);
-
mem_heap_free(new_heap);
}
- prdt.data = static_cast<void*>(mbr);
- prdt.op = 0;
- new_prdt.data = static_cast<void*>(new_mbr);
- new_prdt.op = 0;
+ if (err == DB_SUCCESS) {
+ prdt.data = static_cast<void*>(mbr);
+ prdt.op = 0;
+ new_prdt.data = static_cast<void*>(new_mbr);
+ new_prdt.op = 0;
- lock_prdt_update_parent(block, new_block, &prdt, &new_prdt,
- page_cursor->block->page.id());
+ lock_prdt_update_parent(block, new_block, &prdt, &new_prdt,
+ page_cursor->block->page.id());
+ }
mem_heap_free(heap);
ut_ad(block->zip_size() == index->table->space->zip_size());
+ if (err != DB_SUCCESS) {
+ return err;
+ }
+
const uint32_t next_page_no = btr_page_get_next(block->page.frame);
if (next_page_no == FIL_NULL) {
@@ -765,13 +776,15 @@ rtr_split_page_move_rec_list(
&new_page_cursor,
index, cur_split_node->key, offsets, mtr);
- ut_a(rec);
+ if (UNIV_UNLIKELY
+ (!rec
+ || !page_cur_move_to_next(&new_page_cursor))) {
+ return DB_CORRUPTION;
+ }
lock_rec_restore_from_page_infimum(
*new_block, rec, block->page.id());
- page_cur_move_to_next(&new_page_cursor);
-
rec_move[moved].new_rec = rec;
rec_move[moved].old_rec = cur_split_node->key;
rec_move[moved].moved = false;
@@ -913,6 +926,11 @@ func_start:
if (!page_has_prev(page) && !page_is_leaf(page)) {
first_rec = page_rec_get_next(
page_get_infimum_rec(buf_block_get_frame(block)));
+ if (UNIV_UNLIKELY(!first_rec)) {
+corrupted:
+ *err = DB_CORRUPTION;
+ return nullptr;
+ }
}
/* Initial split nodes array. */
@@ -1098,9 +1116,13 @@ func_start:
/* Reposition the cursor for insert and try insertion */
page_cursor = btr_cur_get_page_cur(cursor);
+ ulint up_match = 0, low_match = 0;
- page_cur_search(insert_block, cursor->index, tuple,
- PAGE_CUR_LE, page_cursor);
+ if (page_cur_search_with_match(insert_block, cursor->index, tuple,
+ PAGE_CUR_LE, &up_match, &low_match,
+ page_cursor, nullptr)) {
+ goto corrupted;
+ }
/* It's possible that the new record is too big to be inserted into
the page, and it'll need the second round split in this case.
@@ -1154,7 +1176,7 @@ after_insert:
the first ssn value from it after restart server. */
root_block = btr_root_block_get(cursor->index, RW_SX_LATCH, mtr, err);
- if (UNIV_UNLIKELY(!root_block)) {
+ if (UNIV_UNLIKELY(!root_block)) {
return nullptr;
}
@@ -1180,6 +1202,9 @@ after_insert:
rec_t* i_rec = page_rec_get_next(page_get_infimum_rec(
buf_block_get_frame(block)));
+ if (UNIV_UNLIKELY(!i_rec)) {
+ goto corrupted;
+ }
btr_cur_position(cursor->index, i_rec, block, cursor);
goto func_start;
@@ -1299,8 +1324,8 @@ rtr_page_copy_rec_list_end_no_locks(
page_cur_position(rec, block, &cur1);
- if (page_cur_is_before_first(&cur1)) {
- page_cur_move_to_next(&cur1);
+ if (page_cur_is_before_first(&cur1) && !page_cur_move_to_next(&cur1)) {
+ return DB_CORRUPTION;
}
ut_a(page_is_comp(new_page) == page_rec_is_comp(rec));
@@ -1309,6 +1334,9 @@ rtr_page_copy_rec_list_end_no_locks(
cur_rec = page_rec_get_next(
page_get_infimum_rec(buf_block_get_frame(new_block)));
+ if (UNIV_UNLIKELY(!cur_rec)) {
+ return DB_CORRUPTION;
+ }
page_cur_position(cur_rec, new_block, &page_cur);
/* Copy records from the original page to the new page */
@@ -1318,6 +1346,9 @@ rtr_page_copy_rec_list_end_no_locks(
if (page_rec_is_infimum(cur_rec)) {
cur_rec = page_rec_get_next(cur_rec);
+ if (UNIV_UNLIKELY(!cur_rec)) {
+ return DB_CORRUPTION;
+ }
}
offsets1 = rec_get_offsets(cur1_rec, index, offsets1, n_core,
@@ -1336,8 +1367,7 @@ rtr_page_copy_rec_list_end_no_locks(
goto move_to_prev;
} else if (cmp > 0) {
/* Skip small recs. */
- page_cur_move_to_next(&page_cur);
- cur_rec = page_cur_get_rec(&page_cur);
+ cur_rec = page_cur_move_to_next(&page_cur);
} else if (n_core) {
if (rec_get_deleted_flag(cur1_rec,
dict_table_is_comp(index->table))) {
@@ -1380,7 +1410,9 @@ move_to_prev:
rec_move[moved].moved = false;
moved++;
next:
- page_cur_move_to_next(&cur1);
+ if (UNIV_UNLIKELY(!page_cur_move_to_next(&cur1))) {
+ return DB_CORRUPTION;
+ }
}
*num_moved = moved;
@@ -1419,10 +1451,15 @@ rtr_page_copy_rec_list_start_no_locks(
rec_offs_init(offsets_2);
page_cur_set_before_first(block, &cur1);
- page_cur_move_to_next(&cur1);
+ if (UNIV_UNLIKELY(!page_cur_move_to_next(&cur1))) {
+ return DB_CORRUPTION;
+ }
cur_rec = page_rec_get_next(
page_get_infimum_rec(buf_block_get_frame(new_block)));
+ if (UNIV_UNLIKELY(!cur_rec)) {
+ return DB_CORRUPTION;
+ }
page_cur_position(cur_rec, new_block, &page_cur);
while (page_cur_get_rec(&cur1) != rec) {
@@ -1431,6 +1468,9 @@ rtr_page_copy_rec_list_start_no_locks(
if (page_rec_is_infimum(cur_rec)) {
cur_rec = page_rec_get_next(cur_rec);
+ if (UNIV_UNLIKELY(!cur_rec)) {
+ return DB_CORRUPTION;
+ }
}
offsets1 = rec_get_offsets(cur1_rec, index, offsets1, n_core,
@@ -1449,8 +1489,7 @@ rtr_page_copy_rec_list_start_no_locks(
goto move_to_prev;
} else if (cmp > 0) {
/* Skip small recs. */
- page_cur_move_to_next(&page_cur);
- cur_rec = page_cur_get_rec(&page_cur);
+ cur_rec = page_cur_move_to_next(&page_cur);
} else if (n_core) {
if (rec_get_deleted_flag(
cur1_rec,
@@ -1472,13 +1511,14 @@ rtr_page_copy_rec_list_start_no_locks(
if (page_rec_is_supremum(cur_rec)) {
move_to_prev:
cur_rec = page_cur_move_to_prev(&page_cur);
- if (UNIV_UNLIKELY(!cur_rec)) {
- return DB_CORRUPTION;
- }
} else {
cur_rec = page_cur_get_rec(&page_cur);
}
+ if (UNIV_UNLIKELY(!cur_rec)) {
+ return DB_CORRUPTION;
+ }
+
offsets1 = rec_get_offsets(cur1_rec, index, offsets1, n_core,
ULINT_UNDEFINED, &heap);
@@ -1493,7 +1533,9 @@ move_to_prev:
rec_move[moved].moved = false;
moved++;
next:
- page_cur_move_to_next(&cur1);
+ if (UNIV_UNLIKELY(!page_cur_move_to_next(&cur1))) {
+ return DB_CORRUPTION;
+ }
}
*num_moved = moved;
@@ -1559,7 +1601,7 @@ rtr_merge_and_update_mbr(
rtr_mbr_t new_mbr;
if (rtr_merge_mbr_changed(cursor, cursor2, offsets, offsets2,
- &new_mbr)) {
+ &new_mbr)) {
rtr_update_mbr_field(cursor, offsets, cursor2, child_page,
&new_mbr, NULL, mtr);
} else {
@@ -1604,10 +1646,9 @@ rtr_check_same_block(
{
ulint page_no = childb->page.id().page_no();
rec_offs* offsets;
- rec_t* rec = page_rec_get_next(page_get_infimum_rec(
- buf_block_get_frame(parentb)));
+ rec_t* rec = page_get_infimum_rec(parentb->page.frame);
- while (!page_rec_is_supremum(rec)) {
+ while ((rec = page_rec_get_next(rec)) && !page_rec_is_supremum(rec)) {
offsets = rec_get_offsets(
rec, index, NULL, 0, ULINT_UNDEFINED, &heap);
@@ -1615,8 +1656,6 @@ rtr_check_same_block(
btr_cur_position(index, rec, parentb, cursor);
return(true);
}
-
- rec = page_rec_get_next(rec);
}
return(false);
@@ -1826,9 +1865,9 @@ err_exit:
/* Scan records in root page and calculate area. */
double area = 0;
- for (const rec_t* rec = page_rec_get_next(
+ for (const rec_t* rec = page_rec_get_next_const(
page_get_infimum_rec(block->page.frame));
- !page_rec_is_supremum(rec);
+ rec && !page_rec_is_supremum(rec);
rec = page_rec_get_next_const(rec)) {
rtr_mbr_t mbr;
double rec_area;
diff --git a/storage/innobase/gis/gis0sea.cc b/storage/innobase/gis/gis0sea.cc
index 9eb56f1d46c..9a378d531d9 100644
--- a/storage/innobase/gis/gis0sea.cc
+++ b/storage/innobase/gis/gis0sea.cc
@@ -301,18 +301,17 @@ rtr_pcur_getnext_from_path(
page_cursor->rec = NULL;
if (mode == PAGE_CUR_RTREE_LOCATE) {
- if (level == target_level && level == 0) {
- ulint low_match;
+ if (target_level == 0 && level == 0) {
+ ulint low_match = 0, up_match = 0;
found = false;
- low_match = page_cur_search(
- block, index, tuple,
- PAGE_CUR_LE,
- btr_cur_get_page_cur(btr_cur));
-
- if (low_match == dtuple_get_n_fields_cmp(
- tuple)) {
+ if (!page_cur_search_with_match(
+ block, index, tuple, PAGE_CUR_LE,
+ &up_match, &low_match,
+ btr_cur_get_page_cur(btr_cur), nullptr)
+ && low_match
+ == dtuple_get_n_fields_cmp(tuple)) {
rec_t* rec = btr_cur_get_rec(btr_cur);
if (!rec_get_deleted_flag(rec,
@@ -803,6 +802,9 @@ rtr_page_get_father_block(
{
rec_t* rec = page_rec_get_next(
page_get_infimum_rec(buf_block_get_frame(block)));
+ if (!rec) {
+ return nullptr;
+ }
btr_cur_position(index, rec, block, cursor);
return(rtr_page_get_father_node_ptr(offsets, heap, sea_cur,
@@ -1238,11 +1240,14 @@ rtr_cur_restore_position(
ut_ad(r_cursor == node->cursor);
search_again:
+ ulint up_match = 0, low_match = 0;
+
block = buf_page_get_gen(
page_id_t(index->table->space_id, page_no),
zip_size, RW_X_LATCH, NULL, BUF_GET, mtr);
if (!block) {
+corrupted:
ret = false;
goto func_exit;
}
@@ -1251,8 +1256,13 @@ search_again:
page = buf_block_get_frame(block);
page_ssn = page_get_ssn_id(page);
- if (page_cur_search(block, index, tuple, PAGE_CUR_LE, page_cursor)
- == r_cursor->old_n_fields) {
+ if (page_cur_search_with_match(block, index, tuple, PAGE_CUR_LE,
+ &up_match, &low_match, page_cursor,
+ nullptr)) {
+ goto corrupted;
+ }
+
+ if (low_match == r_cursor->old_n_fields) {
const rec_t* rec;
const rec_offs* offsets1;
const rec_offs* offsets2;
@@ -1609,13 +1619,20 @@ rtr_cur_search_with_match(
mode = PAGE_CUR_WITHIN;
}
- rec = page_dir_slot_get_rec(page_dir_get_nth_slot(page, 0));
+ rec = page_dir_slot_get_rec_validate(page_dir_get_nth_slot(page, 0));
+
+ if (UNIV_UNLIKELY(!rec)) {
+ return false;
+ }
last_rec = rec;
best_rec = rec;
if (page_rec_is_infimum(rec)) {
rec = page_rec_get_next_const(rec);
+ if (UNIV_UNLIKELY(!rec)) {
+ return false;
+ }
}
/* Check insert tuple size is larger than first rec, and try to
@@ -1813,7 +1830,7 @@ rtr_cur_search_with_match(
}
/* All records on page are searched */
- if (page_rec_is_supremum(rec)) {
+ if (rec && page_rec_is_supremum(rec)) {
if (!n_core) {
if (!found) {
/* No match case, if it is for insertion,
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index cca216926cb..0babd37251e 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -2132,11 +2132,14 @@ non_empty:
return false;
}
rec= page_rec_get_next(btr_pcur_get_rec(&pcur));
+ if (UNIV_UNLIKELY(!rec))
+ goto non_empty;
if (rec_is_metadata(rec, *clust_index))
btr_pcur_get_page_cur(&pcur)->rec= rec;
scan_leaf:
cur= btr_pcur_get_page_cur(&pcur);
- page_cur_move_to_next(cur);
+ if (UNIV_UNLIKELY(!page_cur_move_to_next(cur)))
+ goto non_empty;
next_page:
if (next_page)
{
@@ -2154,7 +2157,8 @@ next_page:
goto non_empty;
btr_leaf_page_release(page_cur_get_block(cur), BTR_SEARCH_LEAF, &mtr);
page_cur_set_before_first(block, cur);
- page_cur_move_to_next(cur);
+ if (UNIV_UNLIKELY(!page_cur_move_to_next(cur)))
+ goto non_empty;
}
rec= page_cur_get_rec(cur);
@@ -6044,13 +6048,17 @@ func_exit:
return false;
}
ut_ad(btr_pcur_is_before_first_on_page(&pcur));
- btr_pcur_move_to_next_on_page(&pcur);
buf_block_t* block = btr_pcur_get_block(&pcur);
ut_ad(page_is_leaf(block->page.frame));
ut_ad(!page_has_prev(block->page.frame));
ut_ad(!buf_block_get_page_zip(block));
- const rec_t* rec = btr_pcur_get_rec(&pcur);
+ const rec_t* rec = btr_pcur_move_to_next_on_page(&pcur);
+ if (UNIV_UNLIKELY(!rec)) {
+ err = DB_CORRUPTION;
+ goto func_exit;
+ }
+
que_thr_t* thr = pars_complete_graph_for_exec(
NULL, trx, ctx->heap, NULL);
const bool is_root = block->page.id().page_no() == index->page;
@@ -6126,10 +6134,13 @@ func_exit:
&offsets, &offsets_heap, ctx->heap,
&big_rec, update, UPD_NODE_NO_ORD_CHANGE,
thr, trx->id, &mtr);
+ if (err == DB_SUCCESS) {
+ offsets = rec_get_offsets(
+ btr_pcur_get_rec(&pcur), index, offsets,
+ index->n_core_fields, ULINT_UNDEFINED,
+ &offsets_heap);
+ }
- offsets = rec_get_offsets(
- btr_pcur_get_rec(&pcur), index, offsets,
- index->n_core_fields, ULINT_UNDEFINED, &offsets_heap);
if (big_rec) {
if (err == DB_SUCCESS) {
err = btr_store_big_rec_extern_fields(
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index e1d08a49aef..7a80d3470d4 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -929,7 +929,7 @@ ibuf_page_low(
zip_size, RW_NO_LATCH, nullptr, BUF_GET, &local_mtr);
ret = block
- && ibuf_bitmap_page_get_bits_low(
+ && ibuf_bitmap_page_get_bits_low(
block->page.frame, page_id, zip_size,
MTR_MEMO_BUF_FIX, &local_mtr, IBUF_BITMAP_IBUF);
@@ -2048,7 +2048,7 @@ corruption:
if (page_rec_is_infimum(rec)) {
rec = page_rec_get_next_const(rec);
- if (page_rec_is_supremum(rec)) {
+ if (!rec || page_rec_is_supremum(rec)) {
return 0;
}
}
@@ -2102,7 +2102,7 @@ corruption:
sum_volumes = 0;
volume_for_page = 0;
- while (*n_stored < limit) {
+ while (*n_stored < limit && rec) {
if (page_rec_is_supremum(rec)) {
/* When no more records available, mark this with
another 'impossible' pair of space id, page no */
@@ -2862,10 +2862,10 @@ corruption:
static_assert(FIL_PAGE_NEXT % 4 == 0, "alignment");
static_assert(FIL_PAGE_OFFSET % 4 == 0, "alignment");
- if (UNIV_UNLIKELY(memcmp_aligned<4>(prev_page + FIL_PAGE_NEXT,
- page + FIL_PAGE_OFFSET, 4))) {
+ if (UNIV_UNLIKELY(memcmp_aligned<4>(prev_page + FIL_PAGE_NEXT,
+ page + FIL_PAGE_OFFSET, 4))) {
return srv_page_size;
- }
+ }
rec = page_rec_get_prev_const(page_get_supremum_rec(prev_page));
@@ -2909,6 +2909,9 @@ count_later:
for (; !page_rec_is_supremum(rec);
rec = page_rec_get_next_const(rec)) {
+ if (UNIV_UNLIKELY(!rec)) {
+ return srv_page_size;
+ }
if (page_no != ibuf_rec_get_page_no(mtr, rec)
|| space != ibuf_rec_get_space(mtr, rec)) {
@@ -2941,24 +2944,22 @@ count_later:
static_assert(FIL_PAGE_PREV % 4 == 0, "alignment");
static_assert(FIL_PAGE_OFFSET % 4 == 0, "alignment");
- if (UNIV_UNLIKELY(memcmp_aligned<4>(next_page + FIL_PAGE_PREV,
- page + FIL_PAGE_OFFSET, 4))) {
+ if (UNIV_UNLIKELY(memcmp_aligned<4>(next_page + FIL_PAGE_PREV,
+ page + FIL_PAGE_OFFSET, 4))) {
return 0;
- }
+ }
rec = page_get_infimum_rec(next_page);
rec = page_rec_get_next_const(rec);
- for (;; rec = page_rec_get_next_const(rec)) {
- ut_ad(page_align(rec) == next_page);
-
- if (page_rec_is_supremum(rec)) {
-
+ for (; ; rec = page_rec_get_next_const(rec)) {
+ if (!rec || page_rec_is_supremum(rec)) {
/* We give up */
-
return(srv_page_size);
}
+ ut_ad(page_align(rec) == next_page);
+
if (page_no != ibuf_rec_get_page_no(mtr, rec)
|| space != ibuf_rec_get_space(mtr, rec)) {
@@ -3698,7 +3699,6 @@ ibuf_insert_to_index_page(
mtr_t* mtr) /*!< in: mtr */
{
page_cur_t page_cur;
- ulint low_match;
page_t* page = buf_block_get_frame(block);
rec_t* rec;
rec_offs* offsets;
@@ -3727,7 +3727,7 @@ ibuf_insert_to_index_page(
rec = page_rec_get_next(page_get_infimum_rec(page));
- if (page_rec_is_supremum(rec)) {
+ if (!rec || page_rec_is_supremum(rec)) {
return DB_CORRUPTION;
}
@@ -3735,8 +3735,15 @@ ibuf_insert_to_index_page(
return DB_CORRUPTION;
}
+ ulint up_match = 0, low_match = 0;
+
+ if (page_cur_search_with_match(block, index, entry, PAGE_CUR_LE,
+ &up_match, &low_match, &page_cur,
+ nullptr)) {
+ return DB_CORRUPTION;
+ }
+
dberr_t err = DB_SUCCESS;
- low_match = page_cur_search(block, index, entry, &page_cur);
heap = mem_heap_create(
sizeof(upd_t)
@@ -3825,7 +3832,7 @@ ibuf_insert_to_index_page(
}
} else {
offsets = NULL;
- }
+ }
err = ibuf_insert_to_index_page_low(entry, block, index,
&offsets, heap, mtr, &page_cur);
@@ -3848,14 +3855,15 @@ ibuf_set_del_mark(
mtr_t* mtr) /*!< in: mtr */
{
page_cur_t page_cur;
- ulint low_match;
+ ulint up_match = 0, low_match = 0;
ut_ad(ibuf_inside(mtr));
ut_ad(dtuple_check_typed(entry));
- low_match = page_cur_search(block, index, entry, &page_cur);
-
- if (low_match == dtuple_get_n_fields(entry)) {
+ if (!page_cur_search_with_match(block, index, entry, PAGE_CUR_LE,
+ &up_match, &low_match, &page_cur,
+ nullptr)
+ && low_match == dtuple_get_n_fields(entry)) {
rec_t* rec = page_cur_get_rec(&page_cur);
/* Delete mark the old index record. According to a
@@ -3904,16 +3912,17 @@ ibuf_delete(
before latching any further pages */
{
page_cur_t page_cur;
- ulint low_match;
+ ulint up_match = 0, low_match = 0;
ut_ad(ibuf_inside(mtr));
ut_ad(dtuple_check_typed(entry));
ut_ad(!index->is_spatial());
ut_ad(!index->is_clust());
- low_match = page_cur_search(block, index, entry, &page_cur);
-
- if (low_match == dtuple_get_n_fields(entry)) {
+ if (!page_cur_search_with_match(block, index, entry, PAGE_CUR_LE,
+ &up_match, &low_match, &page_cur,
+ nullptr)
+ && low_match == dtuple_get_n_fields(entry)) {
page_zip_des_t* page_zip= buf_block_get_page_zip(block);
page_t* page = buf_block_get_frame(block);
rec_t* rec = page_cur_get_rec(&page_cur);
@@ -3977,8 +3986,6 @@ ibuf_delete(
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
- } else {
- /* The record must have been purged already. */
}
}
@@ -4017,9 +4024,6 @@ ibuf_restore_pos(
rec_print_old(stderr, btr_pcur_get_rec(pcur));
rec_print_old(stderr, pcur->old_rec);
dtuple_print(stderr, search_tuple);
-
- rec_print_old(stderr,
- page_rec_get_next(btr_pcur_get_rec(pcur)));
}
ibuf_btr_pcur_commit_specify_mtr(pcur, mtr);
@@ -4645,7 +4649,7 @@ dberr_t ibuf_check_bitmap_on_import(const trx_t* trx, fil_space_t* space)
buf_block_t* block = buf_page_get(
page_id_t(space->id, curr_page),
zip_size, RW_S_LATCH, &mtr);
- page_t* page = buf_block_get_frame(block);
+ page_t* page = buf_block_get_frame(block);
ut_ad(buf_is_zeroes(span<const byte>(
page,
physical_size)));
diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h
index 922f4bbc429..bbf7ab40d7e 100644
--- a/storage/innobase/include/btr0cur.h
+++ b/storage/innobase/include/btr0cur.h
@@ -222,7 +222,7 @@ It is assumed that mtr holds an x-latch on the page. The operation does
not succeed if there is too little space on the page. If there is just
one record on the page, the insert will always succeed; this is to
prevent trying to split a page with just one record.
-@return DB_SUCCESS, DB_WAIT_LOCK, DB_FAIL, or error number */
+@return DB_SUCCESS, DB_LOCK_WAIT, DB_FAIL, or error number */
dberr_t
btr_cur_optimistic_insert(
/*======================*/
diff --git a/storage/innobase/include/btr0pcur.h b/storage/innobase/include/btr0pcur.h
index f2a1f4220da..2d8f6d1024f 100644
--- a/storage/innobase/include/btr0pcur.h
+++ b/storage/innobase/include/btr0pcur.h
@@ -324,10 +324,11 @@ static inline bool btr_pcur_is_before_first_in_tree(btr_pcur_t* cursor);
Checks if the persistent cursor is after the last user record in
the index tree. */
static inline bool btr_pcur_is_after_last_in_tree(btr_pcur_t* cursor);
+MY_ATTRIBUTE((nonnull, warn_unused_result))
/*********************************************************//**
Moves the persistent cursor to the next record on the same page. */
UNIV_INLINE
-void
+rec_t*
btr_pcur_move_to_next_on_page(
/*==========================*/
btr_pcur_t* cursor);/*!< in/out: persistent cursor */
@@ -513,8 +514,7 @@ btr_pcur_open_on_user_rec(
return DB_SUCCESS;
if (dberr_t err= btr_pcur_move_to_next_page(cursor, mtr))
return err;
- btr_pcur_move_to_next_on_page(cursor);
- return DB_SUCCESS;
+ return btr_pcur_move_to_next_on_page(cursor) ? DB_SUCCESS : DB_CORRUPTION;
}
#include "btr0pcur.inl"
diff --git a/storage/innobase/include/btr0pcur.inl b/storage/innobase/include/btr0pcur.inl
index b21de209760..2b573068c01 100644
--- a/storage/innobase/include/btr0pcur.inl
+++ b/storage/innobase/include/btr0pcur.inl
@@ -155,7 +155,7 @@ static inline bool btr_pcur_is_after_last_in_tree(btr_pcur_t* cursor)
/*********************************************************//**
Moves the persistent cursor to the next record on the same page. */
UNIV_INLINE
-void
+rec_t*
btr_pcur_move_to_next_on_page(
/*==========================*/
btr_pcur_t* cursor) /*!< in/out: persistent cursor */
@@ -163,9 +163,8 @@ btr_pcur_move_to_next_on_page(
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
- page_cur_move_to_next(btr_pcur_get_page_cur(cursor));
-
cursor->old_stored = false;
+ return page_cur_move_to_next(btr_pcur_get_page_cur(cursor));
}
/*********************************************************//**
@@ -204,8 +203,8 @@ loop:
|| btr_pcur_move_to_next_page(cursor, mtr) != DB_SUCCESS) {
return(FALSE);
}
- } else {
- btr_pcur_move_to_next_on_page(cursor);
+ } else if (UNIV_UNLIKELY(!btr_pcur_move_to_next_on_page(cursor))) {
+ return false;
}
if (btr_pcur_is_on_user_rec(cursor)) {
@@ -228,20 +227,16 @@ btr_pcur_move_to_next(
function may release the page latch */
mtr_t* mtr) /*!< in: mtr */
{
- ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
- ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
+ ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
+ ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
- cursor->old_stored = false;
+ cursor->old_stored= false;
- if (btr_pcur_is_after_last_on_page(cursor)) {
- if (btr_pcur_is_after_last_in_tree(cursor)
- || btr_pcur_move_to_next_page(cursor, mtr) != DB_SUCCESS) {
- return(FALSE);
- }
- } else {
- btr_pcur_move_to_next_on_page(cursor);
- }
- return(TRUE);
+ if (btr_pcur_is_after_last_on_page(cursor))
+ return !btr_pcur_is_after_last_in_tree(cursor) &&
+ btr_pcur_move_to_next_page(cursor, mtr) == DB_SUCCESS;
+ else
+ return !!btr_pcur_move_to_next_on_page(cursor);
}
/**************************************************************//**
diff --git a/storage/innobase/include/gis0rtree.inl b/storage/innobase/include/gis0rtree.inl
index 2564df7e0d6..5101eeb6f7a 100644
--- a/storage/innobase/include/gis0rtree.inl
+++ b/storage/innobase/include/gis0rtree.inl
@@ -57,6 +57,9 @@ rtr_page_cal_mbr(
page = buf_block_get_frame(block);
rec = page_rec_get_next(page_get_infimum_rec(page));
+ if (UNIV_UNLIKELY(!rec)) {
+ return;
+ }
offsets = rec_get_offsets(rec, index, offsets, page_is_leaf(page)
? index->n_fields : 0,
ULINT_UNDEFINED, &heap);
diff --git a/storage/innobase/include/page0cur.h b/storage/innobase/include/page0cur.h
index 11677513dd8..80542299482 100644
--- a/storage/innobase/include/page0cur.h
+++ b/storage/innobase/include/page0cur.h
@@ -110,21 +110,6 @@ page_cur_position(
const buf_block_t* block, /*!< in: buffer block containing
the record */
page_cur_t* cur); /*!< out: page cursor */
-/**********************************************************//**
-Moves the cursor to the next record on page. */
-UNIV_INLINE
-void
-page_cur_move_to_next(
-/*==================*/
- page_cur_t* cur); /*!< in/out: cursor; must not be after last */
-MY_ATTRIBUTE((nonnull, warn_unused_result))
-/**********************************************************//**
-Moves the cursor to the previous record on page. */
-UNIV_INLINE
-rec_t*
-page_cur_move_to_prev(
-/*==================*/
- page_cur_t* cur); /*!< in/out: cursor; not before first */
/***********************************************************//**
Inserts a record next to page cursor. Returns pointer to inserted record if
@@ -166,20 +151,20 @@ page_cur_insert_rec_low(
/***********************************************************//**
Inserts a record next to page cursor on a compressed and uncompressed
-page. Returns pointer to inserted record if succeed, i.e.,
-enough space available, NULL otherwise.
-The cursor stays at the same position.
+page.
IMPORTANT: The caller will have to update IBUF_BITMAP_FREE
if this is a compressed leaf page in a secondary index.
This has to be done either within the same mini-transaction,
or by invoking ibuf_reset_free_bits() before mtr_commit().
-@return pointer to record if succeed, NULL otherwise */
+@return pointer to inserted record
+@return nullptr on failure */
rec_t*
page_cur_insert_rec_zip(
/*====================*/
- page_cur_t* cursor, /*!< in/out: page cursor */
+ page_cur_t* cursor, /*!< in/out: page cursor,
+ logical position unchanged */
dict_index_t* index, /*!< in: record descriptor */
const rec_t* rec, /*!< in: pointer to a physical record */
rec_offs* offsets,/*!< in/out: rec_get_offsets(rec, index) */
@@ -248,39 +233,10 @@ page_cur_delete_rec() for a ROW_FORMAT=COMPACT or DYNAMIC page.
bool page_apply_delete_dynamic(const buf_block_t &block, ulint prev,
size_t hdr_size, size_t data_size);
-/** Search the right position for a page cursor.
-@param[in] block buffer block
-@param[in] index index tree
-@param[in] tuple data tuple
-@param[in] mode PAGE_CUR_L, PAGE_CUR_LE, PAGE_CUR_G, or PAGE_CUR_GE
-@param[out] cursor page cursor
-@return number of matched fields on the left */
-UNIV_INLINE
-ulint
-page_cur_search(
- const buf_block_t* block,
- const dict_index_t* index,
- const dtuple_t* tuple,
- page_cur_mode_t mode,
- page_cur_t* cursor);
-
-/** Search the right position for a page cursor.
-@param[in] block buffer block
-@param[in] index index tree
-@param[in] tuple data tuple
-@param[out] cursor page cursor
-@return number of matched fields on the left */
-UNIV_INLINE
-ulint
-page_cur_search(
- const buf_block_t* block,
- const dict_index_t* index,
- const dtuple_t* tuple,
- page_cur_t* cursor);
-
+MY_ATTRIBUTE((warn_unused_result))
/****************************************************************//**
Searches the right position for a page cursor. */
-void
+bool
page_cur_search_with_match(
/*=======================*/
const buf_block_t* block, /*!< in: buffer block */
@@ -298,6 +254,7 @@ page_cur_search_with_match(
page_cur_t* cursor, /*!< out: page cursor */
rtr_info_t* rtr_info);/*!< in/out: rtree search stack */
#ifdef BTR_CUR_HASH_ADAPT
+MY_ATTRIBUTE((warn_unused_result))
/** Search the right position for a page cursor.
@param[in] block buffer block
@param[in] index index tree
@@ -312,7 +269,7 @@ lower limit record
@param[in,out] ilow_matched_bytes already matched bytes in the
first partially matched field in the lower limit record
@param[out] cursor page cursor */
-void
+bool
page_cur_search_with_match_bytes(
const buf_block_t* block,
const dict_index_t* index,
@@ -342,6 +299,19 @@ struct page_cur_t{
buf_block_t* block; /*!< pointer to the block containing rec */
};
+
+MY_ATTRIBUTE((nonnull, warn_unused_result))
+inline rec_t *page_cur_move_to_next(page_cur_t *cur)
+{
+ return cur->rec= page_rec_get_next(cur->rec);
+}
+
+MY_ATTRIBUTE((nonnull, warn_unused_result))
+inline rec_t *page_cur_move_to_prev(page_cur_t *cur)
+{
+ return cur->rec= page_rec_get_prev(cur->rec);
+}
+
#include "page0cur.inl"
#endif
diff --git a/storage/innobase/include/page0cur.inl b/storage/innobase/include/page0cur.inl
index da0582c691f..d6bf2fdfe09 100644
--- a/storage/innobase/include/page0cur.inl
+++ b/storage/innobase/include/page0cur.inl
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2021, MariaDB Corporation.
+Copyright (c) 2015, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -149,75 +149,6 @@ page_cur_position(
cur->block = (buf_block_t*) block;
}
-/**********************************************************//**
-Moves the cursor to the next record on page. */
-UNIV_INLINE
-void
-page_cur_move_to_next(
-/*==================*/
- page_cur_t* cur) /*!< in/out: cursor; must not be after last */
-{
- ut_ad(!page_cur_is_after_last(cur));
-
- cur->rec = page_rec_get_next(cur->rec);
-}
-
-/**********************************************************//**
-Moves the cursor to the previous record on page. */
-UNIV_INLINE
-rec_t*
-page_cur_move_to_prev(
-/*==================*/
- page_cur_t* cur) /*!< in/out: page cursor, not before first */
-{
- ut_ad(!page_cur_is_before_first(cur));
-
- return cur->rec = page_rec_get_prev(cur->rec);
-}
-
-/** Search the right position for a page cursor.
-@param[in] block buffer block
-@param[in] index index tree
-@param[in] tuple data tuple
-@param[in] mode PAGE_CUR_L, PAGE_CUR_LE, PAGE_CUR_G, or PAGE_CUR_GE
-@param[out] cursor page cursor
-@return number of matched fields on the left */
-UNIV_INLINE
-ulint
-page_cur_search(
- const buf_block_t* block,
- const dict_index_t* index,
- const dtuple_t* tuple,
- page_cur_mode_t mode,
- page_cur_t* cursor)
-{
- ulint low_match = 0;
- ulint up_match = 0;
-
- ut_ad(dtuple_check_typed(tuple));
-
- page_cur_search_with_match(block, index, tuple, mode,
- &up_match, &low_match, cursor, NULL);
- return(low_match);
-}
-
-/** Search the right position for a page cursor.
-@param[in] block buffer block
-@param[in] index index tree
-@param[in] tuple data tuple
-@param[out] cursor page cursor
-@return number of matched fields on the left */
-UNIV_INLINE
-ulint
-page_cur_search(
- const buf_block_t* block,
- const dict_index_t* index,
- const dtuple_t* tuple,
- page_cur_t* cursor)
-{
- return(page_cur_search(block, index, tuple, PAGE_CUR_LE, cursor));
-}
-
/***********************************************************//**
Inserts a record next to page cursor. Returns pointer to inserted record if
succeed, i.e., enough space available, NULL otherwise. The cursor stays at
diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h
index ae06d06ad5e..80c1193d8a0 100644
--- a/storage/innobase/include/page0page.h
+++ b/storage/innobase/include/page0page.h
@@ -534,7 +534,8 @@ inline void page_header_reset_last_insert(buf_block_t *block, mtr_t *mtr)
/************************************************************//**
Returns the nth record of the record list.
This is the inverse function of page_rec_get_n_recs_before().
-@return nth record */
+@return nth record
+@retval nullptr on corrupted page */
const rec_t*
page_rec_get_nth_const(
/*===================*/
@@ -544,14 +545,12 @@ page_rec_get_nth_const(
/************************************************************//**
Returns the nth record of the record list.
This is the inverse function of page_rec_get_n_recs_before().
-@return nth record */
-UNIV_INLINE
-rec_t*
-page_rec_get_nth(
-/*=============*/
- page_t* page, /*< in: page */
- ulint nth) /*!< in: nth record */
- MY_ATTRIBUTE((nonnull, warn_unused_result));
+@return nth record
+@retval nullptr on corrupted page */
+inline rec_t *page_rec_get_nth(page_t* page, ulint nth)
+{
+ return const_cast<rec_t*>(page_rec_get_nth_const(page, nth));
+}
/************************************************************//**
Returns the middle record of the records on the page. If there is an
@@ -592,15 +591,11 @@ page_get_n_recs(
/*============*/
const page_t* page); /*!< in: index page */
-/***************************************************************//**
-Returns the number of records before the given record in chain.
-The number includes infimum and supremum records.
-This is the inverse function of page_rec_get_nth().
-@return number of records */
-ulint
-page_rec_get_n_recs_before(
-/*=======================*/
- const rec_t* rec); /*!< in: the physical record */
+/** Return the number of preceding records in an index page.
+@param rec index record
+@return number of preceding records, including the infimum pseudo-record
+@retval ULINT_UNDEFINED on corrupted page */
+ulint page_rec_get_n_recs_before(const rec_t *rec);
/*************************************************************//**
Gets the number of records in the heap.
@return number of user records */
@@ -649,6 +644,23 @@ inline const rec_t *page_dir_slot_get_rec(const page_dir_slot_t *slot)
{
return page_dir_slot_get_rec(const_cast<rec_t*>(slot));
}
+
+inline rec_t *page_dir_slot_get_rec_validate(page_dir_slot_t *slot)
+{
+ const size_t s= mach_read_from_2(my_assume_aligned<2>(slot));
+ page_t *page= page_align(slot);
+
+ return UNIV_LIKELY(s >= PAGE_NEW_INFIMUM &&
+ s <= page_header_get_field(page, PAGE_HEAP_TOP))
+ ? page + s
+ : nullptr;
+}
+inline const rec_t *page_dir_slot_get_rec_validate(const page_dir_slot_t *slot)
+{
+ return page_dir_slot_get_rec_validate(const_cast<rec_t*>(slot));
+}
+
+
/***************************************************************//**
Gets the number of records owned by a directory slot.
@return number of records */
@@ -753,20 +765,9 @@ page_rec_get_next_const(
/*====================*/
const rec_t* rec); /*!< in: pointer to record */
/************************************************************//**
-Gets the pointer to the next non delete-marked record on the page.
-If all subsequent records are delete-marked, then this function
-will return the supremum record.
-@return pointer to next non delete-marked record or pointer to supremum */
-UNIV_INLINE
-const rec_t*
-page_rec_get_next_non_del_marked(
-/*=============================*/
- const rec_t* rec); /*!< in: pointer to record */
-/************************************************************//**
Gets the pointer to the previous record.
@return pointer to previous record
@retval nullptr on error */
-UNIV_INLINE
const rec_t*
page_rec_get_prev_const(
/*====================*/
@@ -816,22 +817,6 @@ page_rec_is_last(
MY_ATTRIBUTE((warn_unused_result));
/************************************************************//**
-true if distance between the records (measured in number of times we have to
-move to the next record) is at most the specified value
-@param[in] left_rec lefter record
-@param[in] right_rec righter record
-@param[in] val specified value to compare
-@return true if the distance is smaller than the value */
-UNIV_INLINE
-bool
-page_rec_distance_is_at_most(
-/*=========================*/
- const rec_t* left_rec,
- const rec_t* right_rec,
- ulint val)
- MY_ATTRIBUTE((warn_unused_result));
-
-/************************************************************//**
true if the record is the second last user record on a page.
@return true if the second last user record */
UNIV_INLINE
@@ -1129,9 +1114,7 @@ page_find_rec_with_heap_no(
@param[in] page index tree leaf page
@return the last record, not delete-marked
@retval infimum record if all records are delete-marked */
-const rec_t*
-page_find_rec_last_not_deleted(
- const page_t* page);
+const rec_t *page_find_rec_last_not_deleted(const page_t *page);
#endif /* !UNIV_INNOCHECKSUM */
diff --git a/storage/innobase/include/page0page.inl b/storage/innobase/include/page0page.inl
index 76bc62e5eb2..61c1b96ff79 100644
--- a/storage/innobase/include/page0page.inl
+++ b/storage/innobase/include/page0page.inl
@@ -202,10 +202,10 @@ page_rec_is_second(
const rec_t* rec, /*!< in: record */
const page_t* page) /*!< in: page */
{
- ut_ad(page_get_n_recs(page) > 1);
-
- return(page_rec_get_next_const(
- page_rec_get_next_const(page_get_infimum_rec(page))) == rec);
+ ut_ad(page_get_n_recs(page) > 1);
+ if (const rec_t *first= page_rec_get_next_const(page_get_infimum_rec(page)))
+ return page_rec_get_next_const(first) == rec;
+ return false;
}
/************************************************************//**
@@ -224,26 +224,6 @@ page_rec_is_last(
}
/************************************************************//**
-true if distance between the records (measured in number of times we have to
-move to the next record) is at most the specified value */
-UNIV_INLINE
-bool
-page_rec_distance_is_at_most(
-/*=========================*/
- const rec_t* left_rec,
- const rec_t* right_rec,
- ulint val)
-{
- for (ulint i = 0; i <= val; i++) {
- if (left_rec == right_rec) {
- return (true);
- }
- left_rec = page_rec_get_next_const(left_rec);
- }
- return (false);
-}
-
-/************************************************************//**
true if the record is the second last user record on a page.
@return true if the second last user record */
UNIV_INLINE
@@ -253,25 +233,12 @@ page_rec_is_second_last(
const rec_t* rec, /*!< in: record */
const page_t* page) /*!< in: page */
{
- ut_ad(page_get_n_recs(page) > 1);
- ut_ad(!page_rec_is_last(rec, page));
-
- return(page_rec_get_next_const(
- page_rec_get_next_const(rec)) == page_get_supremum_rec(page));
-}
+ ut_ad(page_get_n_recs(page) > 1);
+ ut_ad(!page_rec_is_last(rec, page));
-/************************************************************//**
-Returns the nth record of the record list.
-This is the inverse function of page_rec_get_n_recs_before().
-@return nth record */
-UNIV_INLINE
-rec_t*
-page_rec_get_nth(
-/*=============*/
- page_t* page, /*!< in: page */
- ulint nth) /*!< in: nth record */
-{
- return((rec_t*) page_rec_get_nth_const(page, nth));
+ if (const rec_t *next= page_rec_get_next_const(rec))
+ return page_rec_is_supremum(page_rec_get_next_const(next));
+ return false;
}
/************************************************************//**
@@ -421,36 +388,19 @@ page_rec_get_next_low(
const rec_t* rec, /*!< in: pointer to record */
ulint comp) /*!< in: nonzero=compact page layout */
{
- ulint offs;
- const page_t* page;
-
- ut_ad(page_rec_check(rec));
-
- page = page_align(rec);
-
- offs = rec_get_next_offs(rec, comp);
-
- if (offs >= srv_page_size) {
- fprintf(stderr,
- "InnoDB: Next record offset is nonsensical %lu"
- " in record at offset %lu\n"
- "InnoDB: rec address %p, space id %lu, page %lu\n",
- (ulong) offs, (ulong) page_offset(rec),
- (void*) rec,
- (ulong) page_get_space_id(page),
- (ulong) page_get_page_no(page));
- ut_error;
- } else if (offs == 0) {
-
- return(NULL);
- }
-
- ut_ad(page_rec_is_infimum(rec)
- || (!page_is_leaf(page) && !page_has_prev(page))
- || !(rec_get_info_bits(page + offs, comp)
- & REC_INFO_MIN_REC_FLAG));
-
- return(page + offs);
+ const page_t *page= page_align(rec);
+ ut_ad(page_rec_check(rec));
+ ulint offs= rec_get_next_offs(rec, comp);
+ if (!offs)
+ return nullptr;
+ if (UNIV_UNLIKELY(offs < (comp ? PAGE_NEW_SUPREMUM : PAGE_OLD_SUPREMUM)))
+ return nullptr;
+ if (UNIV_UNLIKELY(offs > page_header_get_field(page, PAGE_HEAP_TOP)))
+ return nullptr;
+ ut_ad(page_rec_is_infimum(rec) ||
+ (!page_is_leaf(page) && !page_has_prev(page)) ||
+ !(rec_get_info_bits(page + offs, comp) & REC_INFO_MIN_REC_FLAG));
+ return page + offs;
}
/************************************************************//**
@@ -476,78 +426,6 @@ page_rec_get_next_const(
{
return(page_rec_get_next_low(rec, page_rec_is_comp(rec)));
}
-
-/************************************************************//**
-Gets the pointer to the next non delete-marked record on the page.
-If all subsequent records are delete-marked, then this function
-will return the supremum record.
-@return pointer to next non delete-marked record or pointer to supremum */
-UNIV_INLINE
-const rec_t*
-page_rec_get_next_non_del_marked(
-/*=============================*/
- const rec_t* rec) /*!< in: pointer to record */
-{
- const rec_t* r;
- ulint page_is_compact = page_rec_is_comp(rec);
-
- for (r = page_rec_get_next_const(rec);
- !page_rec_is_supremum(r)
- && rec_get_deleted_flag(r, page_is_compact);
- r = page_rec_get_next_const(r)) {
- /* noop */
- }
-
- return(r);
-}
-
-/************************************************************//**
-Gets the pointer to the previous record.
-@return pointer to previous record
-@retval nullptr on error */
-UNIV_INLINE
-const rec_t*
-page_rec_get_prev_const(
-/*====================*/
- const rec_t* rec) /*!< in: pointer to record, must not be page
- infimum */
-{
- const page_dir_slot_t* slot;
- ulint slot_no;
- const rec_t* rec2;
- const rec_t* prev_rec = NULL;
- const page_t* page;
-
- ut_ad(page_rec_check(rec));
-
- page = page_align(rec);
-
- ut_ad(!page_rec_is_infimum(rec));
-
- slot_no = page_dir_find_owner_slot(rec);
-
- if (UNIV_UNLIKELY(!slot_no || slot_no == ULINT_UNDEFINED)) {
- return nullptr;
- }
-
- slot = page_dir_get_nth_slot(page, slot_no - 1);
-
- rec2 = page_dir_slot_get_rec(slot);
-
- if (page_is_comp(page)) {
- while (rec2 && rec != rec2) {
- prev_rec = rec2;
- rec2 = page_rec_get_next_low(rec2, TRUE);
- }
- } else {
- while (rec2 && rec != rec2) {
- prev_rec = rec2;
- rec2 = page_rec_get_next_low(rec2, FALSE);
- }
- }
-
- return(prev_rec);
-}
#endif /* UNIV_INNOCHECKSUM */
/************************************************************//**
diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h
index 7faf0ca06bd..dcf26e57e7e 100644
--- a/storage/innobase/include/rem0rec.h
+++ b/storage/innobase/include/rem0rec.h
@@ -141,28 +141,7 @@ constexpr rec_offs REC_OFFS_EXTERNAL= REC_OFFS_COMPACT >> 1;
/** Default value flag in offsets returned by rec_get_offsets() */
constexpr rec_offs REC_OFFS_DEFAULT= REC_OFFS_COMPACT >> 2;
constexpr rec_offs REC_OFFS_MASK= REC_OFFS_DEFAULT - 1;
-/******************************************************//**
-The following function is used to get the pointer of the next chained record
-on the same page.
-@return pointer to the next chained record, or NULL if none */
-UNIV_INLINE
-const rec_t*
-rec_get_next_ptr_const(
-/*===================*/
- const rec_t* rec, /*!< in: physical record */
- ulint comp) /*!< in: nonzero=compact page format */
- MY_ATTRIBUTE((warn_unused_result));
-/******************************************************//**
-The following function is used to get the pointer of the next chained record
-on the same page.
-@return pointer to the next chained record, or NULL if none */
-UNIV_INLINE
-rec_t*
-rec_get_next_ptr(
-/*=============*/
- rec_t* rec, /*!< in: physical record */
- ulint comp) /*!< in: nonzero=compact page format */
- MY_ATTRIBUTE((warn_unused_result));
+
/******************************************************//**
The following function is used to get the offset of the
next chained record on the same page.
diff --git a/storage/innobase/include/rem0rec.inl b/storage/innobase/include/rem0rec.inl
index 30c72a7415a..46c209cbdec 100644
--- a/storage/innobase/include/rem0rec.inl
+++ b/storage/innobase/include/rem0rec.inl
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2020, MariaDB Corporation.
+Copyright (c) 2017, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -204,76 +204,6 @@ rec_set_bit_field_2(
}
/******************************************************//**
-The following function is used to get the pointer of the next chained record
-on the same page.
-@return pointer to the next chained record, or NULL if none */
-UNIV_INLINE
-const rec_t*
-rec_get_next_ptr_const(
-/*===================*/
- const rec_t* rec, /*!< in: physical record */
- ulint comp) /*!< in: nonzero=compact page format */
-{
- ulint field_value;
-
- compile_time_assert(REC_NEXT_MASK == 0xFFFFUL);
- compile_time_assert(REC_NEXT_SHIFT == 0);
-
- field_value = mach_read_from_2(rec - REC_NEXT);
-
- if (field_value == 0) {
-
- return(NULL);
- }
-
- if (comp) {
-#if UNIV_PAGE_SIZE_MAX <= 32768
- /* Note that for 64 KiB pages, field_value can 'wrap around'
- and the debug assertion is not valid */
-
- /* In the following assertion, field_value is interpreted
- as signed 16-bit integer in 2's complement arithmetics.
- If all platforms defined int16_t in the standard headers,
- the expression could be written simpler as
- (int16_t) field_value + ut_align_offset(...) < srv_page_size
- */
- ut_ad((field_value >= 32768
- ? field_value - 65536
- : field_value)
- + ut_align_offset(rec, srv_page_size)
- < srv_page_size);
-#endif
- /* There must be at least REC_N_NEW_EXTRA_BYTES + 1
- between each record. */
- ut_ad((field_value > REC_N_NEW_EXTRA_BYTES
- && field_value < 32768)
- || field_value < (uint16) -REC_N_NEW_EXTRA_BYTES);
-
- return((byte*) ut_align_down(rec, srv_page_size)
- + ut_align_offset(rec + field_value, srv_page_size));
- } else {
- ut_ad(field_value < srv_page_size);
-
- return((byte*) ut_align_down(rec, srv_page_size)
- + field_value);
- }
-}
-
-/******************************************************//**
-The following function is used to get the pointer of the next chained record
-on the same page.
-@return pointer to the next chained record, or NULL if none */
-UNIV_INLINE
-rec_t*
-rec_get_next_ptr(
-/*=============*/
- rec_t* rec, /*!< in: physical record */
- ulint comp) /*!< in: nonzero=compact page format */
-{
- return(const_cast<rec_t*>(rec_get_next_ptr_const(rec, comp)));
-}
-
-/******************************************************//**
The following function is used to get the offset of the next chained record
on the same page.
@return the page offset of the next chained record, or 0 if none */
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index d5905e7b523..76ad538ea0e 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -2378,10 +2378,12 @@ lock_move_reorganize_page(
lock_trx->mutex_unlock();
- if (new_heap_no == PAGE_HEAP_NO_SUPREMUM)
+ if (!rec1 || !rec2)
{
- ut_ad(old_heap_no == PAGE_HEAP_NO_SUPREMUM);
- break;
+ ut_ad(!rec1 == !rec2);
+ ut_ad(new_heap_no == PAGE_HEAP_NO_SUPREMUM);
+ ut_ad(old_heap_no == PAGE_HEAP_NO_SUPREMUM);
+ break;
}
}
@@ -2450,6 +2452,12 @@ lock_move_rec_list_end(
FALSE);
}
+ if (UNIV_UNLIKELY(!rec1 || !rec2))
+ {
+ ut_ad("corrupted page" == 0);
+ return;
+ }
+
/* Copy lock requests on user records to new page and
reset the lock bits on the old */
for (;;)
@@ -2463,28 +2471,37 @@ lock_move_rec_list_end(
if (comp)
{
rec1_heap_no= rec_get_heap_no_new(rec1);
- if (rec1_heap_no == PAGE_HEAP_NO_SUPREMUM)
+ if (!(rec1= page_rec_get_next_low(rec1, TRUE)))
+ {
+ ut_ad(rec1_heap_no == PAGE_HEAP_NO_SUPREMUM);
break;
-
+ }
rec2_heap_no= rec_get_heap_no_new(rec2);
- rec1= page_rec_get_next_low(rec1, TRUE);
rec2= page_rec_get_next_low(rec2, TRUE);
}
else
{
+ ut_d(const rec_t *old1= rec1);
rec1_heap_no= rec_get_heap_no_old(rec1);
-
- if (rec1_heap_no == PAGE_HEAP_NO_SUPREMUM)
+ if (!(rec1= page_rec_get_next_low(rec1, FALSE)))
+ {
+ ut_ad(rec1_heap_no == PAGE_HEAP_NO_SUPREMUM);
break;
- rec2_heap_no= rec_get_heap_no_old(rec2);
+ }
- ut_ad(rec_get_data_size_old(rec1) == rec_get_data_size_old(rec2));
- ut_ad(!memcmp(rec1, rec2, rec_get_data_size_old(rec1)));
+ ut_ad(rec_get_data_size_old(old1) == rec_get_data_size_old(rec2));
+ ut_ad(!memcmp(old1, rec2, rec_get_data_size_old(old1)));
- rec1= page_rec_get_next_low(rec1, FALSE);
+ rec2_heap_no= rec_get_heap_no_old(rec2);
rec2= page_rec_get_next_low(rec2, FALSE);
}
+ if (UNIV_UNLIKELY(!rec2))
+ {
+ ut_ad("corrupted page" == 0);
+ return;
+ }
+
trx_t *lock_trx= lock->trx;
lock_trx->mutex_lock();
@@ -2577,6 +2594,12 @@ lock_move_rec_list_start(
while (rec1 != rec)
{
+ if (UNIV_UNLIKELY(!rec1 || !rec2))
+ {
+ ut_ad("corrupted page" == 0);
+ return;
+ }
+
ut_ad(page_rec_is_metadata(rec1) == page_rec_is_metadata(rec2));
ut_d(const rec_t* const prev= rec1);
@@ -2880,11 +2903,15 @@ void lock_update_merge_left(const buf_block_t& left, const rec_t *orig_pred,
ut_ad(left.page.frame == page_align(orig_pred));
const page_id_t l{left.page.id()};
+ const rec_t *left_next_rec= page_rec_get_next_const(orig_pred);
+ if (UNIV_UNLIKELY(!left_next_rec))
+ {
+ ut_ad("corrupted page" == 0);
+ return;
+ }
/* This would likely be too large for a memory transaction. */
LockMultiGuard g{lock_sys.rec_hash, l, right};
- const rec_t *left_next_rec= page_rec_get_next_const(orig_pred);
-
if (!page_rec_is_supremum(left_next_rec))
{
/* Inherit the locks on the supremum of the left page to the
@@ -3031,12 +3058,18 @@ lock_update_insert(
if (page_rec_is_comp(rec)) {
receiver_heap_no = rec_get_heap_no_new(rec);
- donator_heap_no = rec_get_heap_no_new(
- page_rec_get_next_low(rec, TRUE));
+ rec = page_rec_get_next_low(rec, TRUE);
+ if (UNIV_UNLIKELY(!rec)) {
+ return;
+ }
+ donator_heap_no = rec_get_heap_no_new(rec);
} else {
receiver_heap_no = rec_get_heap_no_old(rec);
- donator_heap_no = rec_get_heap_no_old(
- page_rec_get_next_low(rec, FALSE));
+ rec = page_rec_get_next_low(rec, FALSE);
+ if (UNIV_UNLIKELY(!rec)) {
+ return;
+ }
+ donator_heap_no = rec_get_heap_no_old(rec);
}
lock_rec_inherit_to_gap_if_gap_lock(
@@ -4952,13 +4985,15 @@ lock_rec_insert_check_and_lock(
ut_ad(page_is_leaf(block->page.frame));
ut_ad(!index->table->is_temporary());
+ const rec_t *next_rec= page_rec_get_next_const(rec);
+ if (UNIV_UNLIKELY(!next_rec || rec_is_metadata(next_rec, *index)))
+ return DB_CORRUPTION;
+
dberr_t err= DB_SUCCESS;
bool inherit_in= *inherit;
trx_t *trx= thr_get_trx(thr);
- const rec_t *next_rec= page_rec_get_next_const(rec);
ulint heap_no= page_rec_get_heap_no(next_rec);
const page_id_t id{block->page.id()};
- ut_ad(!rec_is_metadata(next_rec, *index));
{
LockGuard g{lock_sys.rec_hash, id};
@@ -6126,6 +6161,7 @@ namespace Deadlock
for (trx_t *next= cycle;;)
{
next= next->lock.wait_trx;
+ l++;
const undo_no_t next_weight= TRX_WEIGHT(next) |
(next->mysql_thd &&
#ifdef WITH_WSREP
@@ -6332,11 +6368,16 @@ void lock_update_split_and_merge(
const page_id_t l{left_block->page.id()};
const page_id_t r{right_block->page.id()};
+ const rec_t *left_next_rec= page_rec_get_next_const(orig_pred);
+ if (UNIV_UNLIKELY(!left_next_rec))
+ {
+ ut_ad("corrupted page" == 0);
+ return;
+ }
+ ut_ad(!page_rec_is_metadata(left_next_rec));
/* This would likely be too large for a memory transaction. */
LockMultiGuard g{lock_sys.rec_hash, l, r};
- const rec_t *left_next_rec= page_rec_get_next_const(orig_pred);
- ut_ad(!page_rec_is_metadata(left_next_rec));
/* Inherit the locks on the supremum of the left page to the
first record which was moved from the right page */
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 294bde41cc0..be1daaae6c2 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -727,7 +727,7 @@ static struct
@param id tablespace id
@return tablespace whose creation was deferred
@retval nullptr if no such tablespace was found */
- const item *find(uint32_t id)
+ item *find(uint32_t id)
{
mysql_mutex_assert_owner(&recv_sys.mutex);
auto it= defers.find(id);
@@ -1181,11 +1181,11 @@ inline size_t recv_sys_t::files_size()
@param[in] name file name
@param[in] len length of the file name
@param[in] space_id the tablespace ID
-@param[in] deleted whether this is a FILE_DELETE record
+@param[in] ftype FILE_MODIFY, FILE_DELETE, or FILE_RENAME
@param[in] lsn lsn of the redo log
@param[in] store whether the redo log has to be stored */
static void fil_name_process(const char *name, ulint len, uint32_t space_id,
- bool deleted, lsn_t lsn, store_t store)
+ mfile_type_t ftype, lsn_t lsn, store_t store)
{
if (srv_operation == SRV_OPERATION_BACKUP
|| srv_operation == SRV_OPERATION_BACKUP_NO_DEFER) {
@@ -1200,6 +1200,7 @@ static void fil_name_process(const char *name, ulint len, uint32_t space_id,
further checks can ensure that a FILE_MODIFY record was
scanned before applying any page records for the space_id. */
+ const bool deleted{ftype == FILE_DELETE};
const file_name_t fname(std::string(name, len), deleted);
std::pair<recv_spaces_t::iterator,bool> p = recv_spaces.emplace(
space_id, fname);
@@ -1212,6 +1213,9 @@ static void fil_name_process(const char *name, ulint len, uint32_t space_id,
d->deleted = true;
goto got_deleted;
}
+ if (ftype == FILE_RENAME) {
+ d->file_name= fname.name;
+ }
goto reload;
}
@@ -2806,11 +2810,9 @@ inline recv_sys_t::parse_mtr_result recv_sys_t::parse(store_t store, source &l)
continue;
fil_name_process(fn, fnend - fn, space_id,
- (b & 0xf0) == FILE_DELETE, start_lsn,
- store);
- if (fn2)
- fil_name_process(fn2, fn2end - fn2, space_id,
- false, start_lsn, store);
+ (b & 0xf0) == FILE_DELETE ? FILE_DELETE : FILE_MODIFY,
+ start_lsn, store);
+
if ((b & 0xf0) < FILE_CHECKPOINT && log_file_op)
log_file_op(space_id, b & 0xf0,
reinterpret_cast<const byte*>(fn),
@@ -2818,13 +2820,19 @@ inline recv_sys_t::parse_mtr_result recv_sys_t::parse(store_t store, source &l)
reinterpret_cast<const byte*>(fn2),
fn2 ? static_cast<ulint>(fn2end - fn2) : 0);
- if (fn2 && file_checkpoint)
+ if (fn2)
{
- const size_t len= fn2end - fn2;
- auto r= renamed_spaces.emplace(space_id, std::string{fn2, len});
- if (!r.second)
- r.first->second= std::string{fn2, len};
+ fil_name_process(fn2, fn2end - fn2, space_id,
+ FILE_RENAME, start_lsn, store);
+ if (file_checkpoint)
+ {
+ const size_t len= fn2end - fn2;
+ auto r= renamed_spaces.emplace(space_id, std::string{fn2, len});
+ if (!r.second)
+ r.first->second= std::string{fn2, len};
+ }
}
+
if (is_corrupt_fs())
return GOT_EOF;
}
diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc
index 97b8b981664..0d60ef4ecb8 100644
--- a/storage/innobase/mtr/mtr0mtr.cc
+++ b/storage/innobase/mtr/mtr0mtr.cc
@@ -1348,11 +1348,17 @@ std::pair<lsn_t,mtr_t::page_flush_ahead> mtr_t::do_write()
size_t len= m_log.size() + 5;
ut_ad(len > 5);
-#ifdef UNIV_DEBUG
+#ifndef DBUG_OFF
if (m_log_mode == MTR_LOG_ALL)
{
m_memo.for_each_block(CIterate<WriteOPT_PAGE_CHECKSUM>(*this));
- len= m_log.size() + 5;
+ do
+ {
+ DBUG_EXECUTE_IF("skip_page_checksum", continue;);
+ m_memo.for_each_block(CIterate<WriteOPT_PAGE_CHECKSUM>(*this));
+ len= m_log.size() + 5;
+ }
+ while (0);
}
#endif
diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc
index f295f7e764b..cc94d6cfa3e 100644
--- a/storage/innobase/page/page0cur.cc
+++ b/storage/innobase/page/page0cur.cc
@@ -89,7 +89,10 @@ page_cur_try_search_shortcut(
goto exit_func;
}
- next_rec = page_rec_get_next_const(rec);
+ if (!(next_rec = page_rec_get_next_const(rec))) {
+ goto exit_func;
+ }
+
if (!page_rec_is_supremum(next_rec)) {
offsets = rec_get_offsets(next_rec, index, offsets,
index->n_core_fields,
@@ -180,7 +183,10 @@ page_cur_try_search_shortcut_bytes(
goto exit_func;
}
- next_rec = page_rec_get_next_const(rec);
+ if (!(next_rec = page_rec_get_next_const(rec))) {
+ goto exit_func;
+ }
+
if (!page_rec_is_supremum(next_rec)) {
offsets = rec_get_offsets(next_rec, index, offsets,
index->n_core_fields,
@@ -268,7 +274,7 @@ page_cur_rec_field_extends(
/****************************************************************//**
Searches the right position for a page cursor. */
-void
+bool
page_cur_search_with_match(
/*=======================*/
const buf_block_t* block, /*!< in: buffer block */
@@ -290,7 +296,6 @@ page_cur_search_with_match(
ulint low;
ulint mid;
const page_t* page;
- const page_dir_slot_t* slot;
const rec_t* up_rec;
const rec_t* low_rec;
const rec_t* mid_rec;
@@ -336,7 +341,7 @@ page_cur_search_with_match(
&& page_cur_try_search_shortcut(
block, index, tuple,
iup_matched_fields, ilow_matched_fields, cursor)) {
- return;
+ return false;
}
# ifdef PAGE_CUR_DBG
if (mode == PAGE_CUR_DBG) {
@@ -353,10 +358,9 @@ page_cur_search_with_match(
if (mode == PAGE_CUR_RTREE_INSERT && n_core) {
mode = PAGE_CUR_LE;
} else {
- rtr_cur_search_with_match(
+ return rtr_cur_search_with_match(
block, (dict_index_t*)index, tuple, mode,
cursor, rtr_info);
- return;
}
}
@@ -387,9 +391,11 @@ page_cur_search_with_match(
while (up - low > 1) {
mid = (low + up) / 2;
- slot = page_dir_get_nth_slot(page, mid);
- mid_rec = page_dir_slot_get_rec(slot);
-
+ const page_dir_slot_t* slot = page_dir_get_nth_slot(page, mid);
+ if (UNIV_UNLIKELY(!(mid_rec
+ = page_dir_slot_get_rec_validate(slot)))) {
+ goto corrupted;
+ }
cur_matched_fields = std::min(low_matched_fields,
up_matched_fields);
@@ -432,18 +438,30 @@ up_slot_match:
}
}
- slot = page_dir_get_nth_slot(page, low);
- low_rec = page_dir_slot_get_rec(slot);
- slot = page_dir_get_nth_slot(page, up);
- up_rec = page_dir_slot_get_rec(slot);
+ low_rec = page_dir_slot_get_rec_validate(
+ page_dir_get_nth_slot(page, low));
+ up_rec = page_dir_slot_get_rec_validate(
+ page_dir_get_nth_slot(page, up));
+ if (UNIV_UNLIKELY(!low_rec || !up_rec)) {
+corrupted:
+ if (UNIV_LIKELY_NULL(heap)) {
+ mem_heap_free(heap);
+ }
+ return true;
+ }
/* Perform linear search until the upper and lower records come to
distance 1 of each other. */
- while (page_rec_get_next_const(low_rec) != up_rec) {
-
- mid_rec = page_rec_get_next_const(low_rec);
-
+ for (;;) {
+ if (const rec_t* next = page_rec_get_next_const(low_rec)) {
+ if (next == up_rec) {
+ break;
+ }
+ mid_rec = next;
+ } else {
+ goto corrupted;
+ }
cur_matched_fields = std::min(low_matched_fields,
up_matched_fields);
@@ -513,6 +531,8 @@ up_rec_match:
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
+
+ return false;
}
#ifdef BTR_CUR_HASH_ADAPT
@@ -530,7 +550,7 @@ lower limit record
@param[in,out] ilow_matched_bytes already matched bytes in the
first partially matched field in the lower limit record
@param[out] cursor page cursor */
-void
+bool
page_cur_search_with_match_bytes(
const buf_block_t* block,
const dict_index_t* index,
@@ -544,9 +564,7 @@ page_cur_search_with_match_bytes(
{
ulint up;
ulint low;
- ulint mid;
const page_t* page;
- const page_dir_slot_t* slot;
const rec_t* up_rec;
const rec_t* low_rec;
const rec_t* mid_rec;
@@ -595,7 +613,7 @@ page_cur_search_with_match_bytes(
iup_matched_fields, iup_matched_bytes,
ilow_matched_fields, ilow_matched_bytes,
cursor)) {
- return;
+ return false;
}
# ifdef PAGE_CUR_DBG
if (mode == PAGE_CUR_DBG) {
@@ -633,9 +651,12 @@ page_cur_search_with_match_bytes(
const ulint n_core = page_is_leaf(page) ? index->n_core_fields : 0;
while (up - low > 1) {
- mid = (low + up) / 2;
- slot = page_dir_get_nth_slot(page, mid);
- mid_rec = page_dir_slot_get_rec(slot);
+ const ulint mid = (low + up) / 2;
+ mid_rec = page_dir_slot_get_rec_validate(
+ page_dir_get_nth_slot(page, mid));
+ if (UNIV_UNLIKELY(!mid_rec)) {
+ goto corrupted;
+ }
ut_pair_min(&cur_matched_fields, &cur_matched_bytes,
low_matched_fields, low_matched_bytes,
@@ -682,18 +703,30 @@ up_slot_match:
}
}
- slot = page_dir_get_nth_slot(page, low);
- low_rec = page_dir_slot_get_rec(slot);
- slot = page_dir_get_nth_slot(page, up);
- up_rec = page_dir_slot_get_rec(slot);
+ low_rec = page_dir_slot_get_rec_validate(
+ page_dir_get_nth_slot(page, low));
+ up_rec = page_dir_slot_get_rec_validate(
+ page_dir_get_nth_slot(page, up));
+ if (UNIV_UNLIKELY(!low_rec || !up_rec)) {
+corrupted:
+ if (UNIV_LIKELY_NULL(heap)) {
+ mem_heap_free(heap);
+ }
+ return true;
+ }
/* Perform linear search until the upper and lower records come to
distance 1 of each other. */
- while (page_rec_get_next_const(low_rec) != up_rec) {
-
- mid_rec = page_rec_get_next_const(low_rec);
-
+ for (;;) {
+ if (const rec_t* next = page_rec_get_next_const(low_rec)) {
+ if (next == up_rec) {
+ break;
+ }
+ mid_rec = next;
+ } else {
+ goto corrupted;
+ }
ut_pair_min(&cur_matched_fields, &cur_matched_bytes,
low_matched_fields, low_matched_bytes,
up_matched_fields, up_matched_bytes);
@@ -762,6 +795,7 @@ up_rec_match:
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
+ return false;
}
#endif /* BTR_CUR_HASH_ADAPT */
@@ -774,17 +808,12 @@ page_cur_open_on_rnd_user_rec(
buf_block_t* block, /*!< in: page */
page_cur_t* cursor) /*!< out: page cursor */
{
- const ulint n_recs = page_get_n_recs(block->page.frame);
-
- page_cur_set_before_first(block, cursor);
-
- if (UNIV_UNLIKELY(n_recs == 0)) {
-
- return;
- }
-
- cursor->rec = page_rec_get_nth(block->page.frame,
- ut_rnd_interval(n_recs) + 1);
+ cursor->block= block;
+ if (const ulint n_recs= page_get_n_recs(block->page.frame))
+ if ((cursor->rec= page_rec_get_nth(block->page.frame,
+ ut_rnd_interval(n_recs) + 1)))
+ return;
+ cursor->rec= page_get_infimum_rec(block->page.frame);
}
/**
@@ -803,7 +832,7 @@ static void page_rec_set_n_owned(rec_t *rec, ulint n_owned, bool comp)
Split a directory slot which owns too many records.
@param[in,out] block index page
@param[in,out] slot the slot that needs to be split */
-static void page_dir_split_slot(const buf_block_t &block,
+static bool page_dir_split_slot(const buf_block_t &block,
page_dir_slot_t *slot)
{
ut_ad(slot <= &block.page.frame[srv_page_size - PAGE_EMPTY_DIR_START]);
@@ -816,10 +845,17 @@ static void page_dir_split_slot(const buf_block_t &block,
PAGE_DIR_SLOT_MIN_N_OWNED, "compatibility");
/* Find a record approximately in the middle. */
- const rec_t *rec= page_dir_slot_get_rec(slot + PAGE_DIR_SLOT_SIZE);
+ const rec_t *rec= page_dir_slot_get_rec_validate(slot + PAGE_DIR_SLOT_SIZE);
for (ulint i= n_owned / 2; i--; )
+ {
+ if (UNIV_UNLIKELY(!rec))
+ return true;
rec= page_rec_get_next_const(rec);
+ }
+
+ if (UNIV_UNLIKELY(!rec))
+ return true;
/* Add a directory slot immediately below this one. */
constexpr uint16_t n_slots_f= PAGE_N_DIR_SLOTS + PAGE_HEADER;
@@ -829,7 +865,10 @@ static void page_dir_split_slot(const buf_block_t &block,
page_dir_slot_t *last_slot= static_cast<page_dir_slot_t*>
(block.page.frame + srv_page_size - (PAGE_DIR + PAGE_DIR_SLOT_SIZE) -
n_slots * PAGE_DIR_SLOT_SIZE);
- ut_ad(slot >= last_slot);
+
+ if (UNIV_UNLIKELY(slot < last_slot))
+ return true;
+
memmove_aligned<2>(last_slot, last_slot + PAGE_DIR_SLOT_SIZE,
slot - last_slot);
@@ -842,6 +881,7 @@ static void page_dir_split_slot(const buf_block_t &block,
page_rec_set_n_owned(page_dir_slot_get_rec(slot), half_owned, comp);
page_rec_set_n_owned(page_dir_slot_get_rec(slot - PAGE_DIR_SLOT_SIZE),
n_owned - half_owned, comp);
+ return false;
}
/**
@@ -867,6 +907,10 @@ static void page_zip_dir_split_slot(buf_block_t *block, ulint s, mtr_t* mtr)
const rec_t *rec= page_dir_slot_get_rec(slot + PAGE_DIR_SLOT_SIZE);
+ /* We do not try to prevent crash on corruption here.
+ For ROW_FORMAT=COMPRESSED pages, the next-record links should
+ be validated in page_zip_decompress(). Corruption should only
+ be possible here if the buffer pool was corrupted later. */
for (ulint i= n_owned / 2; i--; )
rec= page_rec_get_next_const(rec);
@@ -952,8 +996,12 @@ static void page_zip_dir_balance_slot(buf_block_t *block, ulint s, mtr_t *mtr)
/* Transfer one record to the underfilled slot */
page_rec_set_n_owned<true>(block, slot_rec, 0, true, mtr);
- rec_t* new_rec = rec_get_next_ptr(slot_rec, TRUE);
- page_rec_set_n_owned<true>(block, new_rec,
+ const rec_t* new_rec = page_rec_get_next_low(slot_rec, TRUE);
+ /* We do not try to prevent crash on corruption here.
+ For ROW_FORMAT=COMPRESSED pages, the next-record links should
+ be validated in page_zip_decompress(). Corruption should only
+ be possible here if the buffer pool was corrupted later. */
+ page_rec_set_n_owned<true>(block, const_cast<rec_t*>(new_rec),
PAGE_DIR_SLOT_MIN_N_OWNED,
true, mtr);
mach_write_to_2(slot, page_offset(new_rec));
@@ -1014,18 +1062,27 @@ static void page_dir_balance_slot(const buf_block_t &block, ulint s)
}
/* Transfer one record to the underfilled slot */
- rec_t* new_rec;
+ const rec_t* new_rec;
if (comp) {
+ if (UNIV_UNLIKELY(!(new_rec =
+ page_rec_get_next_low(slot_rec, true)))) {
+ ut_ad("corrupted page" == 0);
+ return;
+ }
page_rec_set_n_owned(slot_rec, 0, true);
- new_rec = rec_get_next_ptr(slot_rec, TRUE);
- page_rec_set_n_owned(new_rec, PAGE_DIR_SLOT_MIN_N_OWNED, true);
+ page_rec_set_n_owned(const_cast<rec_t*>(new_rec),
+ PAGE_DIR_SLOT_MIN_N_OWNED, true);
page_rec_set_n_owned(up_rec, up_n_owned - 1, true);
} else {
+ if (UNIV_UNLIKELY(!(new_rec =
+ page_rec_get_next_low(slot_rec, false)))) {
+ ut_ad("corrupted page" == 0);
+ return;
+ }
page_rec_set_n_owned(slot_rec, 0, false);
- new_rec = rec_get_next_ptr(slot_rec, FALSE);
- page_rec_set_n_owned(new_rec, PAGE_DIR_SLOT_MIN_N_OWNED,
- false);
+ page_rec_set_n_owned(const_cast<rec_t*>(new_rec),
+ PAGE_DIR_SLOT_MIN_N_OWNED, false);
page_rec_set_n_owned(up_rec, up_n_owned - 1, false);
}
@@ -1282,6 +1339,20 @@ inline void mtr_t::page_insert(const buf_block_t &block, bool reuse,
m_last_offset= FIL_PAGE_TYPE;
}
+/** Report page directory corruption.
+@param block index page
+@param index index tree
+*/
+ATTRIBUTE_COLD
+static void page_cur_directory_corrupted(const buf_block_t &block,
+ const dict_index_t &index)
+{
+ ib::error() << "Directory of " << block.page.id()
+ << " of index " << index.name
+ << " in table " << index.table->name
+ << " is corrupted";
+}
+
/***********************************************************//**
Inserts a record next to page cursor on an uncompressed page.
@return pointer to record
@@ -1624,9 +1695,14 @@ copied:
{
const ulint owner= page_dir_find_owner_slot(next_rec);
if (UNIV_UNLIKELY(owner == ULINT_UNDEFINED))
+ {
+ page_cur_directory_corrupted(*block, *index);
+ return nullptr;
+ }
+
+ if (page_dir_split_slot(*block, page_dir_get_nth_slot(block->page.frame,
+ owner)))
return nullptr;
- page_dir_split_slot(*block,
- page_dir_get_nth_slot(block->page.frame, owner));
}
rec_offs_make_valid(insert_buf + extra_size, index,
@@ -1694,20 +1770,20 @@ static inline void page_zip_dir_add_slot(buf_block_t *block,
/***********************************************************//**
Inserts a record next to page cursor on a compressed and uncompressed
-page. Returns pointer to inserted record if succeed, i.e.,
-enough space available, NULL otherwise.
-The cursor stays at the same position.
+page.
IMPORTANT: The caller will have to update IBUF_BITMAP_FREE
if this is a compressed leaf page in a secondary index.
This has to be done either within the same mini-transaction,
or by invoking ibuf_reset_free_bits() before mtr_commit().
-@return pointer to record if succeed, NULL otherwise */
+@return pointer to inserted record
+@return nullptr on failure */
rec_t*
page_cur_insert_rec_zip(
/*====================*/
- page_cur_t* cursor, /*!< in/out: page cursor */
+ page_cur_t* cursor, /*!< in/out: page cursor,
+ logical position unchanged */
dict_index_t* index, /*!< in: record descriptor */
const rec_t* rec, /*!< in: pointer to a physical record */
rec_offs* offsets,/*!< in/out: rec_get_offsets(rec, index) */
@@ -1787,6 +1863,9 @@ page_cur_insert_rec_zip(
{
ulint pos= page_rec_get_n_recs_before(cursor->rec);
+ if (UNIV_UNLIKELY(pos == ULINT_UNDEFINED))
+ return nullptr;
+
switch (page_zip_reorganize(cursor->block, index, level, mtr, true)) {
case DB_FAIL:
ut_ad(cursor->rec == cursor_rec);
@@ -1797,10 +1876,13 @@ page_cur_insert_rec_zip(
return nullptr;
}
- if (pos)
- cursor->rec= page_rec_get_nth(page, pos);
- else
- ut_ad(cursor->rec == page_get_infimum_rec(page));
+ if (!pos)
+ ut_ad(cursor->rec == page + PAGE_NEW_INFIMUM);
+ else if (!(cursor->rec= page_rec_get_nth(page, pos)))
+ {
+ cursor->rec= page + PAGE_NEW_SUPREMUM;
+ return nullptr;
+ }
ut_ad(!page_header_get_ptr(page, PAGE_FREE));
@@ -1817,16 +1899,21 @@ page_cur_insert_rec_zip(
if (insert_rec)
{
ulint pos= page_rec_get_n_recs_before(insert_rec);
- ut_ad(pos > 0);
+ if (UNIV_UNLIKELY(!pos || pos == ULINT_UNDEFINED))
+ return nullptr;
/* We are writing entire page images to the log. Reduce the redo
log volume by reorganizing the page at the same time. */
switch (page_zip_reorganize(cursor->block, index, level, mtr)) {
case DB_SUCCESS:
/* The page was reorganized: Seek to pos. */
- cursor->rec= pos > 1
- ? page_rec_get_nth(page, pos - 1)
- : page + PAGE_NEW_INFIMUM;
+ if (pos <= 1)
+ cursor->rec= page + PAGE_NEW_INFIMUM;
+ else if (!(cursor->rec= page_rec_get_nth(page, pos - 1)))
+ {
+ cursor->rec= page + PAGE_NEW_INFIMUM;
+ return nullptr;
+ }
insert_rec= page + rec_get_next_offs(cursor->rec, 1);
rec_offs_make_valid(insert_rec, index, page_is_leaf(page), offsets);
break;
@@ -1892,19 +1979,25 @@ too_small:
byte *const free_rec_ptr= page + free_rec;
heap_no= rec_get_heap_no_new(free_rec_ptr);
- int16_t next_rec= mach_read_from_2(free_rec_ptr - REC_NEXT);
+ int16_t next_free= mach_read_from_2(free_rec_ptr - REC_NEXT);
/* With innodb_page_size=64k, int16_t would be unsafe to use here,
but that cannot be used with ROW_FORMAT=COMPRESSED. */
static_assert(UNIV_ZIP_SIZE_SHIFT_MAX == 14, "compatibility");
- if (next_rec)
+ if (next_free)
{
- next_rec= static_cast<int16_t>(next_rec + free_rec);
- ut_ad(int{PAGE_NEW_SUPREMUM_END + REC_N_NEW_EXTRA_BYTES} <= next_rec);
- ut_ad(static_cast<uint16_t>(next_rec) < srv_page_size);
+ next_free= static_cast<int16_t>(next_free + free_rec);
+ if (UNIV_UNLIKELY(int{PAGE_NEW_SUPREMUM_END + REC_N_NEW_EXTRA_BYTES} >
+ next_free ||
+ uint16_t(next_free) >= srv_page_size))
+ {
+ if (UNIV_LIKELY_NULL(heap))
+ mem_heap_free(heap);
+ return nullptr;
+ }
}
byte *hdr= my_assume_aligned<4>(&page_zip->data[page_free_f]);
- mach_write_to_2(hdr, static_cast<uint16_t>(next_rec));
+ mach_write_to_2(hdr, static_cast<uint16_t>(next_free));
const byte *const garbage= my_assume_aligned<2>(page_free + 2);
ut_ad(mach_read_from_2(garbage) >= rec_size);
mach_write_to_2(my_assume_aligned<2>(hdr + 2),
@@ -1960,18 +2053,20 @@ use_heap:
page_zip_dir_add_slot(cursor->block, index, mtr);
}
+ /* next record after current before the insertion */
+ const rec_t *next_rec = page_rec_get_next_low(cursor->rec, TRUE);
+ if (UNIV_UNLIKELY(!next_rec ||
+ rec_get_status(next_rec) == REC_STATUS_INFIMUM ||
+ rec_get_status(cursor->rec) > REC_STATUS_INFIMUM))
+ return nullptr;
+
/* 3. Create the record */
byte *insert_rec= rec_copy(insert_buf, rec, offsets);
rec_offs_make_valid(insert_rec, index, page_is_leaf(page), offsets);
/* 4. Insert the record in the linked list of records */
ut_ad(cursor->rec != insert_rec);
-
- /* next record after current before the insertion */
- const rec_t* next_rec = page_rec_get_next_low(cursor->rec, TRUE);
- ut_ad(rec_get_status(cursor->rec) <= REC_STATUS_INFIMUM);
ut_ad(rec_get_status(insert_rec) < REC_STATUS_INFIMUM);
- ut_ad(rec_get_status(next_rec) != REC_STATUS_INFIMUM);
mach_write_to_2(insert_rec - REC_NEXT, static_cast<uint16_t>
(next_rec - insert_rec));
@@ -2038,8 +2133,9 @@ inc_dir:
/* 7. It remains to update the owner record. */
ulint n_owned;
- while (!(n_owned = rec_get_n_owned_new(next_rec)))
- next_rec= page_rec_get_next_low(next_rec, true);
+ while (!(n_owned= rec_get_n_owned_new(next_rec)))
+ if (!(next_rec= page_rec_get_next_low(next_rec, true)))
+ return nullptr;
rec_set_bit_field_1(const_cast<rec_t*>(next_rec), n_owned + 1,
REC_NEW_N_OWNED, REC_N_OWNED_MASK, REC_N_OWNED_SHIFT);
@@ -2053,7 +2149,10 @@ inc_dir:
{
const ulint owner= page_dir_find_owner_slot(next_rec);
if (UNIV_UNLIKELY(owner == ULINT_UNDEFINED))
+ {
+ page_cur_directory_corrupted(*cursor->block, *index);
return nullptr;
+ }
page_zip_dir_split_slot(cursor->block, owner, mtr);
}
@@ -2186,8 +2285,8 @@ page_cur_delete_rec(
However, this could also be a call in
btr_cur_pessimistic_update() to delete the only
record in the page and to insert another one. */
- page_cur_move_to_next(cursor);
- ut_ad(page_cur_is_after_last(cursor));
+ ut_ad(page_rec_is_supremum(page_rec_get_next(cursor->rec)));
+ page_cur_set_after_last(block, cursor);
page_create_empty(page_cur_get_block(cursor),
const_cast<dict_index_t*>(index), mtr);
return;
@@ -2198,6 +2297,7 @@ page_cur_delete_rec(
if (UNIV_UNLIKELY(!cur_slot_no || cur_slot_no == ULINT_UNDEFINED)) {
/* Avoid crashing due to a corrupted page. */
+ page_cur_directory_corrupted(*block, *index);
return;
}
@@ -2221,11 +2321,16 @@ page_cur_delete_rec(
while (current_rec != rec) {
prev_rec = rec;
- rec = page_rec_get_next(rec);
+ if (!(rec = page_rec_get_next(rec))) {
+ /* Avoid crashing due to a corrupted page. */
+ return;
+ }
}
- page_cur_move_to_next(cursor);
- next_rec = cursor->rec;
+ if (!(next_rec = page_cur_move_to_next(cursor))) {
+ /* Avoid crashing due to a corrupted page. */
+ return;
+ }
/* Remove the record from the linked list of records */
/* If the deleted record is pointed to by a dir slot, update the
@@ -2547,7 +2652,7 @@ inc_dir:
mach_write_to_2(page_n_recs, mach_read_from_2(page_n_recs) + 1);
if (UNIV_UNLIKELY(n_owned == PAGE_DIR_SLOT_MAX_N_OWNED))
- page_dir_split_slot(block, owner_slot);
+ return page_dir_split_slot(block, owner_slot);
ut_ad(page_simple_validate_old(page));
return false;
}
@@ -2772,7 +2877,7 @@ inc_dir:
mach_write_to_2(page_n_recs, mach_read_from_2(page_n_recs) + 1);
if (UNIV_UNLIKELY(n_owned == PAGE_DIR_SLOT_MAX_N_OWNED))
- page_dir_split_slot(block, owner_slot);
+ return page_dir_split_slot(block, owner_slot);
ut_ad(page_simple_validate_new(page));
return false;
}
diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc
index de92c539444..3d4aaf9111f 100644
--- a/storage/innobase/page/page0page.cc
+++ b/storage/innobase/page/page0page.cc
@@ -99,43 +99,25 @@ page_dir_find_owner_slot(
if (page_is_comp(page)) {
while (rec_get_n_owned_new(r) == 0) {
- r = rec_get_next_ptr_const(r, TRUE);
- ut_ad(r >= page + PAGE_NEW_SUPREMUM);
- ut_ad(r < page + (srv_page_size - PAGE_DIR));
+ r = page_rec_get_next_low(r, true);
+ if (UNIV_UNLIKELY(r < page + PAGE_NEW_SUPREMUM
+ || r >= slot)) {
+ return ULINT_UNDEFINED;
+ }
}
} else {
while (rec_get_n_owned_old(r) == 0) {
- r = rec_get_next_ptr_const(r, FALSE);
- ut_ad(r >= page + PAGE_OLD_SUPREMUM);
- ut_ad(r < page + (srv_page_size - PAGE_DIR));
+ r = page_rec_get_next_low(r, false);
+ if (UNIV_UNLIKELY(r < page + PAGE_OLD_SUPREMUM
+ || r >= slot)) {
+ return ULINT_UNDEFINED;
+ }
}
}
- uint16 rec_offs_bytes = mach_encode_2(ulint(r - page));
-
- while (UNIV_LIKELY(*(uint16*) slot != rec_offs_bytes)) {
-
+ while (UNIV_LIKELY(*(uint16*) slot
+ != mach_encode_2(ulint(r - page)))) {
if (UNIV_UNLIKELY(slot == first_slot)) {
- ib::error() << "Probable data corruption on page "
- << page_get_page_no(page)
- << ". Original record on that page;";
-
- if (page_is_comp(page)) {
- fputs("(compact record)", stderr);
- } else {
- rec_print_old(stderr, rec);
- }
-
- ib::error() << "Cannot find the dir slot for this"
- " record on that page;";
-
- if (page_is_comp(page)) {
- fputs("(compact record)", stderr);
- } else {
- rec_print_old(stderr, page
- + mach_decode_2(rec_offs_bytes));
- }
-
return ULINT_UNDEFINED;
}
@@ -478,9 +460,8 @@ page_copy_rec_list_end_no_locks(
page_cur_position(rec, block, &cur1);
- if (page_cur_is_before_first(&cur1)) {
-
- page_cur_move_to_next(&cur1);
+ if (page_cur_is_before_first(&cur1) && !page_cur_move_to_next(&cur1)) {
+ return DB_CORRUPTION;
}
if (UNIV_UNLIKELY(page_is_comp(new_page) != page_rec_is_comp(rec)
@@ -504,12 +485,10 @@ page_copy_rec_list_end_no_locks(
ULINT_UNDEFINED, &heap);
ins_rec = page_cur_insert_rec_low(&cur2, index,
cur1.rec, offsets, mtr);
- if (UNIV_UNLIKELY(!ins_rec)) {
+ if (UNIV_UNLIKELY(!ins_rec || !page_cur_move_to_next(&cur1))) {
err = DB_CORRUPTION;
break;
}
-
- page_cur_move_to_next(&cur1);
ut_ad(!(rec_get_info_bits(cur1.rec, page_is_comp(new_page))
& REC_INFO_MIN_REC_FLAG));
cur2.rec = ins_rec;
@@ -550,10 +529,13 @@ page_copy_rec_list_end(
rec_t* ret = page_rec_get_next(
page_get_infimum_rec(new_page));
ulint num_moved = 0;
- rtr_rec_move_t* rec_move = NULL;
- mem_heap_t* heap = NULL;
ut_ad(page_align(rec) == page);
+ if (UNIV_UNLIKELY(!ret)) {
+ *err = DB_CORRUPTION;
+ return nullptr;
+ }
+
#ifdef UNIV_ZIP_DEBUG
if (new_page_zip) {
page_zip_des_t* page_zip = buf_block_get_page_zip(block);
@@ -579,15 +561,15 @@ page_copy_rec_list_end(
alignas(2) byte h[PAGE_N_DIRECTION + 2 - PAGE_LAST_INSERT];
memcpy_aligned<2>(h, PAGE_HEADER + PAGE_LAST_INSERT + new_page,
sizeof h);
+ mem_heap_t* heap = nullptr;
+ rtr_rec_move_t* rec_move = nullptr;
if (index->is_spatial()) {
ulint max_to_move = page_get_n_recs(
buf_block_get_frame(block));
heap = mem_heap_create(256);
-
- rec_move = static_cast<rtr_rec_move_t*>(
+ rec_move= static_cast<rtr_rec_move_t*>(
mem_heap_alloc(heap, max_to_move * sizeof *rec_move));
-
/* For spatial index, we need to insert recs one by one
to keep recs ordered. */
*err = rtr_page_copy_rec_list_end_no_locks(new_block,
@@ -600,6 +582,10 @@ page_copy_rec_list_end(
*err = page_copy_rec_list_end_no_locks(new_block, block, rec,
index, mtr);
if (UNIV_UNLIKELY(*err != DB_SUCCESS)) {
+err_exit:
+ if (UNIV_LIKELY_NULL(heap)) {
+ mem_heap_free(heap);
+ }
return nullptr;
}
if (was_empty) {
@@ -640,7 +626,11 @@ page_copy_rec_list_end(
have at least one predecessor (the predefined
infimum record, or a freshly copied record
that is smaller than "ret"). */
- ut_a(ret_pos > 0);
+ if (UNIV_UNLIKELY(!ret_pos
+ || ret_pos == ULINT_UNDEFINED)) {
+ *err = DB_CORRUPTION;
+ goto err_exit;
+ }
*err = page_zip_reorganize(new_block, index,
page_zip_level, mtr);
@@ -653,14 +643,12 @@ page_copy_rec_list_end(
ut_ad(page_validate(new_page, index));
/* fall through */
default:
- if (heap) {
- mem_heap_free(heap);
- }
- return nullptr;
+ goto err_exit;
case DB_SUCCESS:
/* The page was reorganized:
Seek to ret_pos. */
ret = page_rec_get_nth(new_page, ret_pos);
+ ut_ad(ret);
}
}
}
@@ -668,13 +656,13 @@ page_copy_rec_list_end(
/* Update the lock table and possible hash index */
if (!index->has_locking()) {
- } else if (rec_move && dict_index_is_spatial(index)) {
+ } else if (UNIV_LIKELY_NULL(rec_move)) {
lock_rtr_move_rec_list(new_block, block, rec_move, num_moved);
} else {
lock_move_rec_list_end(new_block, block, rec);
}
- if (heap) {
+ if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
@@ -721,8 +709,9 @@ page_copy_rec_list_start(
rec_offs_init(offsets_);
if (UNIV_UNLIKELY(!ret)) {
+corrupted:
*err = DB_CORRUPTION;
- return ret;
+ return nullptr;
}
/* Here, "ret" may be pointing to a user record or the
@@ -733,15 +722,17 @@ page_copy_rec_list_start(
return(ret);
}
+ page_cur_set_before_first(block, &cur1);
+ if (UNIV_UNLIKELY(!page_cur_move_to_next(&cur1))) {
+ goto corrupted;
+ }
+
mtr_log_t log_mode = MTR_LOG_NONE;
if (new_page_zip) {
log_mode = mtr_set_log_mode(mtr, MTR_LOG_NONE);
}
- page_cur_set_before_first(block, &cur1);
- page_cur_move_to_next(&cur1);
-
page_cur_position(ret, new_block, &cur2);
const ulint n_core = page_rec_is_leaf(rec) ? index->n_core_fields : 0;
@@ -775,12 +766,12 @@ page_copy_rec_list_start(
cur2.rec = page_cur_insert_rec_low(&cur2, index,
cur1.rec, offsets,
mtr);
- if (UNIV_UNLIKELY(!cur2.rec)) {
+ if (UNIV_UNLIKELY(!cur2.rec
+ || !page_cur_move_to_next(&cur1))) {
*err = DB_CORRUPTION;
return nullptr;
}
- page_cur_move_to_next(&cur1);
ut_ad(!(rec_get_info_bits(cur1.rec,
page_is_comp(new_page))
& REC_INFO_MIN_REC_FLAG));
@@ -821,11 +812,17 @@ zip_reorganize:
the predefined infimum record, then it would
still be the infimum, and we would have
ret_pos == 0. */
+ if (UNIV_UNLIKELY(!ret_pos
+ || ret_pos == ULINT_UNDEFINED)) {
+ *err = DB_CORRUPTION;
+ return nullptr;
+ }
*err = page_zip_reorganize(new_block, index,
page_zip_level, mtr);
switch (*err) {
case DB_SUCCESS:
ret = page_rec_get_nth(new_page, ret_pos);
+ ut_ad(ret);
break;
case DB_FAIL:
if (UNIV_UNLIKELY
@@ -936,7 +933,7 @@ page_delete_rec_list_end(
page_cur_position(rec, block, &cur);
offsets= rec_get_offsets(rec, index, offsets, n_core,
ULINT_UNDEFINED, &heap);
- rec= rec_get_next_ptr(rec, TRUE);
+ rec= const_cast<rec_t*>(page_rec_get_next_low(rec, true));
#ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(&block->page.zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
@@ -981,12 +978,15 @@ page_delete_rec_list_end(
if (scrub)
mtr->memset(block, page_offset(rec2), rec_offs_data_size(offsets), 0);
- rec2 = page_rec_get_next(rec2);
+ rec2= page_rec_get_next(rec2);
}
- while (!page_rec_is_supremum(rec2));
+ while (rec2 && !page_rec_is_supremum(rec2));
if (UNIV_LIKELY_NULL(heap))
mem_heap_free(heap);
+
+ if (UNIV_UNLIKELY(!rec))
+ return DB_CORRUPTION;
}
ut_ad(size < srv_page_size);
@@ -1000,13 +1000,15 @@ page_delete_rec_list_end(
while (!(n_owned= rec_get_n_owned_new(owner_rec)))
{
count++;
- owner_rec= rec_get_next_ptr_const(owner_rec, TRUE);
+ if (!(owner_rec= page_rec_get_next_low(owner_rec, true)))
+ return DB_CORRUPTION;
}
else
while (!(n_owned= rec_get_n_owned_old(owner_rec)))
{
count++;
- owner_rec= rec_get_next_ptr_const(owner_rec, FALSE);
+ if (!(owner_rec= page_rec_get_next_low(owner_rec, false)))
+ return DB_CORRUPTION;
}
ut_ad(n_owned > count);
@@ -1133,7 +1135,10 @@ page_delete_rec_list_start(
}
page_cur_set_before_first(block, &cur1);
- page_cur_move_to_next(&cur1);
+ if (UNIV_UNLIKELY(!page_cur_move_to_next(&cur1))) {
+ ut_ad("corrupted page" == 0);
+ return;
+ }
const ulint n_core = page_rec_is_leaf(rec)
? index->n_core_fields : 0;
@@ -1153,7 +1158,8 @@ page_delete_rec_list_start(
/************************************************************//**
Returns the nth record of the record list.
This is the inverse function of page_rec_get_n_recs_before().
-@return nth record */
+@return nth record
+@retval nullptr on corrupted page */
const rec_t*
page_rec_get_nth_const(
/*===================*/
@@ -1172,7 +1178,6 @@ page_rec_get_nth_const(
ut_ad(nth < srv_page_size / (REC_N_NEW_EXTRA_BYTES + 1));
for (i = 0;; i++) {
-
slot = page_dir_get_nth_slot(page, i);
n_owned = page_dir_slot_get_n_owned(slot);
@@ -1183,87 +1188,154 @@ page_rec_get_nth_const(
}
}
- ut_ad(i > 0);
- slot = page_dir_get_nth_slot(page, i - 1);
- rec = page_dir_slot_get_rec(slot);
+ if (UNIV_UNLIKELY(!i)) {
+ return nullptr;
+ }
+ rec = page_dir_slot_get_rec(slot + 2);
if (page_is_comp(page)) {
do {
rec = page_rec_get_next_low(rec, TRUE);
- ut_ad(rec);
- } while (nth--);
+ } while (rec && nth--);
} else {
do {
rec = page_rec_get_next_low(rec, FALSE);
- ut_ad(rec);
- } while (nth--);
+ } while (rec && nth--);
}
return(rec);
}
-/***************************************************************//**
-Returns the number of records before the given record in chain.
-The number includes infimum and supremum records.
-@return number of records */
-ulint
-page_rec_get_n_recs_before(
-/*=======================*/
- const rec_t* rec) /*!< in: the physical record */
+
+/************************************************************//**
+Gets the pointer to the previous record.
+@return pointer to previous record
+@retval nullptr on error */
+const rec_t*
+page_rec_get_prev_const(
+/*====================*/
+ const rec_t* rec) /*!< in: pointer to record, must not be page
+ infimum */
{
- const page_dir_slot_t* slot;
- const rec_t* slot_rec;
- const page_t* page;
- ulint i;
- lint n = 0;
+ const rec_t* rec2;
+ const rec_t* prev_rec = NULL;
ut_ad(page_rec_check(rec));
- page = page_align(rec);
- if (page_is_comp(page)) {
- while (rec_get_n_owned_new(rec) == 0) {
+ const page_t* const page = page_align(rec);
- rec = rec_get_next_ptr_const(rec, TRUE);
- n--;
- }
+ ut_ad(!page_rec_is_infimum(rec));
+
+ ulint slot_no = page_dir_find_owner_slot(rec);
- for (i = 0; ; i++) {
- slot = page_dir_get_nth_slot(page, i);
- slot_rec = page_dir_slot_get_rec(slot);
+ if (UNIV_UNLIKELY(!slot_no || slot_no == ULINT_UNDEFINED)) {
+ return nullptr;
+ }
- n += lint(rec_get_n_owned_new(slot_rec));
+ const page_dir_slot_t* slot = page_dir_get_nth_slot(page, slot_no - 1);
- if (rec == slot_rec) {
+ if (UNIV_UNLIKELY(!(rec2 = page_dir_slot_get_rec_validate(slot)))) {
+ return nullptr;
+ }
+ if (page_is_comp(page)) {
+ while (rec2 && rec != rec2) {
+ prev_rec = rec2;
+ ulint offs = rec_get_next_offs(rec2, TRUE);
+ if (offs < PAGE_NEW_INFIMUM
+ || offs > page_header_get_field(page,
+ PAGE_HEAP_TOP)) {
+ return nullptr;
+ }
+ rec2 = page + offs;
+ }
+ switch (rec_get_status(prev_rec)) {
+ case REC_STATUS_INSTANT:
+ case REC_STATUS_ORDINARY:
+ if (!page_is_leaf(page)) {
+ return nullptr;
+ }
+ break;
+ case REC_STATUS_INFIMUM:
+ break;
+ case REC_STATUS_NODE_PTR:
+ if (!page_is_leaf(page)) {
break;
}
+ /* fall through */
+ default:
+ return nullptr;
}
} else {
- while (rec_get_n_owned_old(rec) == 0) {
-
- rec = rec_get_next_ptr_const(rec, FALSE);
- n--;
+ while (rec2 && rec != rec2) {
+ prev_rec = rec2;
+ ulint offs = rec_get_next_offs(rec2, FALSE);
+ if (offs < PAGE_OLD_INFIMUM
+ || offs > page_header_get_field(page,
+ PAGE_HEAP_TOP)) {
+ return nullptr;
+ }
+ rec2 = page + offs;
}
+ }
+
+ return(prev_rec);
+}
- for (i = 0; ; i++) {
- slot = page_dir_get_nth_slot(page, i);
- slot_rec = page_dir_slot_get_rec(slot);
+/** Return the number of preceding records in an index page.
+@param rec index record
+@return number of preceding records, including the infimum pseudo-record
+@retval ULINT_UNDEFINED on corrupted page */
+ulint page_rec_get_n_recs_before(const rec_t *rec)
+{
+ const page_t *const page= page_align(rec);
+ const page_dir_slot_t *slot = page_dir_get_nth_slot(page, 0);
+ const page_dir_slot_t *const end_slot= slot - 2 * page_dir_get_n_slots(page);
- n += lint(rec_get_n_owned_old(slot_rec));
+ lint n= 0;
- if (rec == slot_rec) {
+ ut_ad(page_rec_check(rec));
- break;
- }
- }
- }
+ if (page_is_comp(page))
+ {
+ for (; rec_get_n_owned_new(rec) == 0; n--)
+ if (UNIV_UNLIKELY(!(rec= page_rec_get_next_low(rec, true))))
+ return ULINT_UNDEFINED;
- n--;
+ do
+ {
+ const rec_t *slot_rec= page_dir_slot_get_rec_validate(slot);
+ if (UNIV_UNLIKELY(!slot_rec))
+ break;
+ n+= lint(rec_get_n_owned_new(slot_rec));
+
+ if (rec == slot_rec)
+ goto found;
+ }
+ while ((slot-= 2) > end_slot);
+ }
+ else
+ {
+ for (; rec_get_n_owned_old(rec) == 0; n--)
+ if (UNIV_UNLIKELY(!(rec= page_rec_get_next_low(rec, false))))
+ return ULINT_UNDEFINED;
+
+ do
+ {
+ const rec_t *slot_rec= page_dir_slot_get_rec_validate(slot);
+ if (UNIV_UNLIKELY(!slot_rec))
+ break;
+ n+= lint(rec_get_n_owned_old(slot_rec));
- ut_ad(n >= 0);
- ut_ad((ulong) n < srv_page_size / (REC_N_NEW_EXTRA_BYTES + 1));
+ if (rec == slot_rec)
+ goto found;
+ }
+ while ((slot-= 2) > end_slot);
+ }
- return((ulint) n);
+ return ULINT_UNDEFINED;
+found:
+ return --n < 0 ? ULINT_UNDEFINED : ulint(n);
}
/************************************************************//**
@@ -1783,15 +1855,14 @@ page_simple_validate_new(
slot_no = 0;
slot = page_dir_get_nth_slot(page, slot_no);
- rec = page_get_infimum_rec(page);
+ rec = page + PAGE_NEW_INFIMUM;
for (;;) {
- if (UNIV_UNLIKELY(rec > rec_heap_top)) {
-
+ if (UNIV_UNLIKELY(rec < page + PAGE_NEW_INFIMUM
+ || rec > rec_heap_top)) {
ib::error() << "Record " << page_offset(rec)
- << " is above rec heap top "
+ << " is out of bounds: "
<< page_offset(rec_heap_top);
-
goto func_exit;
}
@@ -2247,14 +2318,21 @@ wrong_page_type:
}
next_rec:
- if (page_rec_is_supremum(rec)) {
+ old_rec = rec;
+ rec = page_rec_get_next_const(rec);
+
+ if (UNIV_UNLIKELY(!rec != page_rec_is_supremum(old_rec))) {
+ ib::error() << "supremum is not last record: " << offs;
+ ret = FALSE;
+ }
+
+ if (!rec) {
+ rec = old_rec; /* supremum */
break;
}
count++;
own_count++;
- old_rec = rec;
- rec = page_rec_get_next_const(rec);
if (page_rec_is_infimum(old_rec)
&& page_rec_is_user_rec(rec)) {
@@ -2409,37 +2487,36 @@ page_find_rec_with_heap_no(
@param[in] page index tree leaf page
@return the last record, not delete-marked
@retval infimum record if all records are delete-marked */
-const rec_t*
-page_find_rec_last_not_deleted(
- const page_t* page)
+const rec_t *page_find_rec_last_not_deleted(const page_t *page)
{
- const rec_t* rec = page_get_infimum_rec(page);
- const rec_t* prev_rec = NULL; // remove warning
+ ut_ad(page_is_leaf(page));
- /* Because the page infimum is never delete-marked
- and never the metadata pseudo-record (MIN_REC_FLAG)),
- prev_rec will always be assigned to it first. */
- ut_ad(!rec_get_info_bits(rec, page_rec_is_comp(rec)));
- ut_ad(page_is_leaf(page));
-
- if (page_is_comp(page)) {
- do {
- if (!(rec[-REC_NEW_INFO_BITS]
- & (REC_INFO_DELETED_FLAG
- | REC_INFO_MIN_REC_FLAG))) {
- prev_rec = rec;
- }
- rec = page_rec_get_next_low(rec, true);
- } while (rec != page + PAGE_NEW_SUPREMUM);
- } else {
- do {
- if (!(rec[-REC_OLD_INFO_BITS]
- & (REC_INFO_DELETED_FLAG
- | REC_INFO_MIN_REC_FLAG))) {
- prev_rec = rec;
- }
- rec = page_rec_get_next_low(rec, false);
- } while (rec != page + PAGE_OLD_SUPREMUM);
- }
- return(prev_rec);
+ if (page_is_comp(page))
+ {
+ const rec_t *rec= page + PAGE_NEW_INFIMUM;
+ const rec_t *prev_rec= rec;
+ do
+ {
+ if (!(rec[-REC_NEW_INFO_BITS] &
+ (REC_INFO_DELETED_FLAG | REC_INFO_MIN_REC_FLAG)))
+ prev_rec= rec;
+ if (!(rec= page_rec_get_next_low(rec, true)))
+ return page + PAGE_NEW_INFIMUM;
+ } while (rec != page + PAGE_NEW_SUPREMUM);
+ return prev_rec;
+ }
+ else
+ {
+ const rec_t *rec= page + PAGE_OLD_INFIMUM;
+ const rec_t *prev_rec= rec;
+ do
+ {
+ if (!(rec[-REC_OLD_INFO_BITS] &
+ (REC_INFO_DELETED_FLAG | REC_INFO_MIN_REC_FLAG)))
+ prev_rec= rec;
+ if (!(rec= page_rec_get_next_low(rec, false)))
+ return page + PAGE_OLD_INFIMUM;
+ } while (rec != page + PAGE_OLD_SUPREMUM);
+ return prev_rec;
+ }
}
diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc
index bd572372aca..9948f2e4d68 100644
--- a/storage/innobase/rem/rem0rec.cc
+++ b/storage/innobase/rem/rem0rec.cc
@@ -864,19 +864,19 @@ rec_get_offsets_func(
ut_ad(!n_core);
n = dict_index_get_n_unique_in_tree_nonleaf(index) + 1;
break;
+ default:
+ ut_ad("corrupted record header" == 0);
+ /* fall through */
case REC_STATUS_INFIMUM:
case REC_STATUS_SUPREMUM:
/* infimum or supremum record */
ut_ad(rec_get_heap_no_new(rec)
== ulint(rec_get_status(rec)
- == REC_STATUS_INFIMUM
- ? PAGE_HEAP_NO_INFIMUM
- : PAGE_HEAP_NO_SUPREMUM));
+ == REC_STATUS_INFIMUM
+ ? PAGE_HEAP_NO_INFIMUM
+ : PAGE_HEAP_NO_SUPREMUM));
n = 1;
break;
- default:
- ut_error;
- return(NULL);
}
} else {
n = rec_get_n_fields_old(rec);
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index f3ed3998aa7..e11f4e8a26d 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -253,19 +253,17 @@ public:
}
/** Position the cursor on the first user record. */
- void open(buf_block_t* block) UNIV_NOTHROW
+ rec_t* open(buf_block_t* block) noexcept
+ MY_ATTRIBUTE((warn_unused_result))
{
page_cur_set_before_first(block, &m_cur);
-
- if (!end()) {
- next();
- }
+ return next();
}
/** Move to the next record. */
- void next() UNIV_NOTHROW
+ rec_t* next() noexcept MY_ATTRIBUTE((warn_unused_result))
{
- page_cur_move_to_next(&m_cur);
+ return page_cur_move_to_next(&m_cur);
}
/**
@@ -1520,6 +1518,8 @@ inline bool IndexPurge::open() noexcept
return false;
rec_t *rec= page_rec_get_next(btr_pcur_get_rec(&m_pcur));
+ if (!rec)
+ return false;
if (rec_is_metadata(rec, *m_index))
/* Skip the metadata pseudo-record. */
btr_pcur_get_page_cur(&m_pcur)->rec= rec;
@@ -1531,7 +1531,9 @@ Position the cursor on the next record.
@return DB_SUCCESS or error code */
dberr_t IndexPurge::next() noexcept
{
- btr_pcur_move_to_next_on_page(&m_pcur);
+ if (UNIV_UNLIKELY(!btr_pcur_move_to_next_on_page(&m_pcur))) {
+ return DB_CORRUPTION;
+ }
/* When switching pages, commit the mini-transaction
in order to release the latch on the old page. */
@@ -1569,8 +1571,8 @@ dberr_t IndexPurge::next() noexcept
&m_mtr)) {
return err;
}
- } else {
- btr_pcur_move_to_next_on_page(&m_pcur);
+ } else if (!btr_pcur_move_to_next_on_page(&m_pcur)) {
+ return DB_CORRUPTION;
}
} while (!btr_pcur_is_on_user_rec(&m_pcur));
@@ -1787,7 +1789,9 @@ PageConverter::update_records(
/* This will also position the cursor on the first user record. */
- m_rec_iter.open(block);
+ if (!m_rec_iter.open(block)) {
+ return DB_CORRUPTION;
+ }
while (!m_rec_iter.end()) {
rec_t* rec = m_rec_iter.current();
@@ -1818,17 +1822,19 @@ PageConverter::update_records(
optimistic delete. */
if (deleted) {
+ ++m_index->m_stats.m_n_deleted;
/* A successful purge will move the cursor to the
next record. */
- if (!purge()) {
- m_rec_iter.next();
+ if (purge()) {
+ continue;
}
-
- ++m_index->m_stats.m_n_deleted;
} else {
++m_index->m_stats.m_n_rows;
- m_rec_iter.next();
+ }
+
+ if (!m_rec_iter.next()) {
+ return DB_CORRUPTION;
}
}
@@ -3167,6 +3173,8 @@ static dberr_t handle_instant_metadata(dict_table_t *table,
while (btr_page_get_level(page.get()) != 0)
{
const rec_t *rec= page_rec_get_next(page_get_infimum_rec(page.get()));
+ if (!rec)
+ return DB_CORRUPTION;
/* Relax the assertion in rec_init_offsets(). */
ut_ad(!index->in_instant_init);
@@ -3191,18 +3199,22 @@ static dberr_t handle_instant_metadata(dict_table_t *table,
return err;
}
- const auto *rec= page_rec_get_next(page_get_infimum_rec(page.get()));
+ const auto *rec= page_rec_get_next_const(page_get_infimum_rec(page.get()));
const auto comp= dict_table_is_comp(index->table);
- const auto info_bits= rec_get_info_bits(rec, comp);
- if (page_rec_is_supremum(rec) || !(info_bits & REC_INFO_MIN_REC_FLAG))
+ if (!rec || page_rec_is_supremum(rec))
{
+ corrupted_metadata:
ib::error() << "Table " << index->table->name
<< " is missing instant ALTER metadata";
index->table->corrupted= true;
return DB_CORRUPTION;
}
+ const auto info_bits= rec_get_info_bits(rec, comp);
+ if (!(info_bits & REC_INFO_MIN_REC_FLAG))
+ goto corrupted_metadata;
+
if ((info_bits & ~REC_INFO_DELETED_FLAG) != REC_INFO_MIN_REC_FLAG ||
(comp && rec_get_status(rec) != REC_STATUS_INSTANT))
{
diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc
index e6e4a056e91..35179eaf7c3 100644
--- a/storage/innobase/row/row0ins.cc
+++ b/storage/innobase/row/row0ins.cc
@@ -2232,7 +2232,9 @@ row_ins_duplicate_error_in_clust_online(
}
}
- rec = page_rec_get_next_const(btr_cur_get_rec(cursor));
+ if (!(rec = page_rec_get_next_const(btr_cur_get_rec(cursor)))) {
+ return DB_CORRUPTION;
+ }
if (cursor->up_match >= n_uniq && !page_rec_is_supremum(rec)) {
*offsets = rec_get_offsets(rec, cursor->index, *offsets,
@@ -2353,11 +2355,13 @@ duplicate:
}
}
+ err = DB_SUCCESS;
+
if (cursor->up_match >= n_unique) {
rec = page_rec_get_next(btr_cur_get_rec(cursor));
- if (!page_rec_is_supremum(rec)) {
+ if (rec && !page_rec_is_supremum(rec)) {
offsets = rec_get_offsets(rec, cursor->index, offsets,
cursor->index->n_core_fields,
ULINT_UNDEFINED, &heap);
@@ -2382,24 +2386,23 @@ duplicate:
}
switch (err) {
+ default:
+ break;
case DB_SUCCESS_LOCKED_REC:
+ err = DB_SUCCESS;
+ /* fall through */
case DB_SUCCESS:
- break;
- default:
- goto func_exit;
- }
-
- if (row_ins_dupl_error_with_rec(
- rec, entry, cursor->index, offsets)) {
- goto duplicate;
+ if (row_ins_dupl_error_with_rec(
+ rec, entry, cursor->index,
+ offsets)) {
+ goto duplicate;
+ }
}
}
/* This should never happen */
- ut_error;
+ err = DB_CORRUPTION;
}
-
- err = DB_SUCCESS;
func_exit:
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 513a613011c..f75054c3a55 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -2141,10 +2141,14 @@ corrupted_metadata:
mem_heap_empty(row_heap);
- page_cur_move_to_next(cur);
-
stage->n_pk_recs_inc();
+ if (!page_cur_move_to_next(cur)) {
+corrupted_rec:
+ err = DB_CORRUPTION;
+ goto err_exit;
+ }
+
if (page_cur_is_after_last(cur)) {
stage->inc();
@@ -2250,9 +2254,10 @@ end_of_index:
btr_leaf_page_release(page_cur_get_block(cur),
BTR_SEARCH_LEAF, &mtr);
page_cur_set_before_first(block, cur);
- page_cur_move_to_next(cur);
-
- ut_ad(!page_cur_is_after_last(cur));
+ if (!page_cur_move_to_next(cur)
+ || page_cur_is_after_last(cur)) {
+ goto corrupted_rec;
+ }
}
}
diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc
index d11b29d995f..0061ada7d1e 100644
--- a/storage/innobase/row/row0sel.cc
+++ b/storage/innobase/row/row0sel.cc
@@ -1803,7 +1803,11 @@ rec_loop:
search result set, resulting in the phantom problem. */
if (!node->read_view) {
- rec_t* next_rec = page_rec_get_next(rec);
+ const rec_t* next_rec = page_rec_get_next_const(rec);
+ if (UNIV_UNLIKELY(!next_rec)) {
+ err = DB_CORRUPTION;
+ goto lock_wait_or_error;
+ }
unsigned lock_type;
offsets = rec_get_offsets(next_rec, index, offsets,
@@ -3424,11 +3428,13 @@ Row_sel_get_clust_rec_for_mysql::operator()(
rec, sec_index, true,
sec_index->n_fields, heap);
page_cur_t page_cursor;
-
- ulint low_match = page_cur_search(
- block, sec_index, tuple,
- PAGE_CUR_LE, &page_cursor);
-
+ ulint up_match = 0, low_match = 0;
+ ut_ad(!page_cur_search_with_match(block, sec_index,
+ tuple, PAGE_CUR_LE,
+ &up_match,
+ &low_match,
+ &page_cursor,
+ nullptr));
ut_ad(low_match < dtuple_get_n_fields_cmp(tuple));
mem_heap_free(heap);
clust_rec = NULL;
@@ -4769,6 +4775,7 @@ wait_table_again:
pcur, 0, &mtr);
if (err != DB_SUCCESS) {
+page_corrupted:
rec = NULL;
goto page_read_error;
}
@@ -4786,6 +4793,10 @@ wait_table_again:
/* Try to place a gap lock on the next index record
to prevent phantoms in ORDER BY ... DESC queries */
const rec_t* next_rec = page_rec_get_next_const(rec);
+ if (UNIV_UNLIKELY(!next_rec)) {
+ err = DB_CORRUPTION;
+ goto page_corrupted;
+ }
offsets = rec_get_offsets(next_rec, index, offsets,
index->n_core_fields,
@@ -5792,8 +5803,8 @@ next_rec_after_check:
if (err != DB_SUCCESS) {
goto lock_wait_or_error;
}
- } else {
- btr_pcur_move_to_next_on_page(pcur);
+ } else if (!btr_pcur_move_to_next_on_page(pcur)) {
+ goto corrupted;
}
goto rec_loop;
@@ -5803,6 +5814,7 @@ next_rec_after_check:
goto rec_loop;
}
if (UNIV_UNLIKELY(!btr_pcur_get_rec(pcur))) {
+corrupted:
err = DB_CORRUPTION;
goto normal_return;
}
diff --git a/storage/perfschema/CMakeLists.txt b/storage/perfschema/CMakeLists.txt
index 3d2f043dd9e..56ea79755a3 100644
--- a/storage/perfschema/CMakeLists.txt
+++ b/storage/perfschema/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2021, Oracle and/or its affiliates.
+# Copyright (c) 2009, 2022, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
@@ -92,6 +92,7 @@ table_esms_by_host_by_event_name.h
table_esms_by_digest.h
table_esms_by_program.h
table_prepared_stmt_instances.h
+#table_processlist.h
table_esms_by_thread_by_event_name.h
table_esms_by_user_by_event_name.h
table_esms_global_by_event_name.h
@@ -208,6 +209,7 @@ table_esms_by_host_by_event_name.cc
table_esms_by_digest.cc
table_esms_by_program.cc
table_prepared_stmt_instances.cc
+#table_processlist.cc
table_esms_by_thread_by_event_name.cc
table_esms_by_user_by_event_name.cc
table_esms_global_by_event_name.cc
diff --git a/storage/perfschema/cursor_by_account.cc b/storage/perfschema/cursor_by_account.cc
index 38359cb24aa..25e3ed662d1 100644
--- a/storage/perfschema/cursor_by_account.cc
+++ b/storage/perfschema/cursor_by_account.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_account.h b/storage/perfschema/cursor_by_account.h
index 1f6d65adc98..30ee3761f37 100644
--- a/storage/perfschema/cursor_by_account.h
+++ b/storage/perfschema/cursor_by_account.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_host.cc b/storage/perfschema/cursor_by_host.cc
index 26bdbc457f8..956644cfce2 100644
--- a/storage/perfschema/cursor_by_host.cc
+++ b/storage/perfschema/cursor_by_host.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_host.h b/storage/perfschema/cursor_by_host.h
index 45a2fb894c1..e7ae47fef72 100644
--- a/storage/perfschema/cursor_by_host.h
+++ b/storage/perfschema/cursor_by_host.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_thread.cc b/storage/perfschema/cursor_by_thread.cc
index f8a4fa243ce..ff90c77e47d 100644
--- a/storage/perfschema/cursor_by_thread.cc
+++ b/storage/perfschema/cursor_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_thread.h b/storage/perfschema/cursor_by_thread.h
index 24578fd44f1..910291c2be3 100644
--- a/storage/perfschema/cursor_by_thread.h
+++ b/storage/perfschema/cursor_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_thread_connect_attr.cc b/storage/perfschema/cursor_by_thread_connect_attr.cc
index f87ce7059fb..877056074f6 100644
--- a/storage/perfschema/cursor_by_thread_connect_attr.cc
+++ b/storage/perfschema/cursor_by_thread_connect_attr.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_thread_connect_attr.h b/storage/perfschema/cursor_by_thread_connect_attr.h
index 4a18bdc5b7a..aa1b63ad51e 100644
--- a/storage/perfschema/cursor_by_thread_connect_attr.h
+++ b/storage/perfschema/cursor_by_thread_connect_attr.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_user.cc b/storage/perfschema/cursor_by_user.cc
index 4300f61f04f..9778e240b8c 100644
--- a/storage/perfschema/cursor_by_user.cc
+++ b/storage/perfschema/cursor_by_user.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/cursor_by_user.h b/storage/perfschema/cursor_by_user.h
index 1bbb06d2c18..ca4fef9209c 100644
--- a/storage/perfschema/cursor_by_user.h
+++ b/storage/perfschema/cursor_by_user.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index c0fa80b8e0d..982876216aa 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -444,6 +444,53 @@ THR_LOCK_DATA **ha_perfschema::store_lock(THD *thd,
int ha_perfschema::delete_table(const char *name)
{
DBUG_ENTER("ha_perfschema::delete_table");
+
+ /*
+ The name string looks like:
+ "./performance_schema/processlist"
+
+ Make a copy of it, parse the '/' to
+ isolate the schema and table name.
+ */
+
+ char table_path[FN_REFLEN+1];
+ strncpy(table_path, name, sizeof(table_path));
+ table_path[FN_REFLEN]='\0';
+
+ char *ptr;
+ char *table_name;
+ char *db_name;
+ const PFS_engine_table_share *share;
+
+ /* Start scan from the end. */
+ ptr = strend(table_path) - 1;
+
+ /* Find path separator */
+ while ((ptr >= table_path) && (*ptr != '\\') && (*ptr != '/')) {
+ ptr--;
+ }
+
+ table_name = ptr + 1;
+ *ptr = '\0';
+
+ /* Find path separator */
+ while ((ptr >= table_path) && (*ptr != '\\') && (*ptr != '/')) {
+ ptr--;
+ }
+
+ db_name = ptr + 1;
+
+ share = find_table_share(db_name, table_name);
+ if (share != NULL) {
+ if (share->m_optional) {
+ /*
+ An optional table is deleted,
+ disarm the checked flag so we don't trust it any more.
+ */
+ share->m_state->m_checked = false;
+ }
+ }
+
DBUG_RETURN(0);
}
diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h
index f3d84a3e264..eab97434265 100644
--- a/storage/perfschema/ha_perfschema.h
+++ b/storage/perfschema/ha_perfschema.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc
index 4e3d4f551a0..244b11a30fc 100644
--- a/storage/perfschema/pfs.cc
+++ b/storage/perfschema/pfs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -2571,6 +2571,16 @@ void pfs_set_thread_v1(PSI_thread* thread)
/**
Implementation of the thread instrumentation interface.
+*/
+void pfs_set_thread_peer_port_v1(PSI_thread *thread, uint port) {
+ PFS_thread *pfs = reinterpret_cast<PFS_thread *>(thread);
+ if (likely(pfs != NULL)) {
+ pfs->m_peer_port = port;
+ }
+}
+
+/**
+ Implementation of the thread instrumentation interface.
@sa PSI_v1::delete_current_thread.
*/
void pfs_delete_current_thread_v1(void)
@@ -7136,7 +7146,8 @@ PSI_v1 PFS_v1=
pfs_set_metadata_lock_status_v1,
pfs_destroy_metadata_lock_v1,
pfs_start_metadata_wait_v1,
- pfs_end_metadata_wait_v1
+ pfs_end_metadata_wait_v1,
+ pfs_set_thread_peer_port_v1
};
static void* get_interface(int version)
diff --git a/storage/perfschema/pfs.h b/storage/perfschema/pfs.h
index 3525f27724f..94d349a5fd2 100644
--- a/storage/perfschema/pfs.h
+++ b/storage/perfschema/pfs.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_account.cc b/storage/perfschema/pfs_account.cc
index abf31a6bc55..53a45bcfd9b 100644
--- a/storage/perfschema/pfs_account.cc
+++ b/storage/perfschema/pfs_account.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -527,30 +527,18 @@ void PFS_account::aggregate_memory(bool alive, PFS_user *safe_user, PFS_host *sa
void PFS_account::aggregate_status(PFS_user *safe_user, PFS_host *safe_host)
{
- if (likely(safe_user != NULL && safe_host != NULL))
- {
- /*
- Aggregate STATUS_BY_ACCOUNT to:
- - STATUS_BY_USER
- - STATUS_BY_HOST
- */
- safe_user->m_status_stats.aggregate(& m_status_stats);
- safe_host->m_status_stats.aggregate(& m_status_stats);
- m_status_stats.reset();
- return;
- }
+ /*
+ Never aggregate to global_status_var,
+ because of the parallel THD -> global_status_var flow.
+ */
if (safe_user != NULL)
{
/*
Aggregate STATUS_BY_ACCOUNT to:
- STATUS_BY_USER
- - GLOBAL_STATUS
*/
safe_user->m_status_stats.aggregate(& m_status_stats);
- //m_status_stats.aggregate_to(& global_status_var);
- m_status_stats.reset();
- return;
}
if (safe_host != NULL)
@@ -560,15 +548,8 @@ void PFS_account::aggregate_status(PFS_user *safe_user, PFS_host *safe_host)
- STATUS_BY_HOST
*/
safe_host->m_status_stats.aggregate(& m_status_stats);
- m_status_stats.reset();
- return;
}
- /*
- Aggregate STATUS_BY_ACCOUNT to:
- - GLOBAL_STATUS
- */
- //m_status_stats.aggregate_to(& global_status_var);
m_status_stats.reset();
return;
}
diff --git a/storage/perfschema/pfs_account.h b/storage/perfschema/pfs_account.h
index c98ff5d2740..196f3595082 100644
--- a/storage/perfschema/pfs_account.h
+++ b/storage/perfschema/pfs_account.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_atomic.h b/storage/perfschema/pfs_atomic.h
index 52c96527c3f..54c4cba163c 100644
--- a/storage/perfschema/pfs_atomic.h
+++ b/storage/perfschema/pfs_atomic.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2009, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_autosize.cc b/storage/perfschema/pfs_autosize.cc
index 65d0458220a..d418ea594e2 100644
--- a/storage/perfschema/pfs_autosize.cc
+++ b/storage/perfschema/pfs_autosize.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_buffer_container.cc b/storage/perfschema/pfs_buffer_container.cc
index 7d1d74541d1..dfae6e0ad2e 100644
--- a/storage/perfschema/pfs_buffer_container.cc
+++ b/storage/perfschema/pfs_buffer_container.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_buffer_container.h b/storage/perfschema/pfs_buffer_container.h
index 5baed2f872c..0f856ceee86 100644
--- a/storage/perfschema/pfs_buffer_container.h
+++ b/storage/perfschema/pfs_buffer_container.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_builtin_memory.cc b/storage/perfschema/pfs_builtin_memory.cc
index 354de87f05f..60e97451852 100644
--- a/storage/perfschema/pfs_builtin_memory.cc
+++ b/storage/perfschema/pfs_builtin_memory.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_builtin_memory.h b/storage/perfschema/pfs_builtin_memory.h
index 2c9da9dd4a0..c0f0aa86c45 100644
--- a/storage/perfschema/pfs_builtin_memory.h
+++ b/storage/perfschema/pfs_builtin_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_column_types.h b/storage/perfschema/pfs_column_types.h
index 146c9c8054e..1985c6ea719 100644
--- a/storage/perfschema/pfs_column_types.h
+++ b/storage/perfschema/pfs_column_types.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_column_values.cc b/storage/perfschema/pfs_column_values.cc
index 02c939d4274..fe3d16df21c 100644
--- a/storage/perfschema/pfs_column_values.cc
+++ b/storage/perfschema/pfs_column_values.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_column_values.h b/storage/perfschema/pfs_column_values.h
index b06f7a0130b..e3f36512ef5 100644
--- a/storage/perfschema/pfs_column_values.h
+++ b/storage/perfschema/pfs_column_values.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_con_slice.cc b/storage/perfschema/pfs_con_slice.cc
index eaa65d524ba..9a3e2a60929 100644
--- a/storage/perfschema/pfs_con_slice.cc
+++ b/storage/perfschema/pfs_con_slice.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_con_slice.h b/storage/perfschema/pfs_con_slice.h
index f28c40f884c..d71e9f5a90a 100644
--- a/storage/perfschema/pfs_con_slice.h
+++ b/storage/perfschema/pfs_con_slice.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_defaults.cc b/storage/perfschema/pfs_defaults.cc
index 522beb890eb..d5c415a5f77 100644
--- a/storage/perfschema/pfs_defaults.cc
+++ b/storage/perfschema/pfs_defaults.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_defaults.h b/storage/perfschema/pfs_defaults.h
index 34ac1b0955a..0225010f8b3 100644
--- a/storage/perfschema/pfs_defaults.h
+++ b/storage/perfschema/pfs_defaults.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_digest.cc b/storage/perfschema/pfs_digest.cc
index 0dff583fa6d..0cb1b023a3e 100644
--- a/storage/perfschema/pfs_digest.cc
+++ b/storage/perfschema/pfs_digest.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_digest.h b/storage/perfschema/pfs_digest.h
index e99bdfebf57..6611cfbfd76 100644
--- a/storage/perfschema/pfs_digest.h
+++ b/storage/perfschema/pfs_digest.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc
index 71a058273f7..d8646938bdb 100644
--- a/storage/perfschema/pfs_engine_table.cc
+++ b/storage/perfschema/pfs_engine_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -48,6 +48,7 @@
#include "table_file_summary_by_instance.h"
#include "table_file_summary_by_event_name.h"
#include "table_threads.h"
+//#include "table_processlist.h"
#include "table_ews_by_host_by_event_name.h"
#include "table_ews_by_user_by_event_name.h"
@@ -333,9 +334,27 @@ static PFS_engine_table_share *all_shares[]=
//&table_global_variables::m_share,
//&table_session_variables::m_share,
+ //&table_processlist::m_share,
+
NULL
};
+/** Error reporting for schema integrity checks. */
+class PFS_silent_check_intact : public Table_check_intact
+{
+protected:
+ virtual void report_error(uint code, const char *fmt, ...) {}
+
+public:
+ PFS_silent_check_intact()
+ {}
+
+ ~PFS_silent_check_intact()
+ {}
+};
+
+
+
/** Initialize all the table share locks. */
void PFS_engine_table_share::init_all_locks(void)
{
@@ -770,6 +789,33 @@ PFS_readonly_world_acl::check(privilege_t want_access, privilege_t *save_priv) c
return res;
}
+PFS_readonly_processlist_acl pfs_readonly_processlist_acl;
+
+ACL_internal_access_result PFS_readonly_processlist_acl::check(
+ privilege_t want_access, privilege_t *save_priv) const {
+ ACL_internal_access_result res =
+ PFS_readonly_acl::check(want_access, save_priv);
+
+ if ((res == ACL_INTERNAL_ACCESS_CHECK_GRANT) && (want_access == SELECT_ACL)) {
+ THD *thd = current_thd;
+ if (thd != NULL) {
+ if (thd->lex->sql_command == SQLCOM_SHOW_PROCESSLIST ||
+ thd->lex->sql_command == SQLCOM_SELECT) {
+ /*
+ For compatibility with the historical
+ SHOW PROCESSLIST command,
+ SHOW PROCESSLIST does not require a
+ SELECT privilege on table performance_schema.processlist,
+ when rewriting the query using table processlist.
+ */
+ return ACL_INTERNAL_ACCESS_GRANTED;
+ }
+ }
+ }
+
+ return res;
+}
+
PFS_truncatable_acl pfs_truncatable_acl;
diff --git a/storage/perfschema/pfs_engine_table.h b/storage/perfschema/pfs_engine_table.h
index 925a2186a92..6280a3799b3 100644
--- a/storage/perfschema/pfs_engine_table.h
+++ b/storage/perfschema/pfs_engine_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -286,6 +286,11 @@ typedef int (*pfs_delete_all_rows_t)(void);
/** Callback to get a row count. */
typedef ha_rows (*pfs_get_row_count_t)(void);
+struct PFS_engine_table_share_state {
+ /** Schema integrity flag. */
+ bool m_checked;
+};
+
/**
A PERFORMANCE_SCHEMA table share.
This data is shared by all the table handles opened on the same table.
@@ -319,6 +324,10 @@ struct PFS_engine_table_share
LEX_STRING sql;
/** Table is available even if the Performance Schema is disabled. */
bool m_perpetual;
+ /** Table is optional. */
+ bool m_optional;
+ /** Dynamic state. */
+ PFS_engine_table_share_state *m_state;
};
/**
@@ -354,7 +363,7 @@ public:
~PFS_truncatable_acl()
{}
- ACL_internal_access_result check(privilege_t want_access,
+ virtual ACL_internal_access_result check(privilege_t want_access,
privilege_t *save_priv) const;
};
@@ -459,6 +468,25 @@ public:
extern PFS_truncatable_world_acl pfs_truncatable_world_acl;
+/**
+ Privileges for readable processlist tables.
+*/
+class PFS_readonly_processlist_acl : public PFS_readonly_acl {
+ public:
+ PFS_readonly_processlist_acl()
+ {}
+
+ ~PFS_readonly_processlist_acl()
+ {}
+
+ virtual ACL_internal_access_result check(privilege_t want_access,
+ privilege_t *save_priv) const;
+};
+
+/** Singleton instance of PFS_readonly_processlist_acl */
+extern PFS_readonly_processlist_acl pfs_readonly_processlist_acl;
+
+
/** Position of a cursor, for simple iterations. */
struct PFS_simple_index
{
diff --git a/storage/perfschema/pfs_events.h b/storage/perfschema/pfs_events.h
index fbe65d6ebad..41175596cf6 100644
--- a/storage/perfschema/pfs_events.h
+++ b/storage/perfschema/pfs_events.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_stages.cc b/storage/perfschema/pfs_events_stages.cc
index 087e5a1c55f..2e3ad4af786 100644
--- a/storage/perfschema/pfs_events_stages.cc
+++ b/storage/perfschema/pfs_events_stages.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_stages.h b/storage/perfschema/pfs_events_stages.h
index 0fa7bc8de51..ff85f568c0f 100644
--- a/storage/perfschema/pfs_events_stages.h
+++ b/storage/perfschema/pfs_events_stages.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_events_statements.cc b/storage/perfschema/pfs_events_statements.cc
index 37b179e8924..c0f1809a2f3 100644
--- a/storage/perfschema/pfs_events_statements.cc
+++ b/storage/perfschema/pfs_events_statements.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_statements.h b/storage/perfschema/pfs_events_statements.h
index b03afb8a768..d0655ad574e 100644
--- a/storage/perfschema/pfs_events_statements.h
+++ b/storage/perfschema/pfs_events_statements.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_events_transactions.cc b/storage/perfschema/pfs_events_transactions.cc
index 8b83b71c96b..6f6b1a4cbc6 100644
--- a/storage/perfschema/pfs_events_transactions.cc
+++ b/storage/perfschema/pfs_events_transactions.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_transactions.h b/storage/perfschema/pfs_events_transactions.h
index 57e57e70210..46d42b1e121 100644
--- a/storage/perfschema/pfs_events_transactions.h
+++ b/storage/perfschema/pfs_events_transactions.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_waits.cc b/storage/perfschema/pfs_events_waits.cc
index 14f6d743764..0462c2cf9ef 100644
--- a/storage/perfschema/pfs_events_waits.cc
+++ b/storage/perfschema/pfs_events_waits.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_events_waits.h b/storage/perfschema/pfs_events_waits.h
index ad992b4b0bd..034d0f5c740 100644
--- a/storage/perfschema/pfs_events_waits.h
+++ b/storage/perfschema/pfs_events_waits.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates..
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates..
Copyright (c) 2017, 2012, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_global.cc b/storage/perfschema/pfs_global.cc
index e87941448a6..ccb43369907 100644
--- a/storage/perfschema/pfs_global.cc
+++ b/storage/perfschema/pfs_global.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights
reserved.
Copyright (c) 2022, MariaDB Corporation.
diff --git a/storage/perfschema/pfs_global.h b/storage/perfschema/pfs_global.h
index 6bce7c347cf..243d67bbb86 100644
--- a/storage/perfschema/pfs_global.h
+++ b/storage/perfschema/pfs_global.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_host.cc b/storage/perfschema/pfs_host.cc
index cbd97e69041..ca049054133 100644
--- a/storage/perfschema/pfs_host.cc
+++ b/storage/perfschema/pfs_host.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_host.h b/storage/perfschema/pfs_host.h
index 71ef0d7f5ad..d05c37bfd01 100644
--- a/storage/perfschema/pfs_host.h
+++ b/storage/perfschema/pfs_host.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc
index a2fcaa9222c..0a7c8f8ffc9 100644
--- a/storage/perfschema/pfs_instr.cc
+++ b/storage/perfschema/pfs_instr.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
@@ -577,6 +577,8 @@ PFS_thread* create_thread(PFS_thread_class *klass, const void *identity,
pfs->m_account= NULL;
set_thread_account(pfs);
+ pfs->m_peer_port = 0;
+
/*
For child waits, by default,
- NESTING_EVENT_ID is NULL
diff --git a/storage/perfschema/pfs_instr.h b/storage/perfschema/pfs_instr.h
index e09cc7a1cf0..b9f31e63636 100644
--- a/storage/perfschema/pfs_instr.h
+++ b/storage/perfschema/pfs_instr.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -609,6 +609,9 @@ struct PFS_ALIGNED PFS_thread : PFS_connection_slice
PFS_user *m_user;
PFS_account *m_account;
+ /** Remote (peer) port */
+ uint m_peer_port;
+
/** Reset session connect attributes */
void reset_session_connect_attrs();
diff --git a/storage/perfschema/pfs_instr_class.cc b/storage/perfschema/pfs_instr_class.cc
index 971ee7ca00f..2a6be8be6d4 100644
--- a/storage/perfschema/pfs_instr_class.cc
+++ b/storage/perfschema/pfs_instr_class.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
Copyright (c) 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_instr_class.h b/storage/perfschema/pfs_instr_class.h
index b8ff8497241..c3f83c45b7e 100644
--- a/storage/perfschema/pfs_instr_class.h
+++ b/storage/perfschema/pfs_instr_class.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -246,6 +246,9 @@ struct PFS_ALIGNED PFS_thread_class
char m_name[PFS_MAX_INFO_NAME_LENGTH];
/** Length in bytes of @c m_name. */
uint m_name_length;
+ /** Instrument flags. */
+ int m_flags;
+ bool is_system_thread() const { return m_flags & PSI_FLAG_THREAD_SYSTEM; }
};
#define PFS_TABLESHARE_HASHKEY_SIZE (NAME_LEN + 1 + NAME_LEN + 1)
diff --git a/storage/perfschema/pfs_lock.h b/storage/perfschema/pfs_lock.h
index 4c1674c5e67..ae90ebd0784 100644
--- a/storage/perfschema/pfs_lock.h
+++ b/storage/perfschema/pfs_lock.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2009, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_memory.cc b/storage/perfschema/pfs_memory.cc
index d2185ecc648..4b4b14fc186 100644
--- a/storage/perfschema/pfs_memory.cc
+++ b/storage/perfschema/pfs_memory.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_memory.h b/storage/perfschema/pfs_memory.h
index a3e753656ce..085f8af8bad 100644
--- a/storage/perfschema/pfs_memory.h
+++ b/storage/perfschema/pfs_memory.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_prepared_stmt.cc b/storage/perfschema/pfs_prepared_stmt.cc
index ccb49f3290d..e0e10553680 100644
--- a/storage/perfschema/pfs_prepared_stmt.cc
+++ b/storage/perfschema/pfs_prepared_stmt.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_prepared_stmt.h b/storage/perfschema/pfs_prepared_stmt.h
index 1014d9c6af6..d89ad80cbd8 100644
--- a/storage/perfschema/pfs_prepared_stmt.h
+++ b/storage/perfschema/pfs_prepared_stmt.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_program.cc b/storage/perfschema/pfs_program.cc
index 00b8082ec53..9bd9f06b22c 100644
--- a/storage/perfschema/pfs_program.cc
+++ b/storage/perfschema/pfs_program.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_program.h b/storage/perfschema/pfs_program.h
index a34f533d444..56abcee97f7 100644
--- a/storage/perfschema/pfs_program.h
+++ b/storage/perfschema/pfs_program.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_server.cc b/storage/perfschema/pfs_server.cc
index 0a97f05c54a..f5b1bf9c03f 100644
--- a/storage/perfschema/pfs_server.cc
+++ b/storage/perfschema/pfs_server.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_server.h b/storage/perfschema/pfs_server.h
index c1ebb531a85..d87d48ac19b 100644
--- a/storage/perfschema/pfs_server.h
+++ b/storage/perfschema/pfs_server.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_setup_actor.cc b/storage/perfschema/pfs_setup_actor.cc
index 6e066e34231..ca45547d6ee 100644
--- a/storage/perfschema/pfs_setup_actor.cc
+++ b/storage/perfschema/pfs_setup_actor.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_setup_actor.h b/storage/perfschema/pfs_setup_actor.h
index 3570748085a..ede8f6c4b4e 100644
--- a/storage/perfschema/pfs_setup_actor.h
+++ b/storage/perfschema/pfs_setup_actor.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_setup_object.cc b/storage/perfschema/pfs_setup_object.cc
index 540f2c74936..64a54e9369a 100644
--- a/storage/perfschema/pfs_setup_object.cc
+++ b/storage/perfschema/pfs_setup_object.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_setup_object.h b/storage/perfschema/pfs_setup_object.h
index 63e275385b1..259c3dc8340 100644
--- a/storage/perfschema/pfs_setup_object.h
+++ b/storage/perfschema/pfs_setup_object.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_stat.h b/storage/perfschema/pfs_stat.h
index f266267f4cd..1349b7ba4df 100644
--- a/storage/perfschema/pfs_stat.h
+++ b/storage/perfschema/pfs_stat.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_status.cc b/storage/perfschema/pfs_status.cc
index 50f361db083..62aed2e8de9 100644
--- a/storage/perfschema/pfs_status.cc
+++ b/storage/perfschema/pfs_status.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_status.h b/storage/perfschema/pfs_status.h
index b29791420ad..a415fcc4704 100644
--- a/storage/perfschema/pfs_status.h
+++ b/storage/perfschema/pfs_status.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_timer.cc b/storage/perfschema/pfs_timer.cc
index c5a0bdf2262..505e49de968 100644
--- a/storage/perfschema/pfs_timer.cc
+++ b/storage/perfschema/pfs_timer.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_timer.h b/storage/perfschema/pfs_timer.h
index e9387c110ee..6218bc603d8 100644
--- a/storage/perfschema/pfs_timer.h
+++ b/storage/perfschema/pfs_timer.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_user.cc b/storage/perfschema/pfs_user.cc
index d7dfda4efc2..bd5fc3eadce 100644
--- a/storage/perfschema/pfs_user.cc
+++ b/storage/perfschema/pfs_user.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_user.h b/storage/perfschema/pfs_user.h
index 58c95ad720e..acffaf9a724 100644
--- a/storage/perfschema/pfs_user.h
+++ b/storage/perfschema/pfs_user.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_variable.cc b/storage/perfschema/pfs_variable.cc
index 17b7dfc200c..982409baf82 100644
--- a/storage/perfschema/pfs_variable.cc
+++ b/storage/perfschema/pfs_variable.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
Copyright (c) 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/pfs_variable.h b/storage/perfschema/pfs_variable.h
index e59b02f2af8..948baf4e3b8 100644
--- a/storage/perfschema/pfs_variable.h
+++ b/storage/perfschema/pfs_variable.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_visitor.cc b/storage/perfschema/pfs_visitor.cc
index 52e0d6871f3..4cb0673f1b2 100644
--- a/storage/perfschema/pfs_visitor.cc
+++ b/storage/perfschema/pfs_visitor.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/pfs_visitor.h b/storage/perfschema/pfs_visitor.h
index ebedae6e7f0..4644888ea33 100644
--- a/storage/perfschema/pfs_visitor.h
+++ b/storage/perfschema/pfs_visitor.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_accounts.cc b/storage/perfschema/table_accounts.cc
index 34dd49017a9..fcf636b8e3e 100644
--- a/storage/perfschema/table_accounts.cc
+++ b/storage/perfschema/table_accounts.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -33,6 +33,12 @@
THR_LOCK table_accounts::m_table_lock;
+
+PFS_engine_table_share_state
+table_accounts::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_accounts::m_share=
{
@@ -49,7 +55,9 @@ table_accounts::m_share=
"HOST CHAR(" HOSTNAME_LENGTH_STR ") collate utf8_bin default null comment 'The connection client''s host name, or NULL if an internal thread.',"
"CURRENT_CONNECTIONS bigint not null comment 'Current connections for the account.',"
"TOTAL_CONNECTIONS bigint not null comment 'Total connections for the account.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_accounts::create()
diff --git a/storage/perfschema/table_accounts.h b/storage/perfschema/table_accounts.h
index c3c62f77924..f44d05b2700 100644
--- a/storage/perfschema/table_accounts.h
+++ b/storage/perfschema/table_accounts.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -49,6 +49,7 @@ struct row_accounts
class table_accounts : public cursor_by_account
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
/** Table builder */
diff --git a/storage/perfschema/table_all_instr.cc b/storage/perfschema/table_all_instr.cc
index 6a01912a3a0..c4d05cf13f0 100644
--- a/storage/perfschema/table_all_instr.cc
+++ b/storage/perfschema/table_all_instr.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_all_instr.h b/storage/perfschema/table_all_instr.h
index ea52f5d2de2..7dfb27c6032 100644
--- a/storage/perfschema/table_all_instr.h
+++ b/storage/perfschema/table_all_instr.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.cc b/storage/perfschema/table_esgs_by_account_by_event_name.cc
index d6c97ac3edf..cfc325f352e 100644
--- a/storage/perfschema/table_esgs_by_account_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,12 @@
THR_LOCK table_esgs_by_account_by_event_name::m_table_lock;
+
+PFS_engine_table_share_state
+table_esgs_by_account_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esgs_by_account_by_event_name::m_share=
{
@@ -58,7 +64,9 @@ table_esgs_by_account_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the timed summarized events.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the timed summarized events.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the timed summarized events.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.h b/storage/perfschema/table_esgs_by_account_by_event_name.h
index f19241a4d7b..dd805f4d038 100644
--- a/storage/perfschema/table_esgs_by_account_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -84,6 +84,7 @@ struct pos_esgs_by_account_by_event_name
class table_esgs_by_account_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.cc b/storage/perfschema/table_esgs_by_host_by_event_name.cc
index bf219705513..2a3e72353b6 100644
--- a/storage/perfschema/table_esgs_by_host_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_esgs_by_host_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esgs_by_host_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esgs_by_host_by_event_name::m_share=
{
@@ -58,7 +63,9 @@ table_esgs_by_host_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the timed summarized events.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the timed summarized events.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the timed summarized events.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.h b/storage/perfschema/table_esgs_by_host_by_event_name.h
index 71592834d9a..674b6bfb883 100644
--- a/storage/perfschema/table_esgs_by_host_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -84,6 +84,7 @@ struct pos_esgs_by_host_by_event_name
class table_esgs_by_host_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esgs_by_thread_by_event_name.cc b/storage/perfschema/table_esgs_by_thread_by_event_name.cc
index f6568655e51..69111680704 100644
--- a/storage/perfschema/table_esgs_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_esgs_by_thread_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esgs_by_thread_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esgs_by_thread_by_event_name::m_share=
{
@@ -57,7 +62,9 @@ table_esgs_by_thread_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the timed summarized events.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the timed summarized events.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the timed summarized events.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_by_thread_by_event_name.h b/storage/perfschema/table_esgs_by_thread_by_event_name.h
index e5c30363704..d009aabbdfc 100644
--- a/storage/perfschema/table_esgs_by_thread_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_thread_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -88,6 +88,7 @@ struct pos_esgs_by_thread_by_event_name
class table_esgs_by_thread_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.cc b/storage/perfschema/table_esgs_by_user_by_event_name.cc
index ecec4e08425..d8b6af382a3 100644
--- a/storage/perfschema/table_esgs_by_user_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_esgs_by_user_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esgs_by_user_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esgs_by_user_by_event_name::m_share=
{
@@ -57,7 +62,9 @@ table_esgs_by_user_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the timed summarized events.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the timed summarized events.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the timed summarized events.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.h b/storage/perfschema/table_esgs_by_user_by_event_name.h
index 895840fc476..a62578ca9b6 100644
--- a/storage/perfschema/table_esgs_by_user_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -89,6 +89,7 @@ struct pos_esgs_by_user_by_event_name
class table_esgs_by_user_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esgs_global_by_event_name.cc b/storage/perfschema/table_esgs_global_by_event_name.cc
index fe24d6794c1..288891861c9 100644
--- a/storage/perfschema/table_esgs_global_by_event_name.cc
+++ b/storage/perfschema/table_esgs_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_esgs_global_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esgs_global_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esgs_global_by_event_name::m_share=
{
@@ -57,7 +62,9 @@ table_esgs_global_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the timed summarized events.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the timed summarized events.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the timed summarized events.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esgs_global_by_event_name.h b/storage/perfschema/table_esgs_global_by_event_name.h
index f2e51f625c7..ab70e8303ca 100644
--- a/storage/perfschema/table_esgs_global_by_event_name.h
+++ b/storage/perfschema/table_esgs_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -55,6 +55,7 @@ struct row_esgs_global_by_event_name
class table_esgs_global_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esms_by_account_by_event_name.cc b/storage/perfschema/table_esms_by_account_by_event_name.cc
index 9756bc3c70b..a1805170332 100644
--- a/storage/perfschema/table_esms_by_account_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_esms_by_account_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esms_by_account_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esms_by_account_by_event_name::m_share=
{
@@ -77,7 +82,9 @@ table_esms_by_account_by_event_name::m_share=
"SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
"SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
"SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_account_by_event_name.h b/storage/perfschema/table_esms_by_account_by_event_name.h
index e5f17ee1113..1afe7cb09df 100644
--- a/storage/perfschema/table_esms_by_account_by_event_name.h
+++ b/storage/perfschema/table_esms_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -84,6 +84,7 @@ struct pos_esms_by_account_by_event_name
class table_esms_by_account_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esms_by_digest.cc b/storage/perfschema/table_esms_by_digest.cc
index c27e3372562..6a3f2bf3c3c 100644
--- a/storage/perfschema/table_esms_by_digest.cc
+++ b/storage/perfschema/table_esms_by_digest.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -41,6 +41,11 @@
THR_LOCK table_esms_by_digest::m_table_lock;
+PFS_engine_table_share_state
+table_esms_by_digest::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esms_by_digest::m_share=
{
@@ -82,7 +87,9 @@ table_esms_by_digest::m_share=
"SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.',"
"FIRST_SEEN TIMESTAMP(0) NOT NULL default 0 comment 'Time at which the digest was first seen.',"
"LAST_SEEN TIMESTAMP(0) NOT NULL default 0 comment 'Time at which the digest was most recently seen.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_digest.h b/storage/perfschema/table_esms_by_digest.h
index 7b84cdd6429..27b916e66ac 100644
--- a/storage/perfschema/table_esms_by_digest.h
+++ b/storage/perfschema/table_esms_by_digest.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -58,6 +58,7 @@ struct row_esms_by_digest
class table_esms_by_digest : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esms_by_host_by_event_name.cc b/storage/perfschema/table_esms_by_host_by_event_name.cc
index ac6a584965f..3e7355fef80 100644
--- a/storage/perfschema/table_esms_by_host_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_esms_by_host_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esms_by_host_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esms_by_host_by_event_name::m_share=
{
@@ -77,7 +82,9 @@ table_esms_by_host_by_event_name::m_share=
"SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
"SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
"SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_host_by_event_name.h b/storage/perfschema/table_esms_by_host_by_event_name.h
index 54237b1deb5..2c47d4302b6 100644
--- a/storage/perfschema/table_esms_by_host_by_event_name.h
+++ b/storage/perfschema/table_esms_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -84,6 +84,7 @@ struct pos_esms_by_host_by_event_name
class table_esms_by_host_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esms_by_program.cc b/storage/perfschema/table_esms_by_program.cc
index 5a4dab759cd..ab3e1a440b8 100644
--- a/storage/perfschema/table_esms_by_program.cc
+++ b/storage/perfschema/table_esms_by_program.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -41,6 +41,11 @@
THR_LOCK table_esms_by_program::m_table_lock;
+PFS_engine_table_share_state
+table_esms_by_program::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esms_by_program::m_share=
{
@@ -85,7 +90,9 @@ table_esms_by_program::m_share=
"SUM_SORT_SCAN bigint(20) unsigned NOT NULL comment 'The total number of sorts that were done by scanning the table by the summarized statements.',"
"SUM_NO_INDEX_USED bigint(20) unsigned NOT NULL comment 'The total number of statements that performed a table scan without using an index.',"
"SUM_NO_GOOD_INDEX_USED bigint(20) unsigned NOT NULL comment 'The total number of statements where no good index was found.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_program.h b/storage/perfschema/table_esms_by_program.h
index fdafb655918..a9aa47c2300 100644
--- a/storage/perfschema/table_esms_by_program.h
+++ b/storage/perfschema/table_esms_by_program.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -68,6 +68,7 @@ struct row_esms_by_program
class table_esms_by_program : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.cc b/storage/perfschema/table_esms_by_thread_by_event_name.cc
index eb38c3e5687..ad22fa3c63f 100644
--- a/storage/perfschema/table_esms_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_esms_by_thread_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esms_by_thread_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esms_by_thread_by_event_name::m_share=
{
@@ -76,7 +81,9 @@ table_esms_by_thread_by_event_name::m_share=
"SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
"SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
"SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.h b/storage/perfschema/table_esms_by_thread_by_event_name.h
index 9a0818291b9..e4100c076f6 100644
--- a/storage/perfschema/table_esms_by_thread_by_event_name.h
+++ b/storage/perfschema/table_esms_by_thread_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -88,6 +88,7 @@ struct pos_esms_by_thread_by_event_name
class table_esms_by_thread_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esms_by_user_by_event_name.cc b/storage/perfschema/table_esms_by_user_by_event_name.cc
index a0efa66c177..82479d329b3 100644
--- a/storage/perfschema/table_esms_by_user_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_esms_by_user_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esms_by_user_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esms_by_user_by_event_name::m_share=
{
@@ -76,7 +81,9 @@ table_esms_by_user_by_event_name::m_share=
"SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
"SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
"SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_by_user_by_event_name.h b/storage/perfschema/table_esms_by_user_by_event_name.h
index 51762be4143..85399b18622 100644
--- a/storage/perfschema/table_esms_by_user_by_event_name.h
+++ b/storage/perfschema/table_esms_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -84,6 +84,7 @@ struct pos_esms_by_user_by_event_name
class table_esms_by_user_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_esms_global_by_event_name.cc b/storage/perfschema/table_esms_global_by_event_name.cc
index f889df11b5a..cde0ef5deee 100644
--- a/storage/perfschema/table_esms_global_by_event_name.cc
+++ b/storage/perfschema/table_esms_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_esms_global_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_esms_global_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_esms_global_by_event_name::m_share=
{
@@ -76,7 +81,9 @@ table_esms_global_by_event_name::m_share=
"SUM_SORT_SCAN BIGINT unsigned not null comment 'Sum of the SORT_SCAN column in the events_statements_current table.',"
"SUM_NO_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_INDEX_USED column in the events_statements_current table.',"
"SUM_NO_GOOD_INDEX_USED BIGINT unsigned not null comment 'Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_esms_global_by_event_name.h b/storage/perfschema/table_esms_global_by_event_name.h
index c4a32da11bf..780c7fa6e4f 100644
--- a/storage/perfschema/table_esms_global_by_event_name.h
+++ b/storage/perfschema/table_esms_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -55,6 +55,7 @@ struct row_esms_global_by_event_name
class table_esms_global_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ets_by_account_by_event_name.cc b/storage/perfschema/table_ets_by_account_by_event_name.cc
index 9d323eb78d9..95746b57e5a 100644
--- a/storage/perfschema/table_ets_by_account_by_event_name.cc
+++ b/storage/perfschema/table_ets_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_ets_by_account_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ets_by_account_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ets_by_account_by_event_name::m_share=
{
@@ -68,7 +73,9 @@ table_ets_by_account_by_event_name::m_share=
"MIN_TIMER_READ_ONLY BIGINT unsigned not null comment 'The minimum wait time of only READ ONLY transaction events.',"
"AVG_TIMER_READ_ONLY BIGINT unsigned not null comment 'The average wait time of only READ ONLY transaction events.',"
"MAX_TIMER_READ_ONLY BIGINT unsigned not null comment 'The maximum wait time of only READ ONLY transaction events.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ets_by_account_by_event_name.h b/storage/perfschema/table_ets_by_account_by_event_name.h
index 3399c27d6e4..e227db2e08e 100644
--- a/storage/perfschema/table_ets_by_account_by_event_name.h
+++ b/storage/perfschema/table_ets_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -88,6 +88,7 @@ struct pos_ets_by_account_by_event_name
class table_ets_by_account_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ets_by_host_by_event_name.cc b/storage/perfschema/table_ets_by_host_by_event_name.cc
index 6ca2cfad81a..5b89e9cbfd2 100644
--- a/storage/perfschema/table_ets_by_host_by_event_name.cc
+++ b/storage/perfschema/table_ets_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_ets_by_host_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ets_by_host_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ets_by_host_by_event_name::m_share=
{
@@ -68,7 +73,9 @@ table_ets_by_host_by_event_name::m_share=
"MIN_TIMER_READ_ONLY BIGINT unsigned not null comment 'The minimum wait time of only READ ONLY transaction events.',"
"AVG_TIMER_READ_ONLY BIGINT unsigned not null comment 'The average wait time of only READ ONLY transaction events.',"
"MAX_TIMER_READ_ONLY BIGINT unsigned not null comment 'The maximum wait time of only READ ONLY transaction events.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ets_by_host_by_event_name.h b/storage/perfschema/table_ets_by_host_by_event_name.h
index 2188f385701..add2d1a32a6 100644
--- a/storage/perfschema/table_ets_by_host_by_event_name.h
+++ b/storage/perfschema/table_ets_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -88,6 +88,7 @@ struct pos_ets_by_host_by_event_name
class table_ets_by_host_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ets_by_thread_by_event_name.cc b/storage/perfschema/table_ets_by_thread_by_event_name.cc
index 257f37d56ed..1dc876bd293 100644
--- a/storage/perfschema/table_ets_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_ets_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_ets_by_thread_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ets_by_thread_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ets_by_thread_by_event_name::m_share=
{
@@ -67,7 +72,9 @@ table_ets_by_thread_by_event_name::m_share=
"MIN_TIMER_READ_ONLY BIGINT unsigned not null comment 'The minimum wait time of only READ ONLY transaction events.',"
"AVG_TIMER_READ_ONLY BIGINT unsigned not null comment 'The average wait time of only READ ONLY transaction events.',"
"MAX_TIMER_READ_ONLY BIGINT unsigned not null comment 'The maximum wait time of only READ ONLY transaction events.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ets_by_thread_by_event_name.h b/storage/perfschema/table_ets_by_thread_by_event_name.h
index dbfe1fae016..a69e19653ee 100644
--- a/storage/perfschema/table_ets_by_thread_by_event_name.h
+++ b/storage/perfschema/table_ets_by_thread_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -92,6 +92,7 @@ struct pos_ets_by_thread_by_event_name
class table_ets_by_thread_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ets_by_user_by_event_name.cc b/storage/perfschema/table_ets_by_user_by_event_name.cc
index 6b54175b6cc..3883e8c7e69 100644
--- a/storage/perfschema/table_ets_by_user_by_event_name.cc
+++ b/storage/perfschema/table_ets_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_ets_by_user_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ets_by_user_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ets_by_user_by_event_name::m_share=
{
@@ -67,7 +72,9 @@ table_ets_by_user_by_event_name::m_share=
"MIN_TIMER_READ_ONLY BIGINT unsigned not null comment 'The minimum wait time of only READ ONLY transaction events.',"
"AVG_TIMER_READ_ONLY BIGINT unsigned not null comment 'The average wait time of only READ ONLY transaction events.',"
"MAX_TIMER_READ_ONLY BIGINT unsigned not null comment 'The maximum wait time of only READ ONLY transaction events.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ets_by_user_by_event_name.h b/storage/perfschema/table_ets_by_user_by_event_name.h
index 62721ce9adf..fc18a3e94e6 100644
--- a/storage/perfschema/table_ets_by_user_by_event_name.h
+++ b/storage/perfschema/table_ets_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -88,6 +88,7 @@ struct pos_ets_by_user_by_event_name
class table_ets_by_user_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ets_global_by_event_name.cc b/storage/perfschema/table_ets_global_by_event_name.cc
index e08ff15075d..209ecf47aac 100644
--- a/storage/perfschema/table_ets_global_by_event_name.cc
+++ b/storage/perfschema/table_ets_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_ets_global_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ets_global_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ets_global_by_event_name::m_share=
{
@@ -67,7 +72,9 @@ table_ets_global_by_event_name::m_share=
"MIN_TIMER_READ_ONLY BIGINT unsigned not null comment 'The minimum wait time of only READ ONLY transaction events.',"
"AVG_TIMER_READ_ONLY BIGINT unsigned not null comment 'The average wait time of only READ ONLY transaction events.',"
"MAX_TIMER_READ_ONLY BIGINT unsigned not null comment 'The maximum wait time of only READ ONLY transaction events.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ets_global_by_event_name.h b/storage/perfschema/table_ets_global_by_event_name.h
index 717a737f93c..a2136a23210 100644
--- a/storage/perfschema/table_ets_global_by_event_name.h
+++ b/storage/perfschema/table_ets_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -59,6 +59,7 @@ struct row_ets_global_by_event_name
class table_ets_global_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_events_stages.cc b/storage/perfschema/table_events_stages.cc
index 66887d39e5a..e2689ad0ad9 100644
--- a/storage/perfschema/table_events_stages.cc
+++ b/storage/perfschema/table_events_stages.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_events_stages_current::m_table_lock;
+PFS_engine_table_share_state
+table_events_stages_current::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_stages_current::m_share=
{
@@ -61,11 +66,18 @@ table_events_stages_current::m_share=
"WORK_ESTIMATED BIGINT unsigned comment 'The number of work units expected for the stage. NULL if the stage event progress is not instrumented.',"
"NESTING_EVENT_ID BIGINT unsigned comment 'EVENT_ID of event within which this event nests.',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'Nesting event type. Either transaction, statement, stage or wait.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_stages_history::m_table_lock;
+PFS_engine_table_share_state
+table_events_stages_history::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_stages_history::m_share=
{
@@ -90,11 +102,18 @@ table_events_stages_history::m_share=
"WORK_ESTIMATED BIGINT unsigned comment 'The number of work units expected for the stage. NULL if the stage event progress is not instrumented.',"
"NESTING_EVENT_ID BIGINT unsigned comment 'EVENT_ID of event within which this event nests.',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'Nesting event type. Either transaction, statement, stage or wait.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_stages_history_long::m_table_lock;
+PFS_engine_table_share_state
+table_events_stages_history_long::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_stages_history_long::m_share=
{
@@ -119,7 +138,9 @@ table_events_stages_history_long::m_share=
"WORK_ESTIMATED BIGINT unsigned comment 'The number of work units expected for the stage. NULL if the stage event progress is not instrumented.',"
"NESTING_EVENT_ID BIGINT unsigned comment 'EVENT_ID of event within which this event nests.',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'Nesting event type. Either transaction, statement, stage or wait.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
table_events_stages_common::table_events_stages_common
diff --git a/storage/perfschema/table_events_stages.h b/storage/perfschema/table_events_stages.h
index 2fd760cfae3..2ef37c16a11 100644
--- a/storage/perfschema/table_events_stages.h
+++ b/storage/perfschema/table_events_stages.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -122,6 +122,7 @@ protected:
class table_events_stages_current : public table_events_stages_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -157,6 +158,7 @@ private:
class table_events_stages_history : public table_events_stages_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -189,6 +191,7 @@ private:
class table_events_stages_history_long : public table_events_stages_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_events_statements.cc b/storage/perfschema/table_events_statements.cc
index 5e30f39c785..4b27db19ca2 100644
--- a/storage/perfschema/table_events_statements.cc
+++ b/storage/perfschema/table_events_statements.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_events_statements_current::m_table_lock;
+PFS_engine_table_share_state
+table_events_statements_current::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_statements_current::m_share=
{
@@ -92,11 +97,18 @@ table_events_statements_current::m_share=
"NESTING_EVENT_ID BIGINT unsigned comment 'NULL for top level statements. The parent statement event id for nested statements (stored programs).',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'NULL for top level statements. The parent statement event type for nested statements (stored programs).',"
"NESTING_EVENT_LEVEL INT comment '0 for top level statements. The parent statement level plus 1 for nested statements (stored programs).')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_statements_history::m_table_lock;
+PFS_engine_table_share_state
+table_events_statements_history::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_statements_history::m_share=
{
@@ -150,11 +162,18 @@ table_events_statements_history::m_share=
"NESTING_EVENT_ID BIGINT unsigned comment 'NULL for top level statements. The parent statement event id for nested statements (stored programs).',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'NULL for top level statements. The parent statement event type for nested statements (stored programs).',"
"NESTING_EVENT_LEVEL INT comment '0 for top level statements. The parent statement level plus 1 for nested statements (stored programs).')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_statements_history_long::m_table_lock;
+PFS_engine_table_share_state
+table_events_statements_history_long::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_statements_history_long::m_share=
{
@@ -208,7 +227,9 @@ table_events_statements_history_long::m_share=
"NESTING_EVENT_ID BIGINT unsigned comment 'NULL for top level statements. The parent statement event id for nested statements (stored programs).',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'NULL for top level statements. The parent statement event type for nested statements (stored programs).',"
"NESTING_EVENT_LEVEL INT comment '0 for top level statements. The parent statement level plus 1 for nested statements (stored programs).')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
table_events_statements_common::table_events_statements_common
diff --git a/storage/perfschema/table_events_statements.h b/storage/perfschema/table_events_statements.h
index 5499c8d62ec..a7fb6fd0ec7 100644
--- a/storage/perfschema/table_events_statements.h
+++ b/storage/perfschema/table_events_statements.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -209,6 +209,7 @@ protected:
class table_events_statements_current : public table_events_statements_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -246,6 +247,7 @@ private:
class table_events_statements_history : public table_events_statements_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -280,6 +282,7 @@ private:
class table_events_statements_history_long : public table_events_statements_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_events_transactions.cc b/storage/perfschema/table_events_transactions.cc
index 543d106ff26..e9fe172d8cf 100644
--- a/storage/perfschema/table_events_transactions.cc
+++ b/storage/perfschema/table_events_transactions.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_events_transactions_current::m_table_lock;
+PFS_engine_table_share_state
+table_events_transactions_current::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_transactions_current::m_share=
{
@@ -75,11 +80,18 @@ table_events_transactions_current::m_share=
"OBJECT_INSTANCE_BEGIN BIGINT unsigned comment 'Unused.',"
"NESTING_EVENT_ID BIGINT unsigned comment 'The EVENT_ID value of the event within which this event is nested.',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'The nesting event type.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_transactions_history::m_table_lock;
+PFS_engine_table_share_state
+table_events_transactions_history::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_transactions_history::m_share=
{
@@ -116,11 +128,18 @@ table_events_transactions_history::m_share=
"OBJECT_INSTANCE_BEGIN BIGINT unsigned comment 'Unused.',"
"NESTING_EVENT_ID BIGINT unsigned comment 'The EVENT_ID value of the event within which this event is nested.',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'The nesting event type.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_transactions_history_long::m_table_lock;
+PFS_engine_table_share_state
+table_events_transactions_history_long::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_transactions_history_long::m_share=
{
@@ -157,7 +176,9 @@ table_events_transactions_history_long::m_share=
"OBJECT_INSTANCE_BEGIN BIGINT unsigned comment 'Unused.',"
"NESTING_EVENT_ID BIGINT unsigned comment 'The EVENT_ID value of the event within which this event is nested.',"
"NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'The nesting event type.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
table_events_transactions_common::table_events_transactions_common
diff --git a/storage/perfschema/table_events_transactions.h b/storage/perfschema/table_events_transactions.h
index b9f8f750d85..940546093c8 100644
--- a/storage/perfschema/table_events_transactions.h
+++ b/storage/perfschema/table_events_transactions.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -149,6 +149,7 @@ protected:
class table_events_transactions_current : public table_events_transactions_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -190,6 +191,7 @@ private:
class table_events_transactions_history : public table_events_transactions_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -222,6 +224,7 @@ private:
class table_events_transactions_history_long : public table_events_transactions_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_events_waits.cc b/storage/perfschema/table_events_waits.cc
index a345c6fdf3a..e0052b8f656 100644
--- a/storage/perfschema/table_events_waits.cc
+++ b/storage/perfschema/table_events_waits.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_events_waits_current::m_table_lock;
+PFS_engine_table_share_state
+table_events_waits_current::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_waits_current::m_share=
{
@@ -70,11 +75,18 @@ table_events_waits_current::m_share=
"OPERATION VARCHAR(32) not null comment 'Operation type, for example read, write or lock',"
"NUMBER_OF_BYTES BIGINT comment 'Number of bytes that the operation read or wrote, or NULL for table I/O waits.',"
"FLAGS INTEGER unsigned comment 'Reserved for use in the future.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_waits_history::m_table_lock;
+PFS_engine_table_share_state
+table_events_waits_history::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_waits_history::m_share=
{
@@ -106,11 +118,18 @@ table_events_waits_history::m_share=
"OPERATION VARCHAR(32) not null comment 'Operation type, for example read, write or lock',"
"NUMBER_OF_BYTES BIGINT comment 'Number of bytes that the operation read or wrote, or NULL for table I/O waits.',"
"FLAGS INTEGER unsigned comment 'Reserved for use in the future.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
THR_LOCK table_events_waits_history_long::m_table_lock;
+PFS_engine_table_share_state
+table_events_waits_history_long::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_waits_history_long::m_share=
{
@@ -142,7 +161,9 @@ table_events_waits_history_long::m_share=
"OPERATION VARCHAR(32) not null comment 'Operation type, for example read, write or lock',"
"NUMBER_OF_BYTES BIGINT comment 'Number of bytes that the operation read or wrote, or NULL for table I/O waits.',"
"FLAGS INTEGER unsigned comment 'Reserved for use in the future.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
table_events_waits_common::table_events_waits_common
diff --git a/storage/perfschema/table_events_waits.h b/storage/perfschema/table_events_waits.h
index 82d6f56bbb7..926d54fd970 100644
--- a/storage/perfschema/table_events_waits.h
+++ b/storage/perfschema/table_events_waits.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -167,6 +167,7 @@ protected:
class table_events_waits_current : public table_events_waits_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -203,6 +204,7 @@ private:
class table_events_waits_history : public table_events_waits_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -236,6 +238,7 @@ private:
class table_events_waits_history_long : public table_events_waits_common
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_events_waits_summary.cc b/storage/perfschema/table_events_waits_summary.cc
index b9565d54460..3ee14e9a3e8 100644
--- a/storage/perfschema/table_events_waits_summary.cc
+++ b/storage/perfschema/table_events_waits_summary.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -36,6 +36,11 @@
THR_LOCK table_events_waits_summary_by_instance::m_table_lock;
+PFS_engine_table_share_state
+table_events_waits_summary_by_instance::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_events_waits_summary_by_instance::m_share=
{
@@ -55,7 +60,9 @@ table_events_waits_summary_by_instance::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_events_waits_summary_by_instance::create(void)
diff --git a/storage/perfschema/table_events_waits_summary.h b/storage/perfschema/table_events_waits_summary.h
index 13d50a23760..0cc6f18be3c 100644
--- a/storage/perfschema/table_events_waits_summary.h
+++ b/storage/perfschema/table_events_waits_summary.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -57,6 +57,7 @@ struct row_events_waits_summary_by_instance
class table_events_waits_summary_by_instance : public table_all_instr
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ews_by_account_by_event_name.cc b/storage/perfschema/table_ews_by_account_by_event_name.cc
index 007f75e52eb..661fff768a8 100644
--- a/storage/perfschema/table_ews_by_account_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_ews_by_account_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ews_by_account_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ews_by_account_by_event_name::m_share=
{
@@ -58,7 +63,9 @@ table_ews_by_account_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ews_by_account_by_event_name.h b/storage/perfschema/table_ews_by_account_by_event_name.h
index 4d626cf44cf..6ca0f2912bd 100644
--- a/storage/perfschema/table_ews_by_account_by_event_name.h
+++ b/storage/perfschema/table_ews_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -96,6 +96,7 @@ struct pos_ews_by_account_by_event_name
class table_ews_by_account_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ews_by_host_by_event_name.cc b/storage/perfschema/table_ews_by_host_by_event_name.cc
index 3a1ee52b6e4..6fb54deb4b2 100644
--- a/storage/perfschema/table_ews_by_host_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_ews_by_host_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ews_by_host_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ews_by_host_by_event_name::m_share=
{
@@ -58,7 +63,9 @@ table_ews_by_host_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.' )") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ews_by_host_by_event_name.h b/storage/perfschema/table_ews_by_host_by_event_name.h
index fb1060cb45e..ac07e698f13 100644
--- a/storage/perfschema/table_ews_by_host_by_event_name.h
+++ b/storage/perfschema/table_ews_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -96,6 +96,7 @@ struct pos_ews_by_host_by_event_name
class table_ews_by_host_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ews_by_thread_by_event_name.cc b/storage/perfschema/table_ews_by_thread_by_event_name.cc
index 803e81b4a7b..35d82378717 100644
--- a/storage/perfschema/table_ews_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_ews_by_thread_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ews_by_thread_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ews_by_thread_by_event_name::m_share=
{
@@ -57,7 +62,9 @@ table_ews_by_thread_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ews_by_thread_by_event_name.h b/storage/perfschema/table_ews_by_thread_by_event_name.h
index 85209f6fad4..b811cd40962 100644
--- a/storage/perfschema/table_ews_by_thread_by_event_name.h
+++ b/storage/perfschema/table_ews_by_thread_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -95,6 +95,7 @@ struct pos_ews_by_thread_by_event_name
class table_ews_by_thread_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ews_by_user_by_event_name.cc b/storage/perfschema/table_ews_by_user_by_event_name.cc
index d1e88da59aa..62ea8aaa7be 100644
--- a/storage/perfschema/table_ews_by_user_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_ews_by_user_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ews_by_user_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_ews_by_user_by_event_name::m_share=
{
@@ -57,7 +62,9 @@ table_ews_by_user_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ews_by_user_by_event_name.h b/storage/perfschema/table_ews_by_user_by_event_name.h
index ffb2e9074b2..2dc34203d9e 100644
--- a/storage/perfschema/table_ews_by_user_by_event_name.h
+++ b/storage/perfschema/table_ews_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -96,6 +96,7 @@ struct pos_ews_by_user_by_event_name
class table_ews_by_user_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_ews_global_by_event_name.cc b/storage/perfschema/table_ews_global_by_event_name.cc
index d4853685a17..777112da092 100644
--- a/storage/perfschema/table_ews_global_by_event_name.cc
+++ b/storage/perfschema/table_ews_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,10 @@
#include "field.h"
THR_LOCK table_ews_global_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_ews_global_by_event_name::m_share_state = {
+ false /* m_checked */
+};
PFS_engine_table_share
table_ews_global_by_event_name::m_share=
@@ -57,7 +61,9 @@ table_ews_global_by_event_name::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_ews_global_by_event_name.h b/storage/perfschema/table_ews_global_by_event_name.h
index 548f0af4666..811dfbb6812 100644
--- a/storage/perfschema/table_ews_global_by_event_name.h
+++ b/storage/perfschema/table_ews_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -84,6 +84,7 @@ struct pos_ews_global_by_event_name
class table_ews_global_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_file_instances.cc b/storage/perfschema/table_file_instances.cc
index abbaf0745b3..c5fd7db2c23 100644
--- a/storage/perfschema/table_file_instances.cc
+++ b/storage/perfschema/table_file_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -36,6 +36,10 @@
#include "field.h"
THR_LOCK table_file_instances::m_table_lock;
+PFS_engine_table_share_state
+table_file_instances::m_share_state = {
+ false /* m_checked */
+};
PFS_engine_table_share
table_file_instances::m_share=
@@ -52,7 +56,9 @@ table_file_instances::m_share=
"FILE_NAME VARCHAR(512) not null comment 'File name.',"
"EVENT_NAME VARCHAR(128) not null comment 'Instrument name associated with the file.',"
"OPEN_COUNT INTEGER unsigned not null comment 'Open handles on the file. A value of greater than zero means that the file is currently open.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_file_instances::create(void)
diff --git a/storage/perfschema/table_file_instances.h b/storage/perfschema/table_file_instances.h
index 1517e83035b..adad5dadd06 100644
--- a/storage/perfschema/table_file_instances.h
+++ b/storage/perfschema/table_file_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -55,6 +55,7 @@ struct row_file_instances
class table_file_instances : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_file_summary_by_event_name.cc b/storage/perfschema/table_file_summary_by_event_name.cc
index e7c2d5559e6..d91fb02fe06 100644
--- a/storage/perfschema/table_file_summary_by_event_name.cc
+++ b/storage/perfschema/table_file_summary_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -36,6 +36,10 @@
#include "field.h"
THR_LOCK table_file_summary_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_file_summary_by_event_name::m_share_state = {
+ false /* m_checked */
+};
PFS_engine_table_share
table_file_summary_by_event_name::m_share=
@@ -72,7 +76,9 @@ table_file_summary_by_event_name::m_share=
"MIN_TIMER_MISC BIGINT unsigned not null comment 'Minimum wait time of all miscellaneous operations that are timed.',"
"AVG_TIMER_MISC BIGINT unsigned not null comment 'Average wait time of all miscellaneous operations that are timed.',"
"MAX_TIMER_MISC BIGINT unsigned not null comment 'Maximum wait time of all miscellaneous operations that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_file_summary_by_event_name::create(void)
diff --git a/storage/perfschema/table_file_summary_by_event_name.h b/storage/perfschema/table_file_summary_by_event_name.h
index 852b680262e..877adf9476a 100644
--- a/storage/perfschema/table_file_summary_by_event_name.h
+++ b/storage/perfschema/table_file_summary_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -55,6 +55,7 @@ struct row_file_summary_by_event_name
class table_file_summary_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_file_summary_by_instance.cc b/storage/perfschema/table_file_summary_by_instance.cc
index 2a41f9b7bff..5cd98955d62 100644
--- a/storage/perfschema/table_file_summary_by_instance.cc
+++ b/storage/perfschema/table_file_summary_by_instance.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_file_summary_by_instance::m_table_lock;
+PFS_engine_table_share_state
+table_file_summary_by_instance::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_file_summary_by_instance::m_share=
{
@@ -74,7 +79,9 @@ table_file_summary_by_instance::m_share=
"MIN_TIMER_MISC BIGINT unsigned not null comment 'Minimum wait time of all miscellaneous operations that are timed.',"
"AVG_TIMER_MISC BIGINT unsigned not null comment 'Average wait time of all miscellaneous operations that are timed.',"
"MAX_TIMER_MISC BIGINT unsigned not null comment 'Maximum wait time of all miscellaneous operations that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_file_summary_by_instance::create(void)
diff --git a/storage/perfschema/table_file_summary_by_instance.h b/storage/perfschema/table_file_summary_by_instance.h
index f0c3c1303fb..3b044fa064d 100644
--- a/storage/perfschema/table_file_summary_by_instance.h
+++ b/storage/perfschema/table_file_summary_by_instance.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -63,6 +63,7 @@ struct row_file_summary_by_instance
class table_file_summary_by_instance : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_global_status.cc b/storage/perfschema/table_global_status.cc
index c68e501d819..d9a20dc7e24 100644
--- a/storage/perfschema/table_global_status.cc
+++ b/storage/perfschema/table_global_status.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -35,6 +35,11 @@
THR_LOCK table_global_status::m_table_lock;
+PFS_engine_table_share_state
+table_global_status::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_global_status::m_share=
{
@@ -49,7 +54,9 @@ table_global_status::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE global_status("
"VARIABLE_NAME VARCHAR(64) not null comment 'The global status variable name.',"
"VARIABLE_VALUE VARCHAR(1024) comment 'The global status variable value.')") },
- true /* perpetual */
+ true, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_global_status.h b/storage/perfschema/table_global_status.h
index 53d7ca459c9..45c57fb6900 100644
--- a/storage/perfschema/table_global_status.h
+++ b/storage/perfschema/table_global_status.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -68,6 +68,7 @@ class table_global_status : public PFS_engine_table
typedef PFS_simple_index pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_global_variables.cc b/storage/perfschema/table_global_variables.cc
index 67be7e4e99a..fbe6b977cd1 100644
--- a/storage/perfschema/table_global_variables.cc
+++ b/storage/perfschema/table_global_variables.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -35,6 +35,11 @@
THR_LOCK table_global_variables::m_table_lock;
+PFS_engine_table_share_state
+table_global_variables::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_global_variables::m_share=
{
@@ -49,7 +54,8 @@ table_global_variables::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE global_variables("
"VARIABLE_NAME VARCHAR(64) not null,"
"VARIABLE_VALUE VARCHAR(1024))") },
- true /* perpetual */
+ true, /* m_perpetual */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_global_variables.h b/storage/perfschema/table_global_variables.h
index 8a9bbd63574..f5429c671a2 100644
--- a/storage/perfschema/table_global_variables.h
+++ b/storage/perfschema/table_global_variables.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -68,6 +68,7 @@ class table_global_variables : public PFS_engine_table
typedef PFS_simple_index pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_helper.cc b/storage/perfschema/table_helper.cc
index 0ae6f6c0786..477a1cd6006 100644
--- a/storage/perfschema/table_helper.cc
+++ b/storage/perfschema/table_helper.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_helper.h b/storage/perfschema/table_helper.h
index c7e4bf4dfb5..0e39b80875f 100644
--- a/storage/perfschema/table_helper.h
+++ b/storage/perfschema/table_helper.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_host_cache.cc b/storage/perfschema/table_host_cache.cc
index 1c1cba60b0d..79318223e21 100644
--- a/storage/perfschema/table_host_cache.cc
+++ b/storage/perfschema/table_host_cache.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -34,6 +34,11 @@
THR_LOCK table_host_cache::m_table_lock;
+PFS_engine_table_share_state
+table_host_cache::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_host_cache::m_share=
{
@@ -75,7 +80,9 @@ table_host_cache::m_share=
"LAST_SEEN TIMESTAMP(0) NOT NULL default 0 comment 'Timestamp of the most recent connection attempt by the IP.',"
"FIRST_ERROR_SEEN TIMESTAMP(0) null default 0 comment 'Timestamp of the first error seen from the IP.',"
"LAST_ERROR_SEEN TIMESTAMP(0) null default 0 comment 'Timestamp of the most recent error seen from the IP.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_host_cache::create(void)
diff --git a/storage/perfschema/table_host_cache.h b/storage/perfschema/table_host_cache.h
index 5680a49675f..bb1cb444c33 100644
--- a/storage/perfschema/table_host_cache.h
+++ b/storage/perfschema/table_host_cache.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -107,6 +107,7 @@ struct row_host_cache
class table_host_cache : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_hosts.cc b/storage/perfschema/table_hosts.cc
index 7c6f6212bb8..443cb12e6e0 100644
--- a/storage/perfschema/table_hosts.cc
+++ b/storage/perfschema/table_hosts.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -34,6 +34,11 @@
THR_LOCK table_hosts::m_table_lock;
+PFS_engine_table_share_state
+table_hosts::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_hosts::m_share=
{
@@ -49,7 +54,9 @@ table_hosts::m_share=
"HOST CHAR(" STRINGIFY_ARG(HOSTNAME_LENGTH) ") collate utf8_bin default null comment 'Host name used by the client to connect, NULL for internal threads or user sessions that failed to authenticate.',"
"CURRENT_CONNECTIONS bigint not null comment 'Current number of the host''s connections.',"
"TOTAL_CONNECTIONS bigint not null comment 'Total number of the host''s connections')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_hosts::create()
diff --git a/storage/perfschema/table_hosts.h b/storage/perfschema/table_hosts.h
index 51bc7f2f2a7..8262beabda5 100644
--- a/storage/perfschema/table_hosts.h
+++ b/storage/perfschema/table_hosts.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -49,6 +49,7 @@ struct row_hosts
class table_hosts : public cursor_by_host
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
/** Table builder */
diff --git a/storage/perfschema/table_md_locks.cc b/storage/perfschema/table_md_locks.cc
index d7e3423d9bc..2b69e385a79 100644
--- a/storage/perfschema/table_md_locks.cc
+++ b/storage/perfschema/table_md_locks.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_metadata_locks::m_table_lock;
+PFS_engine_table_share_state
+table_metadata_locks::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_metadata_locks::m_share=
{
@@ -59,7 +64,9 @@ table_metadata_locks::m_share=
"SOURCE VARCHAR(64) comment 'Source file containing the instrumented code that produced the event, as well as the line number where the instrumentation occurred. This allows one to examine the source code involved.',"
"OWNER_THREAD_ID BIGINT unsigned comment 'Thread that requested the lock.',"
"OWNER_EVENT_ID BIGINT unsigned comment 'Event that requested the lock.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_metadata_locks::create(void)
diff --git a/storage/perfschema/table_md_locks.h b/storage/perfschema/table_md_locks.h
index c6a4a2eca8d..ddb133ea7ff 100644
--- a/storage/perfschema/table_md_locks.h
+++ b/storage/perfschema/table_md_locks.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -63,6 +63,7 @@ struct row_metadata_lock
class table_metadata_locks : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_mems_by_account_by_event_name.cc b/storage/perfschema/table_mems_by_account_by_event_name.cc
index c4217641f6a..ec074872733 100644
--- a/storage/perfschema/table_mems_by_account_by_event_name.cc
+++ b/storage/perfschema/table_mems_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_mems_by_account_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_mems_by_account_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_mems_by_account_by_event_name::m_share=
{
@@ -64,7 +69,9 @@ table_mems_by_account_by_event_name::m_share=
"LOW_NUMBER_OF_BYTES_USED BIGINT not null comment 'Lowest number of bytes used.',"
"CURRENT_NUMBER_OF_BYTES_USED BIGINT not null comment 'Current number of bytes used (total allocated minus total freed).',"
"HIGH_NUMBER_OF_BYTES_USED BIGINT not null comment 'Highest number of bytes used.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_mems_by_account_by_event_name::create(void)
diff --git a/storage/perfschema/table_mems_by_account_by_event_name.h b/storage/perfschema/table_mems_by_account_by_event_name.h
index 9d43c4cf404..626190461d5 100644
--- a/storage/perfschema/table_mems_by_account_by_event_name.h
+++ b/storage/perfschema/table_mems_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -85,6 +85,7 @@ struct pos_mems_by_account_by_event_name
class table_mems_by_account_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_mems_by_host_by_event_name.cc b/storage/perfschema/table_mems_by_host_by_event_name.cc
index b86fe70da28..d08444c311d 100644
--- a/storage/perfschema/table_mems_by_host_by_event_name.cc
+++ b/storage/perfschema/table_mems_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_mems_by_host_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_mems_by_host_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_mems_by_host_by_event_name::m_share=
{
@@ -63,7 +68,9 @@ table_mems_by_host_by_event_name::m_share=
"LOW_NUMBER_OF_BYTES_USED BIGINT not null comment 'Lowest number of bytes used.',"
"CURRENT_NUMBER_OF_BYTES_USED BIGINT not null comment 'Current number of bytes used (total allocated minus total freed).',"
"HIGH_NUMBER_OF_BYTES_USED BIGINT not null comment 'Highest number of bytes used.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_mems_by_host_by_event_name::create(void)
diff --git a/storage/perfschema/table_mems_by_host_by_event_name.h b/storage/perfschema/table_mems_by_host_by_event_name.h
index a4fdde24fbd..f46f3c889e0 100644
--- a/storage/perfschema/table_mems_by_host_by_event_name.h
+++ b/storage/perfschema/table_mems_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -85,6 +85,7 @@ struct pos_mems_by_host_by_event_name
class table_mems_by_host_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_mems_by_thread_by_event_name.cc b/storage/perfschema/table_mems_by_thread_by_event_name.cc
index 8c79f8cc8d8..eb76a016030 100644
--- a/storage/perfschema/table_mems_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_mems_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_mems_by_thread_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_mems_by_thread_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_mems_by_thread_by_event_name::m_share=
{
@@ -63,7 +68,9 @@ table_mems_by_thread_by_event_name::m_share=
"LOW_NUMBER_OF_BYTES_USED BIGINT not null comment 'Lowest number of bytes used.',"
"CURRENT_NUMBER_OF_BYTES_USED BIGINT not null comment 'Current number of bytes used (total allocated minus total freed).',"
"HIGH_NUMBER_OF_BYTES_USED BIGINT not null comment 'Highest number of bytes used.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_mems_by_thread_by_event_name::create(void)
diff --git a/storage/perfschema/table_mems_by_thread_by_event_name.h b/storage/perfschema/table_mems_by_thread_by_event_name.h
index b89172669e6..17196e0fd80 100644
--- a/storage/perfschema/table_mems_by_thread_by_event_name.h
+++ b/storage/perfschema/table_mems_by_thread_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -85,6 +85,7 @@ struct pos_mems_by_thread_by_event_name
class table_mems_by_thread_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_mems_by_user_by_event_name.cc b/storage/perfschema/table_mems_by_user_by_event_name.cc
index 4bae383166a..708c5681c3c 100644
--- a/storage/perfschema/table_mems_by_user_by_event_name.cc
+++ b/storage/perfschema/table_mems_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_mems_by_user_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_mems_by_user_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_mems_by_user_by_event_name::m_share=
{
@@ -63,7 +68,9 @@ table_mems_by_user_by_event_name::m_share=
"LOW_NUMBER_OF_BYTES_USED BIGINT not null comment 'Lowest number of bytes used.',"
"CURRENT_NUMBER_OF_BYTES_USED BIGINT not null comment 'Current number of bytes used (total allocated minus total freed).',"
"HIGH_NUMBER_OF_BYTES_USED BIGINT not null comment 'Highest number of bytes used.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_mems_by_user_by_event_name::create(void)
diff --git a/storage/perfschema/table_mems_by_user_by_event_name.h b/storage/perfschema/table_mems_by_user_by_event_name.h
index 34c4cd518ae..c2ad8bd7462 100644
--- a/storage/perfschema/table_mems_by_user_by_event_name.h
+++ b/storage/perfschema/table_mems_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -85,6 +85,7 @@ struct pos_mems_by_user_by_event_name
class table_mems_by_user_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_mems_global_by_event_name.cc b/storage/perfschema/table_mems_global_by_event_name.cc
index e4b681072c8..c84fa1a1529 100644
--- a/storage/perfschema/table_mems_global_by_event_name.cc
+++ b/storage/perfschema/table_mems_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_mems_global_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_mems_global_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_mems_global_by_event_name::m_share=
{
@@ -62,7 +67,9 @@ table_mems_global_by_event_name::m_share=
"LOW_NUMBER_OF_BYTES_USED BIGINT not null comment 'Lowest number of bytes used.',"
"CURRENT_NUMBER_OF_BYTES_USED BIGINT not null comment 'Current number of bytes used (total allocated minus total freed).',"
"HIGH_NUMBER_OF_BYTES_USED BIGINT not null comment 'Highest number of bytes used.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_mems_global_by_event_name::create(void)
diff --git a/storage/perfschema/table_mems_global_by_event_name.h b/storage/perfschema/table_mems_global_by_event_name.h
index 46dbccbd414..eaff095f8d7 100644
--- a/storage/perfschema/table_mems_global_by_event_name.h
+++ b/storage/perfschema/table_mems_global_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -87,6 +87,7 @@ class table_mems_global_by_event_name : public PFS_engine_table
typedef pos_mems_global_by_event_name pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_os_global_by_type.cc b/storage/perfschema/table_os_global_by_type.cc
index b82ce9c2a7d..ac1c123e5f4 100644
--- a/storage/perfschema/table_os_global_by_type.cc
+++ b/storage/perfschema/table_os_global_by_type.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_os_global_by_type::m_table_lock;
+PFS_engine_table_share_state
+table_os_global_by_type::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_os_global_by_type::m_share=
{
@@ -57,7 +62,9 @@ table_os_global_by_type::m_share=
"MIN_TIMER_WAIT BIGINT unsigned not null comment 'Minimum wait time of the summarized events that are timed.',"
"AVG_TIMER_WAIT BIGINT unsigned not null comment 'Average wait time of the summarized events that are timed.',"
"MAX_TIMER_WAIT BIGINT unsigned not null comment 'Maximum wait time of the summarized events that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_os_global_by_type.h b/storage/perfschema/table_os_global_by_type.h
index 9cb3b47b964..8009d2125b3 100644
--- a/storage/perfschema/table_os_global_by_type.h
+++ b/storage/perfschema/table_os_global_by_type.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -86,6 +86,7 @@ struct pos_os_global_by_type : public PFS_double_index,
class table_os_global_by_type : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_performance_timers.cc b/storage/perfschema/table_performance_timers.cc
index 68878919e2b..c89ad8d9021 100644
--- a/storage/perfschema/table_performance_timers.cc
+++ b/storage/perfschema/table_performance_timers.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -34,6 +34,11 @@
THR_LOCK table_performance_timers::m_table_lock;
+PFS_engine_table_share_state
+table_performance_timers::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_performance_timers::m_share=
{
@@ -50,7 +55,9 @@ table_performance_timers::m_share=
"TIMER_FREQUENCY BIGINT comment 'Number of timer units per second. Dependent on the processor speed.',"
"TIMER_RESOLUTION BIGINT comment 'Number of timer units by which timed values increase each time.',"
"TIMER_OVERHEAD BIGINT comment 'Minimum timer overhead, determined during initialization by calling the timer 20 times and selecting the smallest value. Total overhead will be at least double this, as the timer is called at the beginning and end of each timed event.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_performance_timers::create(void)
diff --git a/storage/perfschema/table_performance_timers.h b/storage/perfschema/table_performance_timers.h
index a2e12a4f824..5479c6f577d 100644
--- a/storage/perfschema/table_performance_timers.h
+++ b/storage/perfschema/table_performance_timers.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -53,6 +53,7 @@ struct row_performance_timers
class table_performance_timers : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_prepared_stmt_instances.cc b/storage/perfschema/table_prepared_stmt_instances.cc
index 592386db4bb..8ff699eb03c 100644
--- a/storage/perfschema/table_prepared_stmt_instances.cc
+++ b/storage/perfschema/table_prepared_stmt_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -41,6 +41,11 @@
THR_LOCK table_prepared_stmt_instances::m_table_lock;
+PFS_engine_table_share_state
+table_prepared_stmt_instances::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_prepared_stmt_instances::m_share=
{
@@ -88,7 +93,9 @@ table_prepared_stmt_instances::m_share=
"SUM_SORT_SCAN bigint(20) unsigned NOT NULL comment 'The total number of sorts that were done by scanning the table by the prepared statements.',"
"SUM_NO_INDEX_USED bigint(20) unsigned NOT NULL comment 'The total number of statements that performed a table scan without using an index.',"
"SUM_NO_GOOD_INDEX_USED bigint(20) unsigned NOT NULL comment 'The total number of statements where no good index was found.')")},
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_prepared_stmt_instances.h b/storage/perfschema/table_prepared_stmt_instances.h
index a061e0d9883..e7afe5d48b0 100644
--- a/storage/perfschema/table_prepared_stmt_instances.h
+++ b/storage/perfschema/table_prepared_stmt_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -87,6 +87,7 @@ struct row_prepared_stmt_instances
class table_prepared_stmt_instances : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_processlist.cc b/storage/perfschema/table_processlist.cc
new file mode 100644
index 00000000000..25d9ca7129c
--- /dev/null
+++ b/storage/perfschema/table_processlist.cc
@@ -0,0 +1,360 @@
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License, version 2.0, for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+/**
+ @file storage/perfschema/table_processlist.cc
+ TABLE PROCESSLIST.
+*/
+
+#include "my_global.h"
+
+#include "table_processlist.h"
+
+#include <assert.h>
+// #include "lex_string.h"
+#include "my_compiler.h"
+
+#include "my_thread.h"
+//#include "auth_acls.h"
+#include "sql_acl.h"
+#include "field.h"
+#include "sql_class.h"
+#include "sql_parse.h"
+#include "table.h"
+#include "pfs_buffer_container.h"
+#include "pfs_global.h"
+#include "pfs_instr.h"
+#include "pfs_instr_class.h"
+
+THR_LOCK table_processlist::m_table_lock;
+
+PFS_engine_table_share_state
+table_processlist::m_share_state = {
+ false /* m_checked */
+};
+
+PFS_engine_table_share table_processlist::m_share = {
+ {C_STRING_WITH_LEN("processlist")},
+ &pfs_readonly_processlist_acl,
+ table_processlist::create,
+ NULL, /* write_row */
+ NULL, /* delete_all_rows */
+ cursor_by_thread::get_row_count,
+ sizeof(PFS_simple_index), /* ref length */
+ &m_table_lock,
+ &m_field_def,
+ false, /* m_perpetual */
+ true, /* m_optional */
+ &m_share_state
+};
+
+PFS_engine_table *table_processlist::create() {
+ return new table_processlist();
+}
+
+table_processlist::table_processlist()
+ : cursor_by_thread(&m_share), m_row_exists(false) {
+ m_row_priv.m_auth = PROCESSLIST_DENIED;
+}
+
+int table_processlist::set_access(void) {
+ THD *thd = current_thd;
+ if (thd == NULL) {
+ /* Robustness, no user session. */
+ m_row_priv.m_auth = PROCESSLIST_DENIED;
+ return 0;
+ }
+
+ if (thd->security_context()->check_access(PROCESS_ACL)) {
+ /* PROCESS_ACL granted. */
+ m_row_priv.m_auth = PROCESSLIST_ALL;
+ return 0;
+ }
+
+ LEX_CSTRING client_priv_user = thd->security_context()->priv_user();
+ if (client_priv_user.length == 0) {
+ /* Anonymous user. */
+ m_row_priv.m_auth = PROCESSLIST_DENIED;
+ return 0;
+ }
+
+ /* Authenticated user, PROCESS_ACL not granted. */
+ m_row_priv.m_auth = PROCESSLIST_USER_ONLY;
+ m_row_priv.m_priv_user_length =
+ std::min(client_priv_user.length, sizeof(m_row_priv.m_priv_user));
+ memcpy(m_row_priv.m_priv_user, client_priv_user.str,
+ m_row_priv.m_priv_user_length);
+ return 0;
+}
+
+int table_processlist::rnd_init(bool scan) {
+ set_access();
+ return 0;
+}
+
+void table_processlist::make_row(PFS_thread *pfs) {
+ pfs_optimistic_state lock;
+ pfs_optimistic_state session_lock;
+ pfs_optimistic_state stmt_lock;
+ PFS_stage_class *stage_class;
+ PFS_thread_class *safe_class;
+
+ m_row_exists = false;
+
+ if (m_row_priv.m_auth == PROCESSLIST_DENIED) {
+ return;
+ }
+
+ /* Protect this reader against thread termination */
+ pfs->m_lock.begin_optimistic_lock(&lock);
+
+ safe_class = sanitize_thread_class(pfs->m_class);
+ if (unlikely(safe_class == NULL)) {
+ return;
+ }
+
+ /* Ignore background threads. */
+ if (pfs->m_username_length == 0 || pfs->m_processlist_id == 0) return;
+
+ m_row.m_processlist_id = pfs->m_processlist_id;
+
+ /* Protect this reader against session attribute changes */
+ pfs->m_session_lock.begin_optimistic_lock(&session_lock);
+
+ /* Maintain user/host compatibility with the legacy SHOW PROCESSLIST. */
+ const char *username = pfs->m_username;
+ uint username_len = pfs->m_username_length;
+ uint hostname_len = pfs->m_hostname_length;
+
+ if (pfs->m_class->is_system_thread()) {
+ if (username_len == 0 ||
+ (!strncmp(username, "root", 4) && username_len == 4)) {
+ username = "system user";
+ username_len = strlen(username);
+ hostname_len = 0;
+ }
+ } else {
+ if (username_len == 0) {
+ username = "unauthenticated user";
+ username_len = strlen(username);
+ hostname_len = 0;
+ }
+ }
+
+ m_row.m_username_length = username_len;
+ if (unlikely(m_row.m_username_length > sizeof(m_row.m_username))) {
+ return;
+ }
+
+ if (m_row.m_username_length != 0) {
+ memcpy(m_row.m_username, username, username_len);
+ }
+
+ m_row.m_hostname_length = hostname_len;
+ if (unlikely(m_row.m_hostname_length > sizeof(m_row.m_hostname))) {
+ return;
+ }
+
+ if (m_row.m_hostname_length != 0) {
+ memcpy(m_row.m_hostname, pfs->m_hostname, m_row.m_hostname_length);
+ }
+
+ if (!pfs->m_session_lock.end_optimistic_lock(&session_lock)) {
+ /*
+ One of the columns:
+ - USER
+ - HOST
+ is being updated.
+ Do not discard the entire row.
+ Do not loop waiting for a stable value.
+ Just return NULL values.
+ */
+ m_row.m_username_length = 0;
+ m_row.m_hostname_length = 0;
+ }
+
+ /* Enforce row filtering. */
+ if (m_row_priv.m_auth == PROCESSLIST_USER_ONLY) {
+ if (m_row.m_username_length != m_row_priv.m_priv_user_length) {
+ return;
+ }
+ if (strncmp(m_row.m_username, m_row_priv.m_priv_user,
+ m_row_priv.m_priv_user_length) != 0) {
+ return;
+ }
+ }
+
+ /* Protect this reader against statement attributes changes */
+ pfs->m_stmt_lock.begin_optimistic_lock(&stmt_lock);
+
+ m_row.m_dbname_length = pfs->m_dbname_length;
+ if (unlikely(m_row.m_dbname_length > sizeof(m_row.m_dbname))) {
+ return;
+ }
+
+ if (m_row.m_dbname_length != 0) {
+ memcpy(m_row.m_dbname, pfs->m_dbname, m_row.m_dbname_length);
+ }
+
+ m_row.m_processlist_info_ptr = &pfs->m_processlist_info[0];
+ m_row.m_processlist_info_length = pfs->m_processlist_info_length;
+
+ if (!pfs->m_stmt_lock.end_optimistic_lock(&stmt_lock)) {
+ /*
+ One of the columns:
+ - DB
+ - INFO
+ is being updated.
+ Do not discard the entire row.
+ Do not loop waiting for a stable value.
+ Just return NULL values.
+ */
+ m_row.m_dbname_length = 0;
+ m_row.m_processlist_info_length = 0;
+ }
+
+ /* Dirty read, sanitize the command. */
+ m_row.m_command = pfs->m_command;
+ if ((m_row.m_command < 0) || (m_row.m_command > COM_END)) {
+ m_row.m_command = COM_END;
+ }
+
+ m_row.m_start_time = pfs->m_start_time;
+
+ stage_class = find_stage_class(pfs->m_stage);
+ if (stage_class != NULL) {
+ m_row.m_processlist_state_ptr =
+ stage_class->m_name + stage_class->m_prefix_length;
+ m_row.m_processlist_state_length =
+ stage_class->m_name_length - stage_class->m_prefix_length;
+ if (m_row.m_processlist_state_length > 64) {
+ /*
+ Column STATE is VARCHAR(64)
+ for compatibility reasons with the historical
+ INFORMATION_SCHEMA.PROCESSLIST table.
+ Stages however can have longer names.
+ We silently truncate data here,
+ so it fits into STATE.
+ */
+ m_row.m_processlist_state_length = 64;
+ }
+ } else {
+ m_row.m_processlist_state_ptr = "";
+ m_row.m_processlist_state_length = 0;
+ }
+
+ m_row.m_port = pfs->m_peer_port;
+
+ if (m_row.m_hostname_length > 0 && m_row.m_port != 0) {
+ /* Create HOST:PORT. */
+ char str_port[10];
+ sprintf(str_port, ":%d", m_row.m_port);
+ std::string host(m_row.m_hostname, m_row.m_hostname_length);
+ std::string host_ip = host + str_port;
+ m_row.m_hostname_length =
+ std::min((int)HOST_AND_PORT_LENGTH, (int)host_ip.length());
+ memcpy(m_row.m_hostname, host_ip.c_str(), m_row.m_hostname_length);
+ }
+
+ if (!pfs->m_lock.end_optimistic_lock(&lock)) {
+ return;
+ }
+
+ m_row_exists = true;
+ return;
+}
+
+int table_processlist::read_row_values(TABLE *table, unsigned char *buf,
+ Field **fields, bool read_all) {
+ Field *f;
+
+ if (unlikely(!m_row_exists)) {
+ return HA_ERR_RECORD_DELETED;
+ }
+
+ /* Set the null bits */
+ assert(table->s->null_bytes == 1);
+ buf[0] = 0;
+
+ for (; (f = *fields); fields++) {
+ if (read_all || bitmap_is_set(table->read_set, f->field_index)) {
+ switch (f->field_index) {
+ case 0: /* ID */
+ set_field_ulonglong(f, m_row.m_processlist_id);
+ break;
+ case 1: /* USER */
+ if (m_row.m_username_length > 0) {
+ set_field_varchar_utf8(f, m_row.m_username,
+ m_row.m_username_length);
+ } else {
+ f->set_null();
+ }
+ break;
+ case 2: /* HOST */
+ if (m_row.m_hostname_length > 0) {
+ set_field_varchar_utf8(f, m_row.m_hostname,
+ m_row.m_hostname_length);
+ } else {
+ f->set_null();
+ }
+ break;
+ case 3: /* DB */
+ if (m_row.m_dbname_length > 0) {
+ set_field_varchar_utf8(f, m_row.m_dbname, m_row.m_dbname_length);
+ } else {
+ f->set_null();
+ }
+ break;
+ case 4: /* COMMAND */
+ set_field_varchar_utf8(f, command_name[m_row.m_command].str,
+ command_name[m_row.m_command].length);
+ break;
+ case 5: /* TIME */
+ if (m_row.m_start_time) {
+ time_t now = my_time(0);
+ ulonglong elapsed =
+ (now > m_row.m_start_time ? now - m_row.m_start_time : 0);
+ set_field_ulonglong(f, elapsed);
+ } else {
+ f->set_null();
+ }
+ break;
+ case 6: /* STATE */
+ /* For compatibility, leave blank if state is NULL. */
+ set_field_varchar_utf8(f, m_row.m_processlist_state_ptr,
+ m_row.m_processlist_state_length);
+ break;
+ case 7: /* INFO */
+ if (m_row.m_processlist_info_length > 0)
+ set_field_blob(f, m_row.m_processlist_info_ptr,
+ m_row.m_processlist_info_length);
+ else {
+ f->set_null();
+ }
+ break;
+ default:
+ assert(false);
+ }
+ }
+ }
+ return 0;
+}
diff --git a/storage/perfschema/table_processlist.h b/storage/perfschema/table_processlist.h
new file mode 100644
index 00000000000..0944b5619fe
--- /dev/null
+++ b/storage/perfschema/table_processlist.h
@@ -0,0 +1,133 @@
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License, version 2.0,
+ as published by the Free Software Foundation.
+
+ This program is also distributed with certain software (including
+ but not limited to OpenSSL) that is licensed under separate terms,
+ as designated in a particular file or component or in included license
+ documentation. The authors of MySQL hereby grant you an additional
+ permission to link the program and your derivative works with the
+ separately licensed software that they have included with MySQL.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License, version 2.0, for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+#ifndef TABLE_PROCESSLIST_H
+#define TABLE_PROCESSLIST_H
+
+/**
+ @file storage/perfschema/table_processlist.h
+ TABLE THREADS.
+*/
+
+#include <sys/types.h>
+#include <time.h>
+#include <algorithm>
+
+// #include "my_hostname.h"
+// #include "my_inttypes.h"
+#include "cursor_by_thread.h"
+#include "pfs_column_types.h"
+
+struct PFS_thread;
+
+/**
+ @addtogroup performance_schema_tables
+ @{
+*/
+
+/**
+ A row of PERFORMANCE_SCHEMA.PROCESSLIST.
+*/
+struct row_processlist {
+ /** Column ID. */
+ ulonglong m_processlist_id;
+ /** Column USER. */
+ char m_username[USERNAME_LENGTH];
+ /** Length in bytes of @c m_username. */
+ uint m_username_length;
+ /** Column HOST. */
+ char m_hostname[HOST_AND_PORT_LENGTH];
+ /** Length in bytes of @c m_hostname. */
+ uint m_hostname_length;
+ /** Port. */
+ uint m_port;
+ /** Column DB. */
+ char m_dbname[NAME_LEN];
+ /** Length in bytes of @c m_dbname. */
+ uint m_dbname_length;
+ /** Column COMMAND. */
+ int m_command;
+ /** Column TIME. */
+ time_t m_start_time;
+ /** Column STATE. */
+ const char *m_processlist_state_ptr;
+ /** Length in bytes of @c m_processlist_state_ptr. */
+ uint m_processlist_state_length;
+ /** Column INFO. */
+ const char *m_processlist_info_ptr;
+ /** Length in bytes of @c m_processlist_info_ptr. */
+ uint m_processlist_info_length;
+};
+
+enum enum_priv_processlist {
+ /** User is not allowed to see any data. */
+ PROCESSLIST_DENIED,
+ /** User does not have the PROCESS_ACL priviledge. */
+ PROCESSLIST_USER_ONLY,
+ /** User has the PROCESS_ACL priviledge. */
+ PROCESSLIST_ALL
+};
+
+struct row_priv_processlist {
+ enum enum_priv_processlist m_auth;
+ char m_priv_user[USERNAME_LENGTH];
+ size_t m_priv_user_length;
+};
+
+/** Table PERFORMANCE_SCHEMA.PROCESSLIST. */
+class table_processlist : public cursor_by_thread {
+ public:
+ static PFS_engine_table_share_state m_share_state;
+ /** Table share */
+ static PFS_engine_table_share m_share;
+ /** Table builder */
+ static PFS_engine_table *create();
+
+ protected:
+ table_processlist();
+
+ virtual int rnd_init(bool scan);
+
+ virtual int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
+ bool read_all);
+ int set_access(void);
+
+ public:
+ virtual ~table_processlist() {}
+
+ private:
+ virtual void make_row(PFS_thread *pfs);
+ /** Table share lock. */
+ static THR_LOCK m_table_lock;
+ /** Fields definition. */
+ static TABLE_FIELD_DEF m_field_def;
+
+ /** Current row. */
+ row_processlist m_row;
+ /** Row privileges. */
+ row_priv_processlist m_row_priv;
+ /** True if the current row exists. */
+ bool m_row_exists;
+};
+
+/** @} */
+#endif
diff --git a/storage/perfschema/table_replication_applier_configuration.cc b/storage/perfschema/table_replication_applier_configuration.cc
index c9b0163bc76..ce66fa9fecd 100644
--- a/storage/perfschema/table_replication_applier_configuration.cc
+++ b/storage/perfschema/table_replication_applier_configuration.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -40,6 +40,11 @@
THR_LOCK table_replication_applier_configuration::m_table_lock;
+PFS_engine_table_share_state
+table_replication_applier_configuration::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_applier_configuration::m_share=
{
@@ -54,7 +59,9 @@ table_replication_applier_configuration::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE replication_applier_configuration("
"CHANNEL_NAME VARCHAR(256) collate utf8_general_ci not null comment 'Replication channel name.',"
"DESIRED_DELAY INTEGER not null comment 'Target number of seconds the replica should be delayed to the master.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_replication_applier_configuration::create(void)
diff --git a/storage/perfschema/table_replication_applier_configuration.h b/storage/perfschema/table_replication_applier_configuration.h
index eadea0cb7f2..917778a5a03 100644
--- a/storage/perfschema/table_replication_applier_configuration.h
+++ b/storage/perfschema/table_replication_applier_configuration.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -91,6 +91,7 @@ protected:
public:
~table_replication_applier_configuration();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_replication_applier_status.cc b/storage/perfschema/table_replication_applier_status.cc
index c95acf0adfb..053ed997760 100644
--- a/storage/perfschema/table_replication_applier_status.cc
+++ b/storage/perfschema/table_replication_applier_status.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -43,6 +43,11 @@
THR_LOCK table_replication_applier_status::m_table_lock;
+PFS_engine_table_share_state
+table_replication_applier_status::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_applier_status::m_share=
{
@@ -59,7 +64,9 @@ table_replication_applier_status::m_share=
"SERVICE_STATE ENUM('ON','OFF') not null comment 'Shows ON when the replication channel''s applier threads are active or idle, OFF means that the applier threads are not active.',"
"REMAINING_DELAY INTEGER unsigned comment 'Seconds the replica needs to wait to reach the desired delay from master.',"
"COUNT_TRANSACTIONS_RETRIES BIGINT unsigned not null comment 'The number of retries that were made because the replication SQL thread failed to apply a transaction.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
diff --git a/storage/perfschema/table_replication_applier_status.h b/storage/perfschema/table_replication_applier_status.h
index 06cbc9fd22b..11dbbc43105 100644
--- a/storage/perfschema/table_replication_applier_status.h
+++ b/storage/perfschema/table_replication_applier_status.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -102,6 +102,7 @@ protected:
public:
~table_replication_applier_status();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_replication_applier_status_by_coordinator.cc b/storage/perfschema/table_replication_applier_status_by_coordinator.cc
index 9066e9384d4..91821eeb979 100644
--- a/storage/perfschema/table_replication_applier_status_by_coordinator.cc
+++ b/storage/perfschema/table_replication_applier_status_by_coordinator.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -43,6 +43,11 @@
THR_LOCK table_replication_applier_status_by_coordinator::m_table_lock;
+PFS_engine_table_share_state
+table_replication_applier_status_by_coordinator::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_applier_status_by_coordinator::m_share=
{
@@ -63,7 +68,9 @@ table_replication_applier_status_by_coordinator::m_share=
"LAST_ERROR_TIMESTAMP TIMESTAMP(0) not null comment 'Timestamp that shows when the most recent SQL/coordinator error occured.',"
"LAST_SEEN_TRANSACTION CHAR(57) not null comment 'The transaction the worker has last seen.',"
"LAST_TRANS_RETRY_COUNT INTEGER not null comment 'Total number of retries attempted by last transaction.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_replication_applier_status_by_coordinator::create(void)
diff --git a/storage/perfschema/table_replication_applier_status_by_coordinator.h b/storage/perfschema/table_replication_applier_status_by_coordinator.h
index 32acc32988d..2424304be72 100644
--- a/storage/perfschema/table_replication_applier_status_by_coordinator.h
+++ b/storage/perfschema/table_replication_applier_status_by_coordinator.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -111,6 +111,7 @@ protected:
public:
~table_replication_applier_status_by_coordinator();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_replication_applier_status_by_worker.cc b/storage/perfschema/table_replication_applier_status_by_worker.cc
index 934d68a566c..1ccf75e5d25 100644
--- a/storage/perfschema/table_replication_applier_status_by_worker.cc
+++ b/storage/perfschema/table_replication_applier_status_by_worker.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -40,6 +40,11 @@
THR_LOCK table_replication_applier_status_by_worker::m_table_lock;
+PFS_engine_table_share_state
+table_replication_applier_status_by_worker::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_applier_status_by_worker::m_share=
{
@@ -61,7 +66,9 @@ table_replication_applier_status_by_worker::m_share=
"LAST_ERROR_TIMESTAMP TIMESTAMP(0) not null comment 'Time stamp of last error.',"
"WORKER_IDLE_TIME BIGINT UNSIGNED not null comment 'Total idle time in seconds that the worker thread has spent waiting for work from SQL thread.',"
"LAST_TRANS_RETRY_COUNT INTEGER not null comment 'Total number of retries attempted by last transaction.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_replication_applier_status_by_worker::create(void)
diff --git a/storage/perfschema/table_replication_applier_status_by_worker.h b/storage/perfschema/table_replication_applier_status_by_worker.h
index 37d31fee5c8..14689f83f57 100644
--- a/storage/perfschema/table_replication_applier_status_by_worker.h
+++ b/storage/perfschema/table_replication_applier_status_by_worker.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -140,6 +140,7 @@ protected:
public:
~table_replication_applier_status_by_worker();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_replication_connection_configuration.cc b/storage/perfschema/table_replication_connection_configuration.cc
index c3657725a65..ce79cc73362 100644
--- a/storage/perfschema/table_replication_connection_configuration.cc
+++ b/storage/perfschema/table_replication_connection_configuration.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -42,6 +42,11 @@
#ifdef HAVE_REPLICATION
THR_LOCK table_replication_connection_configuration::m_table_lock;
+PFS_engine_table_share_state
+table_replication_connection_configuration::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_connection_configuration::m_share=
{
@@ -74,7 +79,9 @@ table_replication_connection_configuration::m_share=
"IGNORE_SERVER_IDS LONGTEXT not null comment 'Binary log events from servers (ids) to ignore.',"
"REPL_DO_DOMAIN_IDS LONGTEXT not null comment 'Only apply binary logs from these domain ids.',"
"REPL_IGNORE_DOMAIN_IDS LONGTEXT not null comment 'Binary log events from domains to ignore.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
static char *convert_array_to_str(DYNAMIC_ARRAY *ids)
diff --git a/storage/perfschema/table_replication_connection_configuration.h b/storage/perfschema/table_replication_connection_configuration.h
index 7aedcf9c6bc..3949975e397 100644
--- a/storage/perfschema/table_replication_connection_configuration.h
+++ b/storage/perfschema/table_replication_connection_configuration.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -163,6 +163,7 @@ protected:
public:
~table_replication_connection_configuration();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_replication_connection_status.cc b/storage/perfschema/table_replication_connection_status.cc
index fd0b5309f7e..71c02e314ed 100644
--- a/storage/perfschema/table_replication_connection_status.cc
+++ b/storage/perfschema/table_replication_connection_status.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -149,6 +149,11 @@ static const TABLE_FIELD_TYPE field_types[]=
TABLE_FIELD_DEF
table_replication_connection_status::m_field_def= { 11, field_types };
+PFS_engine_table_share_state
+table_replication_connection_status::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_connection_status::m_share=
{
@@ -161,8 +166,9 @@ table_replication_connection_status::m_share=
sizeof(pos_t), /* ref length */
&m_table_lock,
&m_field_def,
- false, /* checked */
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_replication_connection_status::create(void)
diff --git a/storage/perfschema/table_replication_connection_status.h b/storage/perfschema/table_replication_connection_status.h
index 596a4e9ed49..a40ae408dea 100644
--- a/storage/perfschema/table_replication_connection_status.h
+++ b/storage/perfschema/table_replication_connection_status.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -136,6 +136,7 @@ protected:
public:
~table_replication_connection_status();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_replication_group_member_stats.cc b/storage/perfschema/table_replication_group_member_stats.cc
index 7d15e383d70..e4a38bac44f 100644
--- a/storage/perfschema/table_replication_group_member_stats.cc
+++ b/storage/perfschema/table_replication_group_member_stats.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -188,6 +188,11 @@ TABLE_FIELD_DEF
table_replication_group_member_stats::m_field_def=
{ 9, field_types };
+PFS_engine_table_share_state
+table_replication_group_member_stats::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_group_member_stats::m_share=
{
@@ -200,8 +205,9 @@ table_replication_group_member_stats::m_share=
sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
&m_field_def,
- false, /* checked */
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_replication_group_member_stats::create(void)
diff --git a/storage/perfschema/table_replication_group_member_stats.h b/storage/perfschema/table_replication_group_member_stats.h
index 67a05cb8e53..628e87e891d 100644
--- a/storage/perfschema/table_replication_group_member_stats.h
+++ b/storage/perfschema/table_replication_group_member_stats.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2014, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2014, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -101,6 +101,7 @@ protected:
public:
~table_replication_group_member_stats();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_replication_group_members.cc b/storage/perfschema/table_replication_group_members.cc
index 2a870e58ce3..850191373b0 100644
--- a/storage/perfschema/table_replication_group_members.cc
+++ b/storage/perfschema/table_replication_group_members.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -130,6 +130,11 @@ TABLE_FIELD_DEF
table_replication_group_members::m_field_def=
{ 5, field_types };
+PFS_engine_table_share_state
+table_replication_group_members::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_replication_group_members::m_share=
{
@@ -142,8 +147,9 @@ table_replication_group_members::m_share=
sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
&m_field_def,
- false, /* checked */
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_replication_group_members::create(void)
diff --git a/storage/perfschema/table_replication_group_members.h b/storage/perfschema/table_replication_group_members.h
index 2df013fa35b..454f58de048 100644
--- a/storage/perfschema/table_replication_group_members.h
+++ b/storage/perfschema/table_replication_group_members.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+ Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -94,6 +94,7 @@ protected:
public:
~table_replication_group_members();
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_session_account_connect_attrs.cc b/storage/perfschema/table_session_account_connect_attrs.cc
index 563ce03d638..075d66dd5cb 100644
--- a/storage/perfschema/table_session_account_connect_attrs.cc
+++ b/storage/perfschema/table_session_account_connect_attrs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -25,6 +25,11 @@
THR_LOCK table_session_account_connect_attrs::m_table_lock;
+PFS_engine_table_share_state
+table_session_account_connect_attrs::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_session_account_connect_attrs::m_share=
{
@@ -42,7 +47,9 @@ table_session_account_connect_attrs::m_share=
"ATTR_VALUE VARCHAR(1024) comment 'Attribute value.',"
"ORDINAL_POSITION INT comment 'Order in which attribute was added to the connection attributes.'"
") CHARACTER SET utf8 COLLATE utf8_bin") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_session_account_connect_attrs::create()
diff --git a/storage/perfschema/table_session_account_connect_attrs.h b/storage/perfschema/table_session_account_connect_attrs.h
index dec5295808d..ea8d26b719b 100644
--- a/storage/perfschema/table_session_account_connect_attrs.h
+++ b/storage/perfschema/table_session_account_connect_attrs.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -33,6 +33,7 @@
class table_session_account_connect_attrs : public table_session_connect
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
/** Table builder */
diff --git a/storage/perfschema/table_session_connect.cc b/storage/perfschema/table_session_connect.cc
index dfb203c5d46..9d9b1eafc13 100644
--- a/storage/perfschema/table_session_connect.cc
+++ b/storage/perfschema/table_session_connect.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_session_connect.h b/storage/perfschema/table_session_connect.h
index b9be1ce304c..89ae4f221d3 100644
--- a/storage/perfschema/table_session_connect.h
+++ b/storage/perfschema/table_session_connect.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/table_session_connect_attrs.cc b/storage/perfschema/table_session_connect_attrs.cc
index 034ff12c91e..5983f3f18a2 100644
--- a/storage/perfschema/table_session_connect_attrs.cc
+++ b/storage/perfschema/table_session_connect_attrs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -25,6 +25,11 @@
THR_LOCK table_session_connect_attrs::m_table_lock;
+PFS_engine_table_share_state
+table_session_connect_attrs::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_session_connect_attrs::m_share=
{
@@ -42,7 +47,9 @@ table_session_connect_attrs::m_share=
"ATTR_VALUE VARCHAR(1024) comment 'Attribute value.',"
"ORDINAL_POSITION INT comment 'Order in which attribute was added to the connection attributes.'"
") CHARACTER SET utf8 COLLATE utf8_bin") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_session_connect_attrs::create()
diff --git a/storage/perfschema/table_session_connect_attrs.h b/storage/perfschema/table_session_connect_attrs.h
index 823207726f3..c35f4b89f4e 100644
--- a/storage/perfschema/table_session_connect_attrs.h
+++ b/storage/perfschema/table_session_connect_attrs.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -33,6 +33,7 @@
class table_session_connect_attrs : public table_session_connect
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
/** Table builder */
diff --git a/storage/perfschema/table_session_status.cc b/storage/perfschema/table_session_status.cc
index 05795af4f3c..403b2acabfe 100644
--- a/storage/perfschema/table_session_status.cc
+++ b/storage/perfschema/table_session_status.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -35,6 +35,11 @@
THR_LOCK table_session_status::m_table_lock;
+PFS_engine_table_share_state
+table_session_status::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_session_status::m_share=
{
@@ -49,7 +54,9 @@ table_session_status::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE session_status("
"VARIABLE_NAME VARCHAR(64) not null comment 'The session status variable name.',"
"VARIABLE_VALUE VARCHAR(1024) comment 'The session status variable value.')") },
- true /* perpetual */
+ true, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_session_status.h b/storage/perfschema/table_session_status.h
index ed42d3fc57d..d338ccafa8a 100644
--- a/storage/perfschema/table_session_status.h
+++ b/storage/perfschema/table_session_status.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -70,6 +70,7 @@ class table_session_status : public PFS_engine_table
typedef PFS_simple_index pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_session_variables.cc b/storage/perfschema/table_session_variables.cc
index dd6914d81c8..2a37686f6d9 100644
--- a/storage/perfschema/table_session_variables.cc
+++ b/storage/perfschema/table_session_variables.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -35,6 +35,11 @@
THR_LOCK table_session_variables::m_table_lock;
+PFS_engine_table_share_state
+table_session_variables::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_session_variables::m_share=
{
@@ -49,7 +54,8 @@ table_session_variables::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE session_variables("
"VARIABLE_NAME VARCHAR(64) not null,"
"VARIABLE_VALUE VARCHAR(1024))") },
- true /* perpetual */
+ true, /* m_perpetual */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_session_variables.h b/storage/perfschema/table_session_variables.h
index a32b7483bce..0223438824a 100644
--- a/storage/perfschema/table_session_variables.h
+++ b/storage/perfschema/table_session_variables.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -68,6 +68,7 @@ class table_session_variables : public PFS_engine_table
typedef PFS_simple_index pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_setup_actors.cc b/storage/perfschema/table_setup_actors.cc
index 03f42cb6433..e2733a94fcc 100644
--- a/storage/perfschema/table_setup_actors.cc
+++ b/storage/perfschema/table_setup_actors.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_setup_actors::m_table_lock;
+PFS_engine_table_share_state
+table_setup_actors::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_setup_actors::m_share=
{
@@ -55,7 +60,9 @@ table_setup_actors::m_share=
"ROLE CHAR(" USERNAME_CHAR_LENGTH_STR ") collate utf8_bin default '%' not null comment 'Unused',"
"ENABLED ENUM('YES', 'NO') not null default 'YES' comment 'Whether to enable instrumentation for foreground threads matched by the row.',"
"HISTORY ENUM('YES', 'NO') not null default 'YES' comment 'Whether to log historical events for foreground threads matched by the row.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_setup_actors::create()
diff --git a/storage/perfschema/table_setup_actors.h b/storage/perfschema/table_setup_actors.h
index f9c316e3396..758d3b22ef7 100644
--- a/storage/perfschema/table_setup_actors.h
+++ b/storage/perfschema/table_setup_actors.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -62,6 +62,7 @@ struct row_setup_actors
class table_setup_actors : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
/** Table builder. */
diff --git a/storage/perfschema/table_setup_consumers.cc b/storage/perfschema/table_setup_consumers.cc
index 88e689b9ff8..ab2fb030468 100644
--- a/storage/perfschema/table_setup_consumers.cc
+++ b/storage/perfschema/table_setup_consumers.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -131,6 +131,11 @@ static row_setup_consumers all_setup_consumers_data[COUNT_SETUP_CONSUMERS]=
THR_LOCK table_setup_consumers::m_table_lock;
+PFS_engine_table_share_state
+table_setup_consumers::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_setup_consumers::m_share=
{
@@ -145,7 +150,9 @@ table_setup_consumers::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE setup_consumers("
"NAME VARCHAR(64) not null comment 'Consumer name',"
"ENABLED ENUM ('YES', 'NO') not null comment 'YES or NO for whether or not the consumer is enabled. You can modify this column to ensure that event information is added, or is not added.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_setup_consumers::create(void)
diff --git a/storage/perfschema/table_setup_consumers.h b/storage/perfschema/table_setup_consumers.h
index 77cd09dcfbb..8c3479a88b1 100644
--- a/storage/perfschema/table_setup_consumers.h
+++ b/storage/perfschema/table_setup_consumers.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -53,6 +53,7 @@ struct row_setup_consumers
class table_setup_consumers : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_setup_instruments.cc b/storage/perfschema/table_setup_instruments.cc
index 86682b8a1d0..40a17bc1deb 100644
--- a/storage/perfschema/table_setup_instruments.cc
+++ b/storage/perfschema/table_setup_instruments.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -39,6 +39,11 @@
THR_LOCK table_setup_instruments::m_table_lock;
+PFS_engine_table_share_state
+table_setup_instruments::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_setup_instruments::m_share=
{
@@ -54,7 +59,9 @@ table_setup_instruments::m_share=
"NAME VARCHAR(128) not null comment 'Instrument name',"
"ENABLED ENUM ('YES', 'NO') not null comment 'Whether or not the instrument is enabled. It can be disabled, and the instrument will produce no events.',"
"TIMED ENUM ('YES', 'NO') not null comment 'Whether or not the instrument is timed. It can be set, but if disabled, events produced by the instrument will have NULL values for the corresponding TIMER_START, TIMER_END, and TIMER_WAIT values.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_setup_instruments::create(void)
diff --git a/storage/perfschema/table_setup_instruments.h b/storage/perfschema/table_setup_instruments.h
index 59378824236..4b6ad9b46dd 100644
--- a/storage/perfschema/table_setup_instruments.h
+++ b/storage/perfschema/table_setup_instruments.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -91,6 +91,7 @@ struct pos_setup_instruments : public PFS_double_index
class table_setup_instruments : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_setup_objects.cc b/storage/perfschema/table_setup_objects.cc
index b71d3b7afa9..d43ac4ae5e5 100644
--- a/storage/perfschema/table_setup_objects.cc
+++ b/storage/perfschema/table_setup_objects.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,10 @@
#include "field.h"
THR_LOCK table_setup_objects::m_table_lock;
+PFS_engine_table_share_state
+table_setup_objects::m_share_state = {
+ false /* m_checked */
+};
PFS_engine_table_share
table_setup_objects::m_share=
@@ -56,7 +60,9 @@ table_setup_objects::m_share=
"OBJECT_NAME VARCHAR(64) not null default '%' comment 'Name of the instrumented object, either the literal or % for any object.',"
"ENABLED ENUM ('YES', 'NO') not null default 'YES' comment 'Whether the object''s events are instrumented or not. Can be disabled, in which case monitoring is not enabled for those objects.',"
"TIMED ENUM ('YES', 'NO') not null default 'YES' comment 'Whether the object''s events are timed or not. Can be modified.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
int update_derived_flags()
diff --git a/storage/perfschema/table_setup_objects.h b/storage/perfschema/table_setup_objects.h
index feca8fc2f74..2d17e2e15ff 100644
--- a/storage/perfschema/table_setup_objects.h
+++ b/storage/perfschema/table_setup_objects.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -61,6 +61,7 @@ struct row_setup_objects
class table_setup_objects : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
/** Table builder. */
diff --git a/storage/perfschema/table_setup_timers.cc b/storage/perfschema/table_setup_timers.cc
index b8b70981a36..4109f4fc5e6 100644
--- a/storage/perfschema/table_setup_timers.cc
+++ b/storage/perfschema/table_setup_timers.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -61,6 +61,11 @@ static row_setup_timers all_setup_timers_data[COUNT_SETUP_TIMERS]=
THR_LOCK table_setup_timers::m_table_lock;
+PFS_engine_table_share_state
+table_setup_timers::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_setup_timers::m_share=
{
@@ -75,7 +80,9 @@ table_setup_timers::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE setup_timers("
"NAME VARCHAR(64) not null comment 'Type of instrument the timer is used for.',"
"TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null comment 'Timer applying to the instrument type. Can be modified.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_setup_timers::create(void)
diff --git a/storage/perfschema/table_setup_timers.h b/storage/perfschema/table_setup_timers.h
index 9237fa2a059..68bf9a55130 100644
--- a/storage/perfschema/table_setup_timers.h
+++ b/storage/perfschema/table_setup_timers.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -49,6 +49,7 @@ struct row_setup_timers
class table_setup_timers : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_socket_instances.cc b/storage/perfschema/table_socket_instances.cc
index ee1818b900b..7d2e06955f4 100644
--- a/storage/perfschema/table_socket_instances.cc
+++ b/storage/perfschema/table_socket_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_socket_instances::m_table_lock;
+PFS_engine_table_share_state
+table_socket_instances::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_socket_instances::m_share=
{
@@ -56,7 +61,9 @@ table_socket_instances::m_share=
"IP VARCHAR(64) not null comment 'Client IP address. Blank for Unix socket file, otherwise an IPv4 or IPv6 address. Together with the PORT identifies the connection.',"
"PORT INTEGER not null comment 'TCP/IP port number, from 0 to 65535. Together with the IP identifies the connection.',"
"STATE ENUM('IDLE','ACTIVE') not null comment 'Socket status, either IDLE if waiting to receive a request from a client, or ACTIVE')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_socket_instances::create(void)
diff --git a/storage/perfschema/table_socket_instances.h b/storage/perfschema/table_socket_instances.h
index 30f18086c3a..763860d08c1 100644
--- a/storage/perfschema/table_socket_instances.h
+++ b/storage/perfschema/table_socket_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -67,6 +67,7 @@ struct row_socket_instances
class table_socket_instances : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_socket_summary_by_event_name.cc b/storage/perfschema/table_socket_summary_by_event_name.cc
index 6efab95d5b1..77461ea3ede 100644
--- a/storage/perfschema/table_socket_summary_by_event_name.cc
+++ b/storage/perfschema/table_socket_summary_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_socket_summary_by_event_name::m_table_lock;
+PFS_engine_table_share_state
+table_socket_summary_by_event_name::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_socket_summary_by_event_name::m_share=
{
@@ -72,7 +77,9 @@ table_socket_summary_by_event_name::m_share=
"MIN_TIMER_MISC BIGINT unsigned not null comment 'Minimum wait time of all miscellaneous operations that are timed.',"
"AVG_TIMER_MISC BIGINT unsigned not null comment 'Average wait time of all miscellaneous operations that are timed.',"
"MAX_TIMER_MISC BIGINT unsigned not null comment 'Maximum wait time of all miscellaneous operations that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_socket_summary_by_event_name::create(void)
diff --git a/storage/perfschema/table_socket_summary_by_event_name.h b/storage/perfschema/table_socket_summary_by_event_name.h
index 39361b54bb5..f386d62f8ee 100644
--- a/storage/perfschema/table_socket_summary_by_event_name.h
+++ b/storage/perfschema/table_socket_summary_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -56,6 +56,7 @@ struct row_socket_summary_by_event_name
class table_socket_summary_by_event_name : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_socket_summary_by_instance.cc b/storage/perfschema/table_socket_summary_by_instance.cc
index 4bb7a2af773..17ea3d1abe6 100644
--- a/storage/perfschema/table_socket_summary_by_instance.cc
+++ b/storage/perfschema/table_socket_summary_by_instance.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_socket_summary_by_instance::m_table_lock;
+PFS_engine_table_share_state
+table_socket_summary_by_instance::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_socket_summary_by_instance::m_share=
{
@@ -73,7 +78,9 @@ table_socket_summary_by_instance::m_share=
"MIN_TIMER_MISC BIGINT unsigned not null comment 'Minimum wait time of all miscellaneous operations that are timed.',"
"AVG_TIMER_MISC BIGINT unsigned not null comment 'Average wait time of all miscellaneous operations that are timed.',"
"MAX_TIMER_MISC BIGINT unsigned not null comment 'Maximum wait time of all miscellaneous operations that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_socket_summary_by_instance::create(void)
diff --git a/storage/perfschema/table_socket_summary_by_instance.h b/storage/perfschema/table_socket_summary_by_instance.h
index 39a02c939b5..c7712871c51 100644
--- a/storage/perfschema/table_socket_summary_by_instance.h
+++ b/storage/perfschema/table_socket_summary_by_instance.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -59,6 +59,7 @@ struct row_socket_summary_by_instance
class table_socket_summary_by_instance : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_status_by_account.cc b/storage/perfschema/table_status_by_account.cc
index 347012bc064..7ee8c116f70 100644
--- a/storage/perfschema/table_status_by_account.cc
+++ b/storage/perfschema/table_status_by_account.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -36,6 +36,11 @@
THR_LOCK table_status_by_account::m_table_lock;
+PFS_engine_table_share_state
+table_status_by_account::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_status_by_account::m_share=
{
@@ -52,7 +57,9 @@ table_status_by_account::m_share=
"HOST CHAR(60) collate utf8_bin default null comment 'Host for which the status variable is reported.',"
"VARIABLE_NAME VARCHAR(64) not null comment 'Status variable name.',"
"VARIABLE_VALUE VARCHAR(1024) comment 'Aggregated status variable value.' )") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_status_by_account.h b/storage/perfschema/table_status_by_account.h
index 19a4f1db1de..3da5077ebc6 100644
--- a/storage/perfschema/table_status_by_account.h
+++ b/storage/perfschema/table_status_by_account.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -104,6 +104,7 @@ class table_status_by_account : public PFS_engine_table
typedef pos_status_by_account pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_status_by_host.cc b/storage/perfschema/table_status_by_host.cc
index 6b280011565..3837df5cb34 100644
--- a/storage/perfschema/table_status_by_host.cc
+++ b/storage/perfschema/table_status_by_host.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -36,6 +36,11 @@
THR_LOCK table_status_by_host::m_table_lock;
+PFS_engine_table_share_state
+table_status_by_host::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_status_by_host::m_share=
{
@@ -51,7 +56,9 @@ table_status_by_host::m_share=
"HOST CHAR(60) collate utf8_bin default null comment 'Host for which the status variable is reported.',"
"VARIABLE_NAME VARCHAR(64) not null comment 'Status variable name.',"
"VARIABLE_VALUE VARCHAR(1024) comment 'Aggregated status variable value.' )") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_status_by_host.h b/storage/perfschema/table_status_by_host.h
index f1c92268b02..c697638bacf 100644
--- a/storage/perfschema/table_status_by_host.h
+++ b/storage/perfschema/table_status_by_host.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -102,6 +102,7 @@ class table_status_by_host : public PFS_engine_table
typedef pos_status_by_host pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_status_by_thread.cc b/storage/perfschema/table_status_by_thread.cc
index 984a15b26eb..8b1d945609b 100644
--- a/storage/perfschema/table_status_by_thread.cc
+++ b/storage/perfschema/table_status_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -35,6 +35,11 @@
THR_LOCK table_status_by_thread::m_table_lock;
+PFS_engine_table_share_state
+table_status_by_thread::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_status_by_thread::m_share=
{
@@ -50,7 +55,9 @@ table_status_by_thread::m_share=
"THREAD_ID BIGINT unsigned not null comment 'The thread identifier of the session in which the status variable is defined.',"
"VARIABLE_NAME VARCHAR(64) not null comment 'Status variable name.',"
"VARIABLE_VALUE VARCHAR(1024) comment 'Aggregated status variable value.' )") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
@@ -61,7 +68,7 @@ table_status_by_thread::create(void)
int table_status_by_thread::delete_all_rows(void)
{
- /* Lock required to aggregate to global_status_vars. */
+ /* Lock required to aggregate to global_status_var. */
mysql_mutex_lock(&LOCK_status);
reset_status_by_thread();
diff --git a/storage/perfschema/table_status_by_thread.h b/storage/perfschema/table_status_by_thread.h
index 90a1735d1e2..c3f50941597 100644
--- a/storage/perfschema/table_status_by_thread.h
+++ b/storage/perfschema/table_status_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -100,6 +100,7 @@ class table_status_by_thread : public PFS_engine_table
typedef pos_status_by_thread pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_status_by_user.cc b/storage/perfschema/table_status_by_user.cc
index 84f81402e1c..8ea45205ae4 100644
--- a/storage/perfschema/table_status_by_user.cc
+++ b/storage/perfschema/table_status_by_user.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -37,6 +37,11 @@
THR_LOCK table_status_by_user::m_table_lock;
+PFS_engine_table_share_state
+table_status_by_user::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_status_by_user::m_share=
{
@@ -52,7 +57,9 @@ table_status_by_user::m_share=
"USER CHAR(32) collate utf8_bin default null comment 'User for which the status variable is reported.',"
"VARIABLE_NAME VARCHAR(64) not null comment 'Status variable name.',"
"VARIABLE_VALUE VARCHAR(1024) comment 'Aggregated status variable value.' )") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_status_by_user.h b/storage/perfschema/table_status_by_user.h
index 2fe2cc24407..4cf348fdec7 100644
--- a/storage/perfschema/table_status_by_user.h
+++ b/storage/perfschema/table_status_by_user.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -102,6 +102,7 @@ class table_status_by_user : public PFS_engine_table
typedef pos_status_by_user pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_sync_instances.cc b/storage/perfschema/table_sync_instances.cc
index a85dea21ba2..5f2c709170f 100644
--- a/storage/perfschema/table_sync_instances.cc
+++ b/storage/perfschema/table_sync_instances.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_mutex_instances::m_table_lock;
+PFS_engine_table_share_state
+table_mutex_instances::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_mutex_instances::m_share=
{
@@ -53,7 +58,9 @@ table_mutex_instances::m_share=
"NAME VARCHAR(128) not null comment 'Instrument name associated with the mutex.',"
"OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Memory address of the instrumented mutex.',"
"LOCKED_BY_THREAD_ID BIGINT unsigned comment 'The THREAD_ID of the locking thread if a thread has a mutex locked, otherwise NULL.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_mutex_instances::create(void)
@@ -186,6 +193,11 @@ int table_mutex_instances::read_row_values(TABLE *table,
THR_LOCK table_rwlock_instances::m_table_lock;
+PFS_engine_table_share_state
+table_rwlock_instances::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_rwlock_instances::m_share=
{
@@ -202,7 +214,9 @@ table_rwlock_instances::m_share=
"OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Address in memory of the instrumented lock',"
"WRITE_LOCKED_BY_THREAD_ID BIGINT unsigned comment 'THREAD_ID of the locking thread if locked in write (exclusive) mode, otherwise NULL.',"
"READ_LOCKED_BY_COUNT INTEGER unsigned not null comment 'Count of current read locks held')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_rwlock_instances::create(void)
@@ -342,6 +356,11 @@ int table_rwlock_instances::read_row_values(TABLE *table,
THR_LOCK table_cond_instances::m_table_lock;
+PFS_engine_table_share_state
+table_cond_instances::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_cond_instances::m_share=
{
@@ -356,7 +375,9 @@ table_cond_instances::m_share=
{ C_STRING_WITH_LEN("CREATE TABLE cond_instances("
"NAME VARCHAR(128) not null comment 'Client user name for the connection, or NULL if an internal thread.',"
"OBJECT_INSTANCE_BEGIN BIGINT unsigned not null comment 'Address in memory of the instrumented condition.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_cond_instances::create(void)
diff --git a/storage/perfschema/table_sync_instances.h b/storage/perfschema/table_sync_instances.h
index f1f56248a12..ce756cef50c 100644
--- a/storage/perfschema/table_sync_instances.h
+++ b/storage/perfschema/table_sync_instances.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -59,6 +59,7 @@ struct row_mutex_instances
class table_mutex_instances : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -117,6 +118,7 @@ struct row_rwlock_instances
class table_rwlock_instances : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
@@ -169,6 +171,7 @@ struct row_cond_instances
class table_cond_instances : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share. */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_table_handles.cc b/storage/perfschema/table_table_handles.cc
index 91ab7f889e4..d878ce2f7c1 100644
--- a/storage/perfschema/table_table_handles.cc
+++ b/storage/perfschema/table_table_handles.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_table_handles::m_table_lock;
+PFS_engine_table_share_state
+table_table_handles::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_table_handles::m_share=
{
@@ -58,7 +63,9 @@ table_table_handles::m_share=
"OWNER_EVENT_ID BIGINT unsigned comment 'The event which caused the table handle to be opened.',"
"INTERNAL_LOCK VARCHAR(64) comment 'The table lock used at the SQL level.',"
"EXTERNAL_LOCK VARCHAR(64) comment 'The table lock used at the storage engine level.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_table_handles.h b/storage/perfschema/table_table_handles.h
index 3b738d89413..3f2f8c5c1ad 100644
--- a/storage/perfschema/table_table_handles.h
+++ b/storage/perfschema/table_table_handles.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2012, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -63,6 +63,7 @@ struct row_table_handles
class table_table_handles : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_threads.cc b/storage/perfschema/table_threads.cc
index 5528056c022..c98a612eca2 100644
--- a/storage/perfschema/table_threads.cc
+++ b/storage/perfschema/table_threads.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -29,6 +29,11 @@
THR_LOCK table_threads::m_table_lock;
+PFS_engine_table_share_state
+table_threads::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_threads::m_share=
{
@@ -58,7 +63,9 @@ table_threads::m_share=
"HISTORY ENUM ('YES', 'NO') not null comment 'Whether to log historical events for the thread.',"
"CONNECTION_TYPE VARCHAR(16) comment 'The protocol used to establish the connection, or NULL for background threads.',"
"THREAD_OS_ID BIGINT unsigned comment 'The thread or task identifier as defined by the underlying operating system, if there is one.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_threads::create()
diff --git a/storage/perfschema/table_threads.h b/storage/perfschema/table_threads.h
index a7ce83dad72..078dbbda5a9 100644
--- a/storage/perfschema/table_threads.h
+++ b/storage/perfschema/table_threads.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -88,6 +88,7 @@ struct row_threads
class table_threads : public cursor_by_thread
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
/** Table builder */
diff --git a/storage/perfschema/table_tiws_by_index_usage.cc b/storage/perfschema/table_tiws_by_index_usage.cc
index 7375c62ae38..b8f3bfa4039 100644
--- a/storage/perfschema/table_tiws_by_index_usage.cc
+++ b/storage/perfschema/table_tiws_by_index_usage.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_tiws_by_index_usage::m_table_lock;
+PFS_engine_table_share_state
+table_tiws_by_index_usage::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_tiws_by_index_usage::m_share=
{
@@ -89,7 +94,9 @@ table_tiws_by_index_usage::m_share=
"MIN_TIMER_DELETE BIGINT unsigned not null comment 'Minimum wait time of all delete operations that are timed.',"
"AVG_TIMER_DELETE BIGINT unsigned not null comment 'Average wait time of all delete operations that are timed.',"
"MAX_TIMER_DELETE BIGINT unsigned not null comment 'Maximum wait time of all delete operations that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_tiws_by_index_usage.h b/storage/perfschema/table_tiws_by_index_usage.h
index 990f2dede66..64e08683b9b 100644
--- a/storage/perfschema/table_tiws_by_index_usage.h
+++ b/storage/perfschema/table_tiws_by_index_usage.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -80,6 +80,7 @@ struct pos_tiws_by_index_usage : public PFS_double_index
class table_tiws_by_index_usage : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_tiws_by_table.cc b/storage/perfschema/table_tiws_by_table.cc
index cbd754b3342..75eaf70cd8a 100644
--- a/storage/perfschema/table_tiws_by_table.cc
+++ b/storage/perfschema/table_tiws_by_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_tiws_by_table::m_table_lock;
+PFS_engine_table_share_state
+table_tiws_by_table::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_tiws_by_table::m_share=
{
@@ -88,7 +93,9 @@ table_tiws_by_table::m_share=
"MIN_TIMER_DELETE BIGINT unsigned not null comment 'Minimum wait time of all delete operations that are timed.',"
"AVG_TIMER_DELETE BIGINT unsigned not null comment 'Average wait time of all delete operations that are timed.',"
"MAX_TIMER_DELETE BIGINT unsigned not null comment 'Maximum wait time of all delete operations that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_tiws_by_table.h b/storage/perfschema/table_tiws_by_table.h
index 693e07f0e65..fed3b694fde 100644
--- a/storage/perfschema/table_tiws_by_table.h
+++ b/storage/perfschema/table_tiws_by_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -55,6 +55,7 @@ struct row_tiws_by_table
class table_tiws_by_table : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_tlws_by_table.cc b/storage/perfschema/table_tlws_by_table.cc
index ebb01567adf..17bdf6449a6 100644
--- a/storage/perfschema/table_tlws_by_table.cc
+++ b/storage/perfschema/table_tlws_by_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -38,6 +38,11 @@
THR_LOCK table_tlws_by_table::m_table_lock;
+PFS_engine_table_share_state
+table_tlws_by_table::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_tlws_by_table::m_share=
{
@@ -123,7 +128,9 @@ table_tlws_by_table::m_share=
"MIN_TIMER_WRITE_EXTERNAL BIGINT unsigned not null comment 'Minimum wait time of all external write locks that are timed.',"
"AVG_TIMER_WRITE_EXTERNAL BIGINT unsigned not null comment 'Average wait time of all external write locks that are timed.',"
"MAX_TIMER_WRITE_EXTERNAL BIGINT unsigned not null comment 'Maximum wait time of all external write locks that are timed.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_tlws_by_table.h b/storage/perfschema/table_tlws_by_table.h
index 5bcf89d3a24..ba0668e5938 100644
--- a/storage/perfschema/table_tlws_by_table.h
+++ b/storage/perfschema/table_tlws_by_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -55,6 +55,7 @@ struct row_tlws_by_table
class table_tlws_by_table : public PFS_engine_table
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_users.cc b/storage/perfschema/table_users.cc
index d56c90c0270..14fc8bf7db1 100644
--- a/storage/perfschema/table_users.cc
+++ b/storage/perfschema/table_users.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -34,6 +34,11 @@
THR_LOCK table_users::m_table_lock;
+PFS_engine_table_share_state
+table_users::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_users::m_share=
{
@@ -49,7 +54,9 @@ table_users::m_share=
"USER CHAR(" USERNAME_CHAR_LENGTH_STR ") collate utf8_bin default null comment 'The connection''s client user name for the connection, or NULL if an internal thread.',"
"CURRENT_CONNECTIONS bigint not null comment 'Current connections for the user.',"
"TOTAL_CONNECTIONS bigint not null comment 'Total connections for the user.')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table* table_users::create()
diff --git a/storage/perfschema/table_users.h b/storage/perfschema/table_users.h
index c2476c71707..2adc77569d9 100644
--- a/storage/perfschema/table_users.h
+++ b/storage/perfschema/table_users.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -49,6 +49,7 @@ struct row_users
class table_users : public cursor_by_user
{
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
/** Table builder */
diff --git a/storage/perfschema/table_uvar_by_thread.cc b/storage/perfschema/table_uvar_by_thread.cc
index b80ae2beefe..43b9bf347d3 100644
--- a/storage/perfschema/table_uvar_by_thread.cc
+++ b/storage/perfschema/table_uvar_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -129,6 +129,11 @@ void User_variables::materialize(PFS_thread *pfs, THD *thd)
THR_LOCK table_uvar_by_thread::m_table_lock;
+PFS_engine_table_share_state
+table_uvar_by_thread::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_uvar_by_thread::m_share=
{
@@ -144,7 +149,9 @@ table_uvar_by_thread::m_share=
"THREAD_ID BIGINT unsigned not null comment 'The thread identifier of the session in which the variable is defined.',"
"VARIABLE_NAME VARCHAR(64) not null comment 'The variable name, without the leading @ character.',"
"VARIABLE_VALUE LONGBLOB comment 'The variable value')") },
- false /* perpetual */
+ false, /* m_perpetual */
+ false, /* m_optional */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_uvar_by_thread.h b/storage/perfschema/table_uvar_by_thread.h
index cd20897743d..82faf1a52ec 100644
--- a/storage/perfschema/table_uvar_by_thread.h
+++ b/storage/perfschema/table_uvar_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -148,6 +148,7 @@ class table_uvar_by_thread : public PFS_engine_table
typedef pos_uvar_by_thread pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/table_variables_by_thread.cc b/storage/perfschema/table_variables_by_thread.cc
index bdf1aaf5227..db9e4c2c9ec 100644
--- a/storage/perfschema/table_variables_by_thread.cc
+++ b/storage/perfschema/table_variables_by_thread.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -35,6 +35,11 @@
THR_LOCK table_variables_by_thread::m_table_lock;
+PFS_engine_table_share_state
+table_variables_by_thread::m_share_state = {
+ false /* m_checked */
+};
+
PFS_engine_table_share
table_variables_by_thread::m_share=
{
@@ -50,7 +55,8 @@ table_variables_by_thread::m_share=
"THREAD_ID BIGINT unsigned not null,"
"VARIABLE_NAME VARCHAR(64) not null,"
"VARIABLE_VALUE VARCHAR(1024))") },
- true /* perpetual */
+ true, /* m_perpetual */
+ &m_share_state
};
PFS_engine_table*
diff --git a/storage/perfschema/table_variables_by_thread.h b/storage/perfschema/table_variables_by_thread.h
index 5143067adbb..a9e70388366 100644
--- a/storage/perfschema/table_variables_by_thread.h
+++ b/storage/perfschema/table_variables_by_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -101,6 +101,7 @@ class table_variables_by_thread : public PFS_engine_table
typedef pos_variables_by_thread pos_t;
public:
+ static PFS_engine_table_share_state m_share_state;
/** Table share */
static PFS_engine_table_share m_share;
static PFS_engine_table* create();
diff --git a/storage/perfschema/unittest/CMakeLists.txt b/storage/perfschema/unittest/CMakeLists.txt
index 712f22242c3..ce20006a00e 100644
--- a/storage/perfschema/unittest/CMakeLists.txt
+++ b/storage/perfschema/unittest/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2021, Oracle and/or its affiliates.
+# Copyright (c) 2009, 2022, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/conf.txt b/storage/perfschema/unittest/conf.txt
index db9cf980c33..a22d8fd41b2 100644
--- a/storage/perfschema/unittest/conf.txt
+++ b/storage/perfschema/unittest/conf.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2021, Oracle and/or its affiliates.
+# Copyright (c) 2009, 2022, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs-t.cc b/storage/perfschema/unittest/pfs-t.cc
index 2240c2917e8..412184ecbed 100644
--- a/storage/perfschema/unittest/pfs-t.cc
+++ b/storage/perfschema/unittest/pfs-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_account-oom-t.cc b/storage/perfschema/unittest/pfs_account-oom-t.cc
index ea39903484c..68190218b74 100644
--- a/storage/perfschema/unittest/pfs_account-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_account-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_connect_attr-t.cc b/storage/perfschema/unittest/pfs_connect_attr-t.cc
index e414a17a1ef..c09f10fd7de 100644
--- a/storage/perfschema/unittest/pfs_connect_attr-t.cc
+++ b/storage/perfschema/unittest/pfs_connect_attr-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_host-oom-t.cc b/storage/perfschema/unittest/pfs_host-oom-t.cc
index 0dc77f9e307..1e46963fcb8 100644
--- a/storage/perfschema/unittest/pfs_host-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_host-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_instr-oom-t.cc b/storage/perfschema/unittest/pfs_instr-oom-t.cc
index 5f0d97e6be4..eff2385ef48 100644
--- a/storage/perfschema/unittest/pfs_instr-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_instr-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_instr-t.cc b/storage/perfschema/unittest/pfs_instr-t.cc
index 95971214c83..b0d3bd9c36f 100644
--- a/storage/perfschema/unittest/pfs_instr-t.cc
+++ b/storage/perfschema/unittest/pfs_instr-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
index da80a658f99..612cc5adf3f 100644
--- a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_instr_class-t.cc b/storage/perfschema/unittest/pfs_instr_class-t.cc
index 09a38706b86..b5f08f739ac 100644
--- a/storage/perfschema/unittest/pfs_instr_class-t.cc
+++ b/storage/perfschema/unittest/pfs_instr_class-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_misc-t.cc b/storage/perfschema/unittest/pfs_misc-t.cc
index e2522a053e1..6765dca0550 100644
--- a/storage/perfschema/unittest/pfs_misc-t.cc
+++ b/storage/perfschema/unittest/pfs_misc-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_noop-t.cc b/storage/perfschema/unittest/pfs_noop-t.cc
index e577a7cc509..896a29d1bd4 100644
--- a/storage/perfschema/unittest/pfs_noop-t.cc
+++ b/storage/perfschema/unittest/pfs_noop-t.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2013, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2013, 2022, Oracle and/or its affiliates.
+ Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
@@ -228,6 +229,8 @@ void test_noop()
PSI_server->set_thread_THD(NULL, NULL);
+ PSI_server->set_thread_peer_port(NULL, 0);
+
ok(true, "all noop api called");
}
diff --git a/storage/perfschema/unittest/pfs_server_stubs.cc b/storage/perfschema/unittest/pfs_server_stubs.cc
index 9fc3b2fb143..a873bdcbd10 100644
--- a/storage/perfschema/unittest/pfs_server_stubs.cc
+++ b/storage/perfschema/unittest/pfs_server_stubs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/unittest/pfs_timer-t.cc b/storage/perfschema/unittest/pfs_timer-t.cc
index 22fdb163aed..07f61f59fe7 100644
--- a/storage/perfschema/unittest/pfs_timer-t.cc
+++ b/storage/perfschema/unittest/pfs_timer-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/pfs_user-oom-t.cc b/storage/perfschema/unittest/pfs_user-oom-t.cc
index 4cc23a018d2..62748648ea1 100644
--- a/storage/perfschema/unittest/pfs_user-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_user-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2011, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/stub_global_status_var.h b/storage/perfschema/unittest/stub_global_status_var.h
index c2785d2eac1..e985ad25bbf 100644
--- a/storage/perfschema/unittest/stub_global_status_var.h
+++ b/storage/perfschema/unittest/stub_global_status_var.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2015, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/stub_pfs_defaults.h b/storage/perfschema/unittest/stub_pfs_defaults.h
index 338fd9f8324..354d2291fa3 100644
--- a/storage/perfschema/unittest/stub_pfs_defaults.h
+++ b/storage/perfschema/unittest/stub_pfs_defaults.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2010, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
diff --git a/storage/perfschema/unittest/stub_pfs_global.h b/storage/perfschema/unittest/stub_pfs_global.h
index 450633ad466..b43d53a43f4 100644
--- a/storage/perfschema/unittest/stub_pfs_global.h
+++ b/storage/perfschema/unittest/stub_pfs_global.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
diff --git a/storage/perfschema/unittest/stub_print_error.h b/storage/perfschema/unittest/stub_print_error.h
index ac1ecf1f637..7f6df940515 100644
--- a/storage/perfschema/unittest/stub_print_error.h
+++ b/storage/perfschema/unittest/stub_print_error.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
+/* Copyright (c) 2008, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,